yashsingh1/xdaforums huggingface dataset:
[Motorola One Guides, News, & Discussion] Polyparadox:
I was greeted by a "Decrypt data" screen. I did set up phone encryption when first booting into the firmware, however I couldn't decrpyt using the pin I set up for phone encryption.

Mounting seemed to work fine (not for internal- external- and USB OTG storage).

I forgot to check MTP but I don't think that it'll work because of the encryption.

I did a factory reset (using Android, not the bootloader) and it still won't let me Decrypt.

Running the command I needed root for also worked flawlessly. I will transcribe the command output and'll post it here.

Edit: Here's what /proc/partitions looks like:

179 0 61071360 mmcblk0
179 1 512 mmcblk0p1
179 2 512 mmcblk0p2
179 3 256 mmcblk0p3
179 4 256 mmcblk0p4
179 5 1792 mmcblk0p5
179 6 1792 mmcblk0p6
179 7 64 mmcblk0p7
179 8 64 mmcblk0p8
179 9 1536 mmcblk0p9
179 10 1536 mmcblk0p10
179 11 1024 mmcblk0p11
179 12 1024 mmcblk0p12
179 13 1024 mmcblk0p13
179 14 1024 mmcblk0p14
179 15 1024 mmcblk0p15
179 16 1024 mmcblk0p16
179 17 192 mmcblk0p17
179 18 192 mmcblk0p18
179 19 102400 mmcblk0p19
179 20 102400 mmcblk0p20
179 21 4 mmcblk0p21
179 22 8 mmcblk0p22
179 23 16384 mmcblk0p23
179 24 16384 mmcblk0p24
179 25 32 mmcblk0p25
179 26 512 mmcblk0p26
179 27 512 mmcblk0p27
179 28 2048 mmcblk0p28
179 29 2048 mmcblk0p29
179 30 12288 mmcblk0p30
179 31 12288 mmcblk0p31
259 0 32768 mmcblk0p32
259 1 512 mmcblk0p33
259 2 128 mmcblk0p34
259 3 16384 mmcblk0p35
259 4 16384 mmcblk0p36
259 5 16384 mmcblk0p37
259 6 512 mmcblk0p38
259 7 8192 mmcblk0p39
259 8 65536 mmcblk0p40
259 9 65536 mmcblk0p41
259 10 16384 mmcblk0p42
259 11 16384 mmcblk0p43
259 12 1024 mmcblk0p44
259 13 512 mmcblk0p45
259 14 512 mmcblk0p46
259 15 2048 mmcblk0p47
259 16 256 mmcblk0p48
259 17 256 mmcblk0p49
259 18 8 mmcblk0p50
259 19 64 mmcblk0p51
259 20 64 mmcblk0p52
259 21 13056 mmcblk0p53
259 22 8192 mmcblk0p54
259 23 8192 mmcblk0p55
259 24 196608 mmcblk0p56
259 25 196608 mmcblk0p57
259 26 524288 mmcblk0p58
259 27 524288 mmcblk0p59
259 28 2621440 mmcblk0p60
259 29 2621440 mmcblk0p61
259 30 53813231 mmcblk0p62
179 32 4096 mmcblk0rpmb
[Motorola One Guides, News, & Discussion] borksek:
We need to have a way to skip it aka no-verity or force-decrypt. We don't have a developer who can do this. [MENTION=4480917]Alberto97[/MENTION] helped us getting twrp and I don't think he has any more intentions of helping. But he gave us a super head up! What a legend ❤
[Motorola One Guides, News, & Discussion] Polyparadox:
Man, I wish I had the skills to port TWRP. But yeah that's true, a huge thank you to [MENTION=4480917]Alberto97[/MENTION]!

Also look at my last post in this thread, I've got the partitions.
[Motorola One Guides, News, & Discussion] borksek:
Does anyone have the guts to flash the twrp image?? The command is "fastboot flash recovery twrp-dean-0.img
[Motorola One Guides, News, & Discussion] tys0n:
Yeah, We need to format data and then patch boot and fstab so that forced encryption gets disabled so that we can mount data in TWRP.

This should probably work Universal DM-Verity, ForceEncrypt, Disk Quota Disablers
[Motorola One Guides, News, & Discussion] borksek:
Try it and post results! Mildly interested
[Motorola One Guides, News, & Discussion] Polyparadox:
Recovery is not a valid partition. I always use "fastboot boot twrp-dean-0.img" to boot up twrp.

I'll back up my phone and try it out right now
[Motorola One Guides, News, & Discussion] borksek:
Can you confirm that backup works? If it does, please upload the file to google drive or mega "your choice"
[Motorola One Guides, News, & Discussion] tys0n:
Yes, that's how we have to boot it. A/B devices doesn't have it's own recovery partition. Recovery is inside of boot.img

Great! Let us know..

...and just to inform everyone else who may not know, format data will also include internal memory, so it's not the same thing as a TWRP factory reset where internal memory stays intact.

Always back up things like photos before format data, or they will be gone
[Motorola One Guides, News, & Discussion] Polyparadox:
I only did a backup using Google, becuase backing up in TWRP is not possible (decryption doesn't let me use the user storage)

Well, I did following:

I deleted /data

I installed the zip successfully

I saw that /data was formatted as ext4 and not emmc

Rebooted to system -> bootloop

Start TWRP and now it's the same decryption problem again

Did I do something wrong?
[Motorola One Guides, News, & Discussion] borksek:
https://xdaforums.com/doogee-mix/how-to/fixed-how-to-remove-data-encryption-twrp-t3757595

you probably did. If you somehow re-flash the system try to do this. you should never wipe data, you should format it.
[Motorola One Guides, News, & Discussion] tys0n:
If I remember it right, our device use f2fs filesystem for data so maybe that's why it didn't boot. I had the same problem on Moto g5. You can make it f2fs in TWRP.

Skickat från min Moto G5 via Tapatalk
[Motorola One Guides, News, & Discussion] borksek:
When you format doesn't it automatically do the filesystem of f2fs?
[Motorola One Guides, News, & Discussion] Polyparadox:
I'll try to explicitly format it to f2fs after work today.

I think by default it formats to ext4
[Motorola One Guides, News, & Discussion] borksek:
The more you know ??
[Motorola One Guides, News, & Discussion] tys0n:
Yes, I was right. It's f2fs filesystem on /data.

deen_sprout:/ $ cat /proc/mounts
rootfs / rootfs rw,seclabel 0 0
/dev/root / ext4 ro,seclabel,relatime,data=ordered,inode_readahead_blks=8 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,size=1816732k,nr_inodes=454183,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime,gid=3009,hidepid=2 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
/dev/block/dm-1 /vendor ext4 ro,seclabel,relatime,discard,data=ordered 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime 0 0
tmpfs /mnt tmpfs rw,seclabel,relatime,size=1816732k,nr_inodes=454183,mode=755,gid=1000 0 0
none /config configfs rw,relatime 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
pstore /sys/fs/pstore pstore rw,seclabel,relatime 0 0
/dev/block/bootdevice/by-name/modem_a /firmware ext4 ro,context=u:object_r:firmware_file:s0,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/dsp_a /dsp ext4 ro,defcontext=u:object_r:adsprpcd_file:s0,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/fsg_a /vendor/fsg ext4 ro,context=u:object_r:fsg_file:s0,nosuid,nodev,relatime 0 0
/dev/block/dm-2 /oem ext4 ro,context=u:object_r:oemfs:s0,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/persist /persist ext4 rw,defcontext=u:object_r:persist_file:s0,seclabel,nosuid,nodev,noatime,data=ordered 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
tmpfs /storage tmpfs rw,seclabel,relatime,size=1816732k,nr_inodes=454183,mode=755,gid=1000 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,seclabel,relatime 0 0
[COLOR="Lime"]/dev/block/dm-3 /data f2fs[/COLOR] rw,seclabel,nosuid,nodev,noatime,nodiratime,background_gc=on,discard,user_xattr,inline_xattr,acl,inline_data,nobarrier,extent_cache,active_logs=6,reserved=100MB,fsuid=10010 0 0
/data/media /mnt/runtime/default/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,reserved=100MB 0 0
/data/media /storage/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,reserved=100MB 0 0
/data/media /mnt/runtime/read/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid,reserved=100MB 0 0
/data/media /mnt/runtime/write/emulated sdcardfs rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,reserved=100MB 0 0
deen_sprout:/ $
[Motorola One Guides, News, & Discussion] Polyparadox:
I formatted data, it was unlocked of course; I flashed magisk, started the phone and it wiped data again (after a bootloop) and then started normally. It did encrypt the phone again.

Edit: something weird happend. Started android, set up everything. I went to the developer options and saw that Android doesn't know that my bootloader is unlocked. So I went ahead and installed safety net checker and saw that it passed everything. I can even install and use Google Pay.
[Motorola One Guides, News, & Discussion] tys0n:
I didn't have any luck with disable encryption neither. Works fine to mount data after format, but once rebooted it seems to be enabled again. Gonna have to read up on this and try some other things.

I also noticed that external sdcard can't be mounted in TWRP.

Safety net works fine even rooted with magisk. It's good at hiding itself ;) Android pay, Certified Play store etc.
[Motorola One Guides, News, & Discussion] Polyparadox:
Safety net never worked for until now.

But how did you root?
[Motorola One Guides, News, & Discussion] borksek:
If anyone can try this out for me, i'd be greatfull; https://xdaforums.com/android/software/universal-dm-verity-forceencrypt-t3817389
[Motorola One Guides, News, & Discussion] Alberto97:
Thank you guys for trying the provious build and providing the partition table! I'd like to fix the remaining issues though, for this reason I have another couple of builds I'd like you to try here and here where I'm trying to fix data decryption. A fix for the external sd is included in both too (addison has been affected by the same problem for months therefore the fix should be the same).

If usb otg is still broken, please post here the output of ls /dev/block from TWRP terminal with the adapter connected.

If data decryption is still broken instead, please attach a recovery log (available under Advanced -> Copy Log). Also are you on oreo or pie?
[Motorola One Guides, News, & Discussion] Polyparadox:
Thank you!

Unfortunately decryption didn't work in either builds but SD card works now. I don't have an OTG adapter for USB C so I can't test that.

I am on Android Pie and here is the dmesg.log and recovery.log (first appearance of "decrypt" on line 77).

Here's the content of /dev/block/.
[Motorola One Guides, News, & Discussion] Alberto97:
Ah sorry I must have misunderstood the OTG thing, I expected it to be working like the SD in fact.

I hoped for the logs to be more verbose but at least they point to an issue with the keymaster service that I'm unable to reproduce on my addison, would you mind to run android.hardware.keymaster@3.0-service-qti manually from the terminal? This should point out the actual issue
[Motorola One Guides, News, & Discussion] Polyparadox:
Here's the output of that command:

Configure failed
libc: Fatal signal 6 (SIGABRT), code -6 in tid 511 (android.hardwar), pid 511 (android.hardwar)
Aborted
[Motorola One Guides, News, & Discussion] Alberto97:
Ouch, still cryptic, sounds like pie needs updated encryption blobs. I'll try to get them to work on my 8.1 environment but that's unlikey they will do aand I don't have space enough for omni 9.0 sources too :rolleyes:
[Motorola One Guides, News, & Discussion] Polyparadox:
The PID shown in that messages also doesn't show up in ps or top, so I'm guessing it's its own PID :confused:

---------- Post added at 21:32 ---------- Previous post was at 21:19 ----------

Might the shell application "keystore_cli_v2" on android bring any helpful results?

Commands: brillo-platform-test [--prefix=<test_name_prefix>] [--test_for_0_3]
list-brillo-tests
add-entropy --input=<entropy> [--seclevel=software|strongbox|tee(default)]
generate --name=<key_name> [--seclevel=software|strongbox|tee(default)]
get-chars --name=<key_name>
export --name=<key_name>
delete --name=<key_name>
delete-all
exists --name=<key_name>
list [--prefix=<key_name_prefix>]
sign-verify --name=<key_name>
[en|de]crypt --name=<key_name> --in=<file> --out=<file>
[--seclevel=software|strongbox|tee(default)]
confirmation --prompt_text=<PromptText> --extra_data=<hex>
--locale=<locale> [--ui_options=<list_of_ints>]
--cancel_after=<seconds>
[Motorola One Guides, News, & Discussion] borksek:
Can you use this TWRP to flash Treble roms?
[Motorola One Guides, News, & Discussion] Alberto97:
Unfortunately pie crypto stuff is too big for my addison boot/recovery partition. I'm unable to do any basic check even if I could download omni pie sources therefore I'm stuck :rolleyes:

If anyone want to give it a try my sources are up on my github.

IIRC someone flashed magisk with my twrp, if that works, treble roms can be installed too. Of course they might not work correctly for other reasons.
[Motorola One Guides, News, & Discussion] borksek:
Is there a way to get the Device Tree for the device? Even with that we are stuck since msm8953 proprietary blobs has not been released by themuppets github
[Motorola One Guides, News, & Discussion] Polyparadox:
Thank you for your help!

And yes I flashed Magisk with your TWRP and I also don't see 2hy flashing other ROMs wouldn't work.
[Motorola One Guides, News, & Discussion] borksek:
Can someone give me a step by step on how to flash a project treble rom for the motorola one? I've never had a treble device as I'm just getting the Motorola One in a few weeks. Also, please be noob friendly. I am pretty familiar with fastboot and TWRP since I've had the moto e condor before dropping it and destroying the whole screen with only barcodes showing. Also, if there can be a fool-proof way "so even my dumb brain can't **** this upp, I'd be happy.
[Motorola One Guides, News, & Discussion] tys0n:
Ok, I booted up "twrp-deen-2.img" and I can confirm that external sdcard and usb-otg works, so it's the damn decryption thing that stops it from being really usefull.

Like if you install a magisk module and gets bootloop, there's not much you can do except for reset, as data can't be mounted in recovery. lol

Happened to me yesterday.
[Motorola One Guides, News, & Discussion] borksek:
Where did u get that?
[Motorola One Guides, News, & Discussion] tys0n:
2nd link in this post: https://xdaforums.com/showpost.php?p=78365101&postcount=34
[Motorola One Guides, News, & Discussion] Alberto97:
Almost a month later but I should have figured out what this means. It wasn't about newer binaries but recovery security patch level and android version did not match system ones. The script that workarounds this has been fixed, unless new binaries are required for another reason (and I hope they're not, twrp/omni 9 sources aren't exactly ready yet), I'm confident decryption is working now. Please try this build.

By the way with Pie Motorola moved to a more convenient way to include the dt image into recovery/kernel, I did the same with the latest build. If TWRP does not boot anymore, please try this one that uses the old way.

As always if decryption still does not work, please attach dmesg and recovery log. Thank you everyone :)
[Motorola One Guides, News, & Discussion] borksek:
Will try when I'm home.
[Motorola One Guides, News, & Discussion] borksek:
[MENTION=3245411]tys0n[/MENTION] attempt it? Maybe decryption works. Tell us results!
[Motorola One Guides, News, & Discussion] tys0n:
I've been trying different stuff with these releases. First, I can tell you that both v3 & 4 boots fine.

Tried to decrypt without success though :/

I have tried to set up device without screen lock, with pattern, and with password. Everything fails to be decrypted in twrp.

I'm not even sure how to "convert" a pattern into a password, cause that's what twrp asks for.

I've also tried with edited fstab.qcom to disable the forced encryption, and format data, but it still gets encrypted on first boot to system.

I'll put up recovery.log and dmesg later tonight when I get some time over. I think I'll have to get them with adb shell.

Stupid me used the "copy log" alternative in twrp without thinking, but ofc it didn't work as I think it tries to copy it to /data/media.
[Motorola One Guides, News, & Discussion] tys0n:
[MENTION=4480917]Alberto97[/MENTION]

So, I booted twrp-deen-3.img and tried decryption once again.

Here's the logs attached.

I also noticed that it fails instantly with :"failed to decrypt data" , but if I mount /system, /vendor & /persist before attempting to decrypt, it will try for about 10-15 sec before it says :"decrypt took to long, killing process".

Not sure if it has any meaning to it though. The outcome is the same: failed to decrypt data.
[Motorola One Guides, News, & Discussion] borksek:
Did you try the deen_4?
[Motorola One Guides, News, & Discussion] tys0n:
Yes I've tried a few different things on both.
[Motorola One Guides, News, & Discussion] Alberto97:
Thanks, once again keymaster is crashing... Could you type in twrp terminal android.hardware.keymaster@3.0-service-qti and post the result please?

Also is firmware partition mounted or unmounted? If the binary needs something it might be there. I should really enable logcat the next time...
[Motorola One Guides, News, & Discussion] borksek:
I do not know if the firmware partition is mounted or not, but the command gives this:

libc: Fatal signal 6 (SIGABRT), code -6 in tid 540 (android.hardwar), pid 540 (android.hardwar)

aboted
[Motorola One Guides, News, & Discussion] tys0n:
Yes, I've also tried decryption with /firmware mounted.

Here's outcome of android.hardware.keymaster@3.0-service-qti

---------- Post added at 11:00 PM ---------- Previous post was at 10:54 PM ----------

First time I forgot to mount before command. Second command is with all partitions mounted. Don't know if it makes more sense.
[Motorola One Guides, News, & Discussion] Alberto97:
Ugh, this again... I can't even enable logcat in twrp. For some reason the damon keeps crashing. I added some more (I'd say random) stuff in this build as seen on other devices. If not even this one works, I give up.
[Motorola One Guides, News, & Discussion] borksek:
Nope. You still can't access storage. Shows as 0 mb. Any steps to make it work or you just need to boot twrp and it should work else its ecrypted?
[Motorola One Guides, News, & Discussion] Alberto97:
Unless you set a pin/password/pattern at boot (usually you don't and use the "post-boot" ones) twrp just boots and shows data when encryption/decryption works.
[Motorola One Guides, News, & Discussion] borksek:
Phone says encrypted even w/o pin.
[Motorola One Guides, News, & Discussion] borksek:
Also please don't give up on us. Your our only chance for a working TWRP...
[Motorola One Guides, News, & Discussion] tys0n:
Out of curiosity, I asked about decryption in the telegram dev group for "chef" (Motorola One Power) and I was told that it isn't working on their official twrp neither.

Maybe we just have to wait until someone figure out how to make it work.

It could be that decryption works similar on these two devices since they're both snapdragon, Android one 9.0 devices made by Moto even though they're build on different soc's.
[Motorola One Guides, News, & Discussion] borksek:
Hello Alberto, can you give me the ramdisk folder? Since access is denied when trying to unpack boot.img.
[Motorola One Guides, News, & Discussion] borksek:
[MENTION=4480917]Alberto97[/MENTION]

service sys_vold /system/bin/vold \

--blkid_context=u:r:blkid:s0 --blkid_untrusted_context=u:r:blkid_untrusted:s0 \

--fsck_context=u:r:fsck:s0 --fsck_untrusted_context=u:r:fsck_untrusted:s0

socket vold stream 0660 root mount

socket cryptd stream 0660 root mount

setenv PATH /system/bin

setenv LD_LIBRARY_PATH /system/lib64:/system/lib

disabled

oneshot

this is a file i found in motorola one power recovery.

with the name init.recovery.vold_decrypt.rc

maybe this has something to do with encryption? Tell us results :p
[Motorola One Guides, News, & Discussion] borksek:
Duplicate
[Motorola One Guides, News, & Discussion] Alberto97:
Yes... removing pin/pattern/password etc does not remove encryption. The only way to do that is modifying the fstab and that still requires erasing userdata with fastboot (or format data on TWRP or wipe data on stock recovery).

I could not understand how that's possible it was working in fact. It does not workaround the recovery-system security patch level-android version mismatch which is required (unless moto changed some logic) with file based encryption. I thought it was required here as well but at this point I'm not so sure about that. Despite deen and chef are marketed as "brothers" they actually are very different devices.

chef 's SoC uses a 4.4 kernel hence it can (and it does) use the "new" file based encryption while deen's SoC comes with a 3.18 kernel which is stuck with the old full disk encryption just like my addison.

The problem here is that deen was shipped with oreo. For this reason it comes with a binderized encryption implementation as per Oreo requirements while addison kept using the legacy one (they can do that since they only upgraded the device to O). Because of this difference, this implementation is a sort of half way between FDE and FBE (they use the same binaries but the underlying behavior is different).

Just I did not expect it to be so that much different and I gave it a try anyway. Plus there aren't many devices that behaves this way because nowadays everyone uses FBE. The only one I know is in the same situation is the Mi A2 Lite which has official twrp with working decryption but I'm already using their configuration and it does not work here for some reason.

Sooo I doubt I'll get encryption to work without playing myself with a device that works in a similar way.

Uhm I don't see that in chef's ramdisk but yeah that's another way to decrypt that relies on system partition. Anyway considering the binaries on system are built for pie while twrp is built on oreo almost certainly there will be some symbol loss that breaks the procedure. I don't really like this, in case system is empty/wiped decryption would not work and considering this is an AB device it isn't unlikely.

BTW: My ramdisk is lzma compressed instead of gzip, whatever you're trying to do you have to use a decompressor that supports lzma.
[Motorola One Guides, News, & Discussion] borksek:
I've also found a verity key in root of the Motorola. I can pull and give it if it may help with something. And I think we need a no verity kernel since we have modified fstab. If you want I can also give stock fstab if it can help with anything. And I heard that magisk actually disables encryption. Tell me what stuff you need and I'll give you it :)

Edit: I've also made a way to actually flash your TWRP but it makes so you can't mount sd card. It uses CPIO which i'll upload in a sec if you know how to fix the SD card problem. [MENTION=3245411]tys0n[/MENTION] has flashed it and flashing works with no problem only that sd-card doesnt mount. Here is the zip file that has the cpio: https://www.androidfilehost.com/?fid=11410963190603891919 .You can edit it with gedit (on linux) or notepad ++ on windows. You can also extract it on linux if you need that.
[Motorola One Guides, News, & Discussion] Alberto97:
Verity is another thing and it's not the problem here, once you disable it from fstab you're fine. Magisk disables verity and forced encryption, you still have to erase userdata to get rid of encryption.

Sdcard needs to be fixed dt side, you can't get it to work with an installer with stock kernel.
[Motorola One Guides, News, & Discussion] borksek:
Can you help making it work properly?
[Motorola One Guides, News, & Discussion] borksek:
Hey! I've been meaning to ask you if you could give us the link for the twrp tree you used to build for this twrp. It would be very appreciated