yashsingh1/xdaforums huggingface dataset:
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Why isn't magisk flash able with this twrp like it is with river and ocean leaving us with the only option of flashing magisk patched img

/09/[emoji645]/[emoji725]/

---------- Post added at 05:43 PM ---------- Previous post was at 05:40 PM ----------

Are there any GSI or with stock flashing magisk in twrp will work

/09/[emoji645]/[emoji725]/
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
If encryption was enabled it will prevent Magisk from flashing. Other than that, you should be able to just install Magisk. If Magisk breaks twrp, then it's a Magisk issue. The process should be, install twrp to the ramdisk, then patch the same boot.img with Magisk. Have you tried Magisk 19.3?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
So you was able to have magisk and twrp to work on stock and have twrp and magisk to work on Android 9 GSI (and that magisk flashing in twrrp for Android 10 GSIs are broken only way to get magisk to work on android 10 GSI is with magisk patched img with recovery mode set which eliminates you using twrp threw recovery) in regards to restoring a twrrp backup does restoring work from external SD card or you can only restore from internal storage like river and ocean

/09/[emoji645]/[emoji725]/
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] BobbyBlunt:
Will give this a try as soon as I get home. Wasn't expecting such a quick reply. Thank you and thank you for helping us get this far
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Spaceminer I followed the instructions that you wrote Bobby blunt about getting TWRP to work with stock and it didn't work used the zip from the G6 forum and that didn't work the issue with TWRP after stock rom had data persisted of it not opening like Bobby blunt explained so I then went into the fstab file with a text editor and it already said encryptable (posting screenshot) this issue doesn't occurr on the GSIs TWRP does stick there after GSI has data but doesn't happen with stock what are we doing wrong that it's not working if you can definitely say u got TWRP to stick on the G7 play stock rom ?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Can you pull /vendor/etc/fstab.qcom and send it to me? The readout from running

cat /proc/cpuinfo

would also be helpful. And one more thing; what's your firmware channel? (RETUS, RETEU?) I'm going to see if I can fix this up tonight.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
I'm a boost user however I'm on retail firmware (still using sprint firmware modem so I won't get sim lock while I'm on retail firmware cause my device is not network unlocked)
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Fstab (untouched) and CPU info readoutView attachment G7.zip

View attachment 4941451
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Are you using the most recent build, RETAIL_9.0_PPYS29.105-134-7?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Yeah bro I flashed back from lineage17 to help you get this twrp4 hopefully evolved to twrp 5 and you fixing that phh zip for us G7 play users

View attachment 4941461
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Make sure you have the stock OS installed to both slots. Also make sure encryption is disabled. Try using fastboot boot twrp.img then try flashing the installer. After flashing the zip, use the menus in twrp to reboot directly back into recovery.

After rebooting into twrp wipe > format > type "yes" to continue. Reboot directly into twrp from the menus once more. See if you can mount /data. If that works, flash any recent version of magisk that you know works on stock. If you run into any errors let me know.

If everything goes well... Let the OS boot up once, and see if Magisk is installed. If it's good to go, reboot into recovery and verify that twrp is working. If you have both, try making and restoring a fresh backup.

Just a note, if you run LOS 17 and need root, flash the stock unmodified boot.img before flashing phh superuser.

Download: twrp.img
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Alright im going to test this out and report to you... hopefully this will be TWRP 5 ( that megaupload is that twrp 4 or a new revised twrp)
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Alright so the twrp installer zip patched twrp to the ramdisk without me having to manually patch to the ramdisk inside of twrp however after flashing decryption zip after stock boots up the rom is still encrypted (so twrp didn't stick still) so the flashing of the magisk zip didn't work also this twrp you posted on mega is the twrp 4 which is the one I was using when I encountered the issue of flashing the phh zip in Los so that still didn't work and I wasn't able to aquire root in Los
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
What I just uploaded is definitely not twrp4. Did you flash the disabler immediately after flashing the twrp installer?

Edit: When you boot into recovery does it take you to the stock recovery, or twrp?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
I assume they were cause the mega upload is the same exact size as twrp 4, I reflashed stock firmware fast booted into twrp flashed the installer then I rebooted formated data then did magisk then installed decryption zip and rebooted magisk not installed and device still encrypted

([emoji3590]09-09-18[emoji3590])

---------- Post added at 04:39 AM ---------- Previous post was at 04:35 AM ----------

Also tried flashing the los root zip before on clean boot img and still gave me that error

([emoji3590]09-09-18[emoji3590])

---------- Post added at 04:42 AM ---------- Previous post was at 04:39 AM ----------

It's takes me to twwrp but it doesn't open cause the device is still encrypted

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
You need to format data using the yes option, then reboot directly back into twrp by using the menus. Mount /data, /vendor, & /system, then flash the disabler, remount /data, /vendor, & /system again and flash Magisk last.

If you follow those steps exactly, it "should" work.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Alright I will try it that way hopefully it will make a difference

([emoji3590]09-09-18[emoji3590])

---------- Post added at 05:10 AM ---------- Previous post was at 04:51 AM ----------

I did it the exact way you said and Device is still encrypted which means twrp doesn't stick and magisk is still not installed, and los zip still didn't work its something with this recovery and on a GSi I tried a back up from internal storage and device boot looped

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
I might've just found the problem. There was an interesting line in the prop.default of the stock boot.img, persist.vold.ecryptfs_supported=true. And the boot csv number was wrong in twrp. I'm going to change it to false, make a modified boot.img, and make another recovery.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Alright Bro I'm here to do all the testing you need however why on the GSI rom it still decrypts with decryption zip when using stock img on GSI Rom

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] alecxs:
did you see post #297 from Spaceminer, disable_dm-verity and magisk both rely on anykernel, so they currently share the same bug
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
So you know why this twrp is not being able to decrypt stock rom with decrypt zip why magisk is not flashing root on stock and why when backups in twrp are restored in gsi with rom decrypted they boot loop the device the only answer I can speculate is that twrp doesn't stick on the stock rom is cause it's not being decrypted
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] alecxs:
if twrp is not able to decrypt then the twrp build does not support decryption, your firmware or vendor is broken, or you messed up with encryption credentials. in any case it's simply impossible to decrypt then, there exist no such thing like decrypt zip

so your only choice left is to format data. if you want to stay unencrypted you need to disable forceencryption. you can patch your fstab manually as suggested, or flash the older versions of magisk and dm-verity-forceencrypt-disabler (as suggested)

i don't know if this fixes your issues with boot or rooting but i can for sure say once you used current zip release there is no way back than reversing to stock images
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
It's the twrp obviously little by little spaceminer getting it better and better he making it work without even having the phone if he had the phone we would of had a fully functional twrp already with magisk and twrp at the same time I'm really looking forward to the day that happens [emoji817]
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] alecxs:
after reading your previous posts i suggest to install twrp and zips into both slots
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
I used the copy a/b partions zip for that function and still doesn't work....

([emoji3590]09-09-18[emoji3590])

---------- Post added at 06:50 PM ---------- Previous post was at 06:46 PM ----------

Will this be ready to test today

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Can you send me your boot.img, vbmeta.img, and the output of ls /dev/block/bootdevice/by-name?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Boot untouched newest firmware and Vbmeta_a and Vvmeta_bView attachment Files.zip
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
It looks like there's a problem with Magisk and the Universal Disabler. See if this can disable encryption for you. Format /data using the "yes" method, reboot from twrp right back into twrp, mount /vendor /data /system, and flash it. Don't flash magisk. Just boot the OS, and reboot back into twrp to check if you're encrypted.

When you check the boxes to mount /data, /system & /vendor, look at the bottom and make sure that "mount system partition read only" is not checked. That's happened to people way more than you'd think.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Just tested device is still encrypted checked all boxes properly and system wasn't read only
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Just to double check... You formatted using the "yes" option, rebooted from twrp directly back into twrp, then mounted stuff and flashed it? I have to ask because it's important for troubleshooting. I'm not trying to be redundant.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Yeah I did I formated data ran the twwrp installer rebooted back into recovery checked that data system and vendor were check unclicked them and clicked them back (just to make sure) flashed zip and rebooted without magisk after rom booted rebooted to recovery twrrp not opening and data still encrypted, did you change that flag in the boot img to false and update the csv number that was mismatched in twrp

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
I haven't changed those numbers or the flags yet. I'm going to though. I'm in the process of rebuilding twrp, mostly from scratch with the newest Pie boot.img as a base. I'm going to flash your vendor and oem images to my G6 Play, then pull their libs and bin files. I think that twrp's are outdated or at least a mismatch for your device. I'm essentially trying to alter it, so that twrp brings up the partitions the exact same way as the stock recovery would. I think this will solve most, if not all the problems. Might still need a modified disabler though, or an older version of magisk. We'll get there. Absolute worst case, I can buy the phone in about a week.

It's also possible that dm-verity is blocking /data access. I did some searching and found it living inside the dtbo.img, so I'm going to disable it. Thanks for the info, it's a huge help.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Bro if you buy the phone we be offical in no time like you got the G6 it isn't a bad phone Tho and it's really cheap I got mines for twenty dollars plus first month of activation and they threw in the case came out like 70 dollars

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] alecxs:
try no-verity-opt-encrypt-6.1.zip it works for samsung
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
[MENTION=7815789]PoochyX[/MENTION]

Testing

1. Flash this modified dtbo.img from fastboot and reboot. fastboot flash dtbo patched_dtbo.img If you don't bootloop, go to the next step. If you do bootloop, then flash the one from stock and continue anyways. (If it works it'll disable dm-verity.) patched_dtbo.img

2. fastboot boot test.img If it works, then format /data using the "yes" method, then flash the installer. Reboot from twrp directly back into twrp by using the menus. (If at any point you see "swipe to allow modifications" do so.)

test.img

test-twrp-installer-channel.zip

3. Format /data using the "yes" option again. And reboot from twrp directly back into twrp using the menus once more.

4. When twrp boots up again, mount everything that you can, /data, /vendor, /system, /cache etc. and flash either my modified disabler, or the 5.21.2019 release. Don't try any other versions. Reboot and see if you're encrypted.

5. If encryption is disabled, reboot into recovery, try making a fresh backup of /data, then try restoring it.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
I'm going to test it out when I get back home and let you know how it went I remember last time you modified dtbo with a hex editor device didn't boot up hopefully it be different this time around
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
I'm pretty sure what happened the last time that I tried, is that I changed the file size, which also restructures the internal layout of the dtbo. This time I used some trickery to avoid it. I found the lines for verity. wait,verify,slotselect Since "verify" is in the middle, and "slotselect" is in the way... I filled tselect with zero bytes to erase it without changing the file size. Leaving wait,verify,slo in every spot. As is this would break everything because that makes no sense to Android. But... Since verify,slo is only 10 characters long, and so is slotselect, I was free to rewrite this again without changing the file size. This got me the result I needed. wait,slotselect without changing the size or internal layout.

Edit: I forgot to mention. The twrp I just put up, has some extra flags added for the data partition. And another flag that I edited, because according to Android Source, it forces encryption... I also fixed up the default.prop in the ramdisk.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] alecxs:
i think you need to replace spaces with 0x20 or if spaces are no option you could just add a harmless flag like nofail nouser noauto or repeat already existing flag
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
You have any idea why the backups don't restore successfully and why it gives error about loading persist saying not enough space on the device...
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
There was no flag definining persist2, and there were missing flags for the data partition in twrp.fstab which are very important. Both recovery.fstab & twrp.fstab also had an additional flag on data that I believe was forcing encryption. flags=fileencryption=ice:aes-256-cts This has been fixed. The combo of those things were probably the cause of the problem.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
If this device had an official twrp there wouldn't be no need for the mod boot IMG you made cause TWRP would of handled it cause it was specifically designed for that device
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
That's what the installer is for. The heart of twrp lives in the ramdisk, and since your device has recovery and the boot.img combined into one file, by necessity it has to inject itself there. The modified image is just so that twrp can actually inject itself into the boot/recovery image. The process would be the same even with an official twrp. In addition to this, most official twrp builds can't decrypt an encrypted data partition, so disabling encryption would probably still be necessary anyways. Deestroy has more info about it on twrp.me.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
So the backups not restoring and boot looping device is not exactly TWRP s fault
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Yes and no. Some things inside of twrp just needed to be edited. The fact that it's a port, isn't the problem though if that makes sense. If it were built from source there'd be less things that need fixing but the end result is essentially the same.

source > build > test > fix > bug free twrp

vs

port > build > test > fix > bug free twrp

The only major difference is that the official build would get more regular updates, and be synced with the latest commits automagically. With a port you just get it working, and leave it alone until an OTA breaks it.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Bro once you get this phone you can make the magic happen all the way threw like you did with the G6

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Update patched dtbo didn't work had black screen so couldn't boot into twrrp, so I held power button and rebooted back into bootloader mode and fastboot dtbo that boots back into twrp (stock dtbo would of also had black screen) fastboot into twrp formated data ran new installer and rebooted into twrp then touch screen became non responsive so held power button rebooted into bootloader mode and fast booted twrrp once in screen was active flashed decrypted you recomended not newest one cuss you said it doesnt decrypt properly and rebooted phone boot looped so I reflashed firmware with just the mod boot and phone still boot (test phone made phone boot loop period) so now reflashing orginal firmware package

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
My SD card just bricked on me so it may be slow for me testing stuff until I get payed next week to get another one
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
So the newer twrp worked until after you flashed the disabler; is that correct?

---------- Post added at 08:48 AM ---------- Previous post was at 08:45 AM ----------

No worries. I know how that goes. You can't really test without one especially due to the circumstances. I really need to just buy the phone at this point. I'm pretty sure I could figure it out in a few hours if I had one in my hands.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] BobbyBlunt:
I've seen that there has been new developments. I will test what you have worked up and report back.

Awfully kind for a guy that doesn't own the device

My biggest worry before was the fact I didn't have all of my 2fa stuff backed up. When you 2fa everything and don't use an online solution, a soft brick becomes a nightmare ?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] alecxs:
[MENTION=7718083]Spaceminer[/MENTION] proof me wrong but i believe G7 uses FBE+metadata encryption (ice) so the right flags for TWRP should look like this (not sure about G7 Play)

Please note the mounttodecrypt flag for modem
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
It's device specific. Here's an example of what it took to enable file based decryption for the Pocophone F1. They had to make changes to twrp's BoardConfig.mk before compiling. Most devices are using vold & keymaster. I'm not sure about the G7. Their twrp fstab doesn't have any mention of "mount to decrypt." and neither does the one from their stock boot/recovery.img. What you linked to is for an ASUS device.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
For anyone curious, I believe that I've found the source of the problem. It's the dtbo.img. More specifically it's the verify flag. Motorola has set it up so that if this flag exists, then encryption gets forced no matter what. I discovered this inadvertently while trying to roll back my G6 Play to Oreo. This flag for the G6 Play exists in the boot.img. (Because that's where our dtbo sits.) The point is, even with "encryptable=" set in /vendor/etc/fstab.qcom the device still gets encrypted if the verify flag is found. My guess is some lib in vendor gets triggered to encrypt everything. The disabler successfully changes the vendor flag like it should, but neither Magisk or the disabler are patching the dtbo.img. I don't know if not patching the dtbo is a Magisk or twrp issue at this point, so please don't drop any bug reports in the Magisk forums for the time being.

The short end is, twrp in it's current state only needs one more flag adjusted, and I'll have to figure out how to either build or patch a dtbo.img for you guys. After that I believe everything should work correctly. I can purchase a G7 Play in just a few more days, so hopefully I'll get this sorted out very soon.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
That is fantastic stuff [emoji817]

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] filipedonato:
Amazing!
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Can someone with this device please pull /proc/config.gz and send it to me? I want to make some comparisons against your kernel source. I'm going to try building twrp while I'm waiting to get this phone.

Edit: Got it!
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Bro you got the phone you about to drop twrp on dudes [emoji817]

([emoji3590]09-09-18[emoji3590])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
[MENTION=7718083]Spaceminer[/MENTION]
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] alecxs:
[MENTION=7815789]PoochyX[/MENTION] adb pull /tmp/recovery.log
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Vendor/BinView attachment 4951929
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Viva La Android R.I.P.:
Haha. [MENTION=7718083]Spaceminer[/MENTION] you got your G7 Play. Yessir.... Tried sending you a PM. I need your PayPal address so I can send you a little something for your work. Thanks.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
You're either blocked from sending messages, or you need to change your account settings. I tried sending you a pm but it just gives me this instead.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
[MENTION=7815789]PoochyX[/MENTION]

Literally 2min of work got me this on the G6 Play with Orange Fox. You can barely see part of it, but there's a "reboot system" button on the bottom and it does work. All this requires is some UI edits, and maybe some image resizing to fix it. I also nixed the installer, just to make sure it'd boot up. That's why it thinks it's not installed. That kind of work is child's play for me. It'll be very easy to port.

By the way, did you ever pull /vendor/bin/init.mmi.hab.sh?

Also, check out the what's in the update binary for Orange Fox. Remember telling me that sometimes the stock recovery would come back? I think this explains it.