yashsingh1/xdaforums huggingface dataset:
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Try this one. I think I have everything fixed. It bootloops if the stock OS is installed though, and I still can't figure out why. The advanced > fix recovery loop trick in twrp doesn't fix it. This one definitely formats data and mounts all the partitions correctly. I haven't tested backup/restore yet.

By the way, can you link me a GSI that you know will boot up? I tried Phh's Pie GSI and it refuses to start. It doesn't matter if I'm using the stock boot image or a rooted one. Same result. It always loops, even when installed through fastboot with data wipes.

twrp.img
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Andy Yans Lineage 17.1 boots up

Havoc 11.19 boots up

Havoc 3.2 with gapps boots up

Extended UI boots up

Arrow Boots up

Android 9 Dot Os Boots Up
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Thanks bud! After I read your list, I realized that I flashed an arm_a only build like a complete dumbass. Lmao!

Aren't we arm_ab binder64?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Yeah we are lol
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
TWRP - No dtbo

* I've appended the dtbo.img to twrp. It is now self sufficient. You don't need to flash anything before booting this up.

* If you want to use backup & restore or install twrp permanently, you must also install a GSI.

* Do not use this on stock! Motorola has some very nasty security measures in place and you will bootloop no matter what.

* Flashing zips to the stock OS will work. Flashing zips to a GSI will work. Flashing Magisk will not! This is a Magisk issue. If you want to be rooted on stock, patch your boot.img as recovery with magisk manager and flash it from fastboot. It is the only way.

* Disabling verity or forced encryption on stock will break the OS.

How to install twrp...

1. Fastboot boot twrp.img

2. Copy twrp to your external sdcard, or use adb push twrp.img /tmp/twrp.img.

3. Go to Advanced > install recovery ramdisk then navigate to tmp or your external sdcard and select the twrp.img you copied.

4. Use wipe > format > type "yes" to continue then use reboot > recovery from twrp's menus.

5. Once twrp starts up again, wipe data & system, make sure system is mounted, then flash a GSI. Flash the universal disabler afterwards. If you get a failed to unmount error, manually mount all partitions and reflash whatever it errored on.

6. Optional: Flash my modded phh for root. (Install the apk after.) Never use Magisk! It will fail to root, cause a bootloop, or break twrp.

twrp.img

Modded Phh

Side note: My modded phh works on Lineage OS 16 & 17, and should work on any GSI made from Phh's sources. Other GSIs and stock are untested. If anyone can help me fix the overlays for our device, please send me a pm. I have the values for the curves and notch, I just don't know how to compile the overlay as an apk.

How to fix the navbar on a GSI

adb root
adb shell
setprop persist.sys.phh.mainkeys 0
reboot
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
OverlayView attachment treble-overlay-moto-g7play.apk.zip
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
That is awesome! You just save the day. I needed that so badly. Now everything is working perfectly. I can even use the hide option and get symmetrically rounded corners on both sides in landscape. Looks like a retro tv when I run emulators, which really makes me happy.

If anyone wants the Oreo recent apps menu, download the files below. (Spit screen also works.)

1. Copy the permission files to /system/etc/permissions and set permissions to 0644.

2. Copy the launcher3 folder to /system/priv-app, and set permissions on the folder to 0755, & permissions on the app itself to 0644.

3. Delete Trebuchet Quick step launcher from /system/priv-app and reboot.

4. Open "settings > apps > moto app launcher" make sure it has phone and storage permissions. You're done!

* This only works on android 8/9 based GSIs, if anyone can fix that, please let me know.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Is the persist issue in TWRP going to get fixed and now since TWRP function is accomplished and removing encryption on stock as of right now is not possible are we moving on to orangefox next ?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Persist is fixed!

Our security uses FEC, and forced verity. FEC restores missing or corrupted data. Verity is designed to corrupt your userdata and refuse to boot the system if we make changes.

* If we disable verity, FEC will attempt to restore it. If it can't restore it, the bootloader flags the slot as unbootable and it makes you bootloop.

* If we disable FEC, verity will trash userdata.

* If we disable FEC and verity in one shot, the bootloader will refuse to boot the stock OS.

Magisk works on the stock OS because it mirrors your partitions, this bypasses security and neither FEC or verity realize the system has been tampered with. (Bootloader reports green) When we edit vendor or oem, FEC still sees the changes and reverses it. (FEC lives in the kernel by the way.)

If you flash a GSI the bootloader is aware that you're not on stock, so FEC never starts up. Even when using the stock kernel, FEC is just ignored. This behavior is so Motorola can keep the device treble compliant, because all treble devices must be able to boot a GSI. They're also supposed to have a method to disable verity to stay compliant, but they don't... Thankfully the disabler takes care of verity on a GSI.

It might be possible to have full read/write to vendor & oem if we can find a way to make stock look like a GSI. If that can be done, twrp would also work on the stock OS because FEC will get ignored. We'd also be free to disable verity and encryption without bootloops.

OrangeFox is still a possibility. I just haven't had much time to dig into it yet.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Oh so if persist is fixed this is just a cosmetic malfunction in twrp about not enough space on the device for persist
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Are you using the latest twrp that I've posted? Because I've never had that error with it. If you're talking about flashing modded phh, that was a bug in the zip's scripts, not twrp. That script error has also been fixed for awhile now too.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] DB126:
Excellent analysis - thanks for sharing :)
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] BobbyBlunt:
For you guys using a gsi, which one did you end up sticking with? I've ran through a few and I couldn't get them to boot (though I didn't try many, and this was before we could get twrp to stick and yes I did try ones which should be compatible compatible with our device)

I've actually gotten used to the stock rom with magisk, but I wo

uldn't mind doing some tinkering

Also would this do us any good to get magisk working with a gsi?

https://xdaforums.com/android/software/magiskfixes-fixing-magisk-magisk-t3977203

Oh and let me not forget.... Thank you [MENTION=7718083]Spaceminer[/MENTION] for everything you've done
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] αℓ૯×12345:
I tested it and it's working
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] :
Have you had any success since posting this? I haven't had any luck myself, trying lineage 17.1, AOSP V119 or dotOS 3.1.1 (they remain at the boot screen indefinitely) for model XT 1952-2.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] ForForkSake:
Stock rom with magisk is great for me. No issues with company portal which is currently a necessity working from home

That magisk module specifically mentions gsis and magisk.... Surely onto a winner??
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] BobbyBlunt:
Yes this ONE worked first attempt for me. For now I have chosen to remain on stock with magisk and no twrp, but this one did work fine (except for what is listed as not working)
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
I'm making progress with getting twrp to work on stock. I believe it's an encrypted data problem. Twrp is missing libs for keymaster4 so I'm going to try getting those in there. It seems that, the system init forces encryption, and as soon as data gets created, twrp goes into a bootloop.

I was able to narrow it down by installing twrp, then wiping everything but the data partition. Without any system, vendor, or oem partition, twrp still refuses to boot with encrypted data.

So I think we have a solution. Patch system init, so nothing ever gets encrypted. (The vendor fstab isn't enough by itself.) Or enable decryption support for twrp.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] AL2009man:
I followed everything, and now I am getting a I/O Error everytime I try to open any GSI Image, any help here?

Edit: I decided to skip Step 4 and managed to install a GSI. at least it's something...
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
I have a magisk/twrp patched boot img u can use if your using a GSI

Fastboot - w (if your GSI is encrypted) twrp won't open

If already decrypted via decryption zip place twrp img in ADB folder

Fastboot boot twrp.Img

Uhzip twrp folder place it in internal storage restore boot img in twrrp u will be rooted with magisk and have access to twrp still

That zip is located in Moto G7 play how to install android 10 topic discussion at the bottom of the op

([emoji88]Havoc GSI[emoji88])

---------- Post added at 07:24 AM ---------- Previous post was at 07:21 AM ----------

With key master 4 added to twrp we should be able to keep twrp and have are lock screen functional on a GSI.... Have u been able to implement key master 4

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] AL2009man:
can you at least provide a "madisk/twrp patched boot.img" and a direct link, because I cannot find it unless it's this one: https://xdaforums.com/showpost.php?p=82929451&postcount=50

and I'm having a hard time figuring your how to follow your guide, can you (at least) try to make the instructions a bit easier to follow?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Yeah that's the one..... Alright first install android 9 stock rom (twrp won't boot on a android 10 vendor [MENTION=7718083]Spaceminer[/MENTION] will fix the issue when offical android 10 drops for the North America Moto G7 plays) also once u flash a android 10 modem your service won't work on android 9 with the pie modem u would need to reflash the android 10 modem... Then how I do it let it boot to the set up wizard and then reboot to bootloader fastboot - w fastboot flash system GSI name then fastboot boot twrp.img (make sure twrp img is in ADB folder) when twrp boots u format data...un zip my twrp folder and place it internal storage once data is formated then use decryption zip to patch vendor after u restore magisk img patched with twrp... Resize system if using gapps reboot into recovery it will boot with magisk install magisk manager and your rooted after environment setup.... to boot twrp hold volume up button when u reboot to recovery

(to pass environmental setup and for havoc 3.6 to boot u need to remove vendor/bin/init.mimi.hab u should do it in twrp prior to first boot)

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] AL2009man:
Thanks for the detailed yet even harder guide to follow, so, I read it very carefully and organize it as "Guide for Dummies". let me know if this needs revisions, I will be updating it after receiving feedback:

*UPDATE: for the time being, please don't use this guide.

What's needed: TWRP.img (probably Spaceminer's), PoochyX's TWRP.zip, any GSI of your choice, DM-VERITY, FORCED ENCRYPTION, AND DISC QUOTA DISABLER"?), Magisk Manager apk.

Before starting: Download & Install Android 9/10 Stock ROM/Firmware first. right now, TWRP won't boot on Android 10 Vendor. Spaceminer will, (according to PoochyX's words) fix it when Motorola rolls out Android 10 Moto G7 Play to North American G7 Play owners. Otherwise (and if you already are on Stock ROM/Firmware.), move on:

Make sure twrp.img and the rest of the necessary items is inside ADB folder.

1. Turn off your Phone and enter Bootloader [or "adb reboot bootloader"]. Launch ADB command on your Computer/Laptop and type "fastboot -w" (if your GSI is encrypted. but not sure if you can do it anyway.), then "fastboot flash system [GSI of your choice].img" and lastly, "fastboot boot twrp.img".

2. In TWRP, go to Wipe > Format Data. (make sure you Backup your Important Data in advance, you never know...)

3. Once it's Formatted, unzip the "TWRP.zip" folder and move it to Internal Storage > TWRP Folder (I think?).

4. Now go to Restore > select the TWRP.zip file inside and back it up

5. Install decryption.zip (can't figure out WHICH one tho)

5a. Resize system if you're using Gapps. If you don't know how to Resize system (Me too) I suggest sticking with smaller size Gapps Variant (or alternatives) or came included with the GSI.

5b. if you're going with Havoc OS 3.6, you must remove init.mimi.hab via TWRP. on TWRP, Mount and Mount [Vendor], then go to File Explorer and search for: Vendor/bin/init.mimi.hab

6. now Install TWRP to your Phone Recovery (redirect to Spaceminer's guide) and then reboot to verify. (or skip it, PoochyX wasn't clear if you need TWRP installed or not.)

7. and Boot into System, verify if Magisk is now in your phone instead of SuperUser. If Magisk is successfully installed, Download and Install Magisk Manager apk.

Unless I'm missing something, I think I am done. I will start testing this out with this organized guide this weekend (as of this writting) or wait until Android 10 officially rolls out to North American Phones and see if this actually works out. Let me know if this guide actually helps out.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
You was correct with decryption zip u named that is the one u should use, and for Resize system go to partion options for system where format data is at

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] AL2009man:
Thanks.

I tried following your original guide, but I couldn't get "reboot into recovery" working as it just boots to Stock Recovery mode. (I did made sure I reinstalled Android 9 Stock ROM first)

I probably go back once Android 10 Stock ROM comes out to NA Moto G7 Play devices.

edit: and now I am back to I/O Error inside TWRP. But I do know that fastboot installing gsi works just fine. for now, I need to go to bed and try it again later, this time using Havoc GSI instead of ASOP GSI just to see if Magisk works better there.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Magisk defintely works Better with havoc and the worst with GSI lineage

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] AL2009man:
I managed to get it working, minus Havoc GSI, I'm stuck on boot loop with and without your method. also, I cannot find vendor/bin/init.mimi.hab inside TWRP's File Manager. Not sure what I was doing wrong.

so, I went back to AOSP GSI for the time being.

edit: figured out how to remove init.mimi.hab, but Havoc OS is broken for me. I will stick with AOSP GSI for the time being.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
That's fantastic u got twrrp and magisk working it's unforunate u couldn't get havoc os to function nevertheless ur still enjoying android 10 with magisk and twrp...

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] AL2009man:
quick correction: only Spaceminer's TWRP, not Magisk. for the time being, I'm going to stick with what I got until then.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Well u got root on asop with phh so for the most part your very functional

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
I know what was wrong I solved it magisk and twrp for everybody on the G7 play thanks to [MENTION=7718083]Spaceminer[/MENTION]

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] AL2009man:
gotcha, I guess I gonna wait until Spaceminer managed (or merge your patch) to fix the Magisk problem.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
https://xdaforums.com/g7-play/development/magisk-twrp-gsi-wont-stock-t4128789

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
This is what I was referring to [MENTION=7718083]Spaceminer[/MENTION] in regards to persist and this is with the twrp that has the integrated dtbo

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Announcement: TWRP is now working on Android 10

A new image and instructions will be provided very soon!
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] 00p513:
So. My TWRP seemed to be building ok, but I had to shut down my laptop cause controlling parents at 68%. I'll rebuild tomorrow and test. If it works, we have a new twrp with decryption
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Controlling parents [emoji24][emoji24][emoji24]

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
Looks at watch... Yeah that was 17yrs ago, now I get to be the controlling parent. It's way more fun when the tables have turned.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] 00p513:
Yep yep. Anyway building now. I hope this all works

---------- Post added at 11:48 AM ---------- Previous post was at 11:47 AM ----------

@spaceminer can you check your dms?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
dms? Direct messages??? I'm not sure what you mean.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] 00p513:
Yeah here on Xda. On the app it's in the side menu, on the website I think you click your avatar top right
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
How's the twrp looking?

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] 00p513:
Uhh kernel loads. Doesn't load the twrp splash
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Damn

([emoji88]Havoc GSI[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Spaceminer:
It's a driver issue. You have to force load them using insmod. If you send me the recovery you built or just the kernel, then I can probably make it work. I've had to fix this same problem several times in the past. Did you build a dtbo too?

I get held up because Windows 10 couldn't display my WiFi networks. I spent all morning fighting it. Just an FYI... don't use virtualbox 6.x.x at all. It screwed up my system files very badly. I had to do a restore this morning. I'm getting ready to install Ubuntu now. I'm just going to run dual boot instead. It's way faster anyhow.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] 00p513:
Uhh I just accidentally deleted a lot of what I had done... I'm an idiot. I'll do all my changes again and build
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] willagave:
Maybe i dont understand?

Ive read through most of this and maybe im misunderstanding but some people are having trouble with installing Twrp recvoery. anyways i just personally just flashed the moto g7 powers orange fox recovery.img and got it to boot fine with full functionality as i can tell. im gonna flash some stuff and see.

Just thought it was weird becaue when i used the dirty port thats pervided on page onre it just boots me back into the system.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] yashor:
Hi, When you finish installing TWRP & GSI, please provide us clear step by step of your success for installing from Android 10. thank you
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] jpl673:
I apologise I am new. Can this twrp be installed with flashify?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Viva La Android R.I.P.:
Have you guys seen the news? Official LineageOS 17.1 and official LineageOS custom recovery are finally available for the CHANNEL. Sorry if this is old news. I just saw it myself. These are the official weeklies for the CHANNEL. (Technically, the builds are called Nightlies, but being released as Weekly builds.)

https://download.lineageos.org/channel#!
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Yeah but no stable twrrp support the los vendor doesn't support decryption

([emoji88]Omni Rom[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Viva La Android R.I.P.:
Ah, that's good to know. I've not tried the recovery or ROMs yet.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Viva La Android R.I.P.:
Greetings [MENTION=7815789]PoochyX[/MENTION]. With the latest 9/27 build of LineageOS 17.1 for CHANNEL, do you know if the corresponding Lineage recovery supports decryption? Also are you familiar with this TWRP v3.4.0-0 build by [MENTION=7887589]SyberHexen[/MENTION], and whether it supports decryption? I know you stay up on the latest CHANNEL development, so I wanted to get your input if possible. Thanks friend.

If I'm understanding correctly, the Lineage 17.1 ROM will install and run on the CHANNEL, but TWRP decryption isn't supported. Is this accurate?
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] PoochyX:
Decryption is not supported with the syber vendor applying the decryption zip will break the rom... The twrrp is stable in regards to the fact it only will stick with decryption and only on a 64 bit boot... (Memory management kind of sucks with 2 gigs what was we really expecting) on the latest lineage 64 bit bulid memory optimizations were added but I haven't tried so I can't speak on it in terms of functionality also last time I was on it there were apn issues regarding mobile data connectivity syber has claimed to fix those but I haven't tried any newer bulids to verify that, my moto g7 play had fell and the screen shattered so I ended up getting that moto G8 fast boost promotion unlocked it and flashed omni custom rom with twrp, So I just use the G7 play now for debugging purposes....

As of right now the lineage recovery and twrrp just decryption just the vendor of syber lineage doesn't thiers another 64 bit custom rom that it's vendor supports decryption but it's super buggy so it's not worth much having a twrrp that sticks on a rom that's not properly functionable mainly the apn settings were showing in the rom for boost users...

([emoji88]Omni Rom[emoji88])
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] xtermmin:
I flashed the latest Lineage onto my T-Mobile Revvlry (re-branded G7 Play but with 3GB RAM) by following the instructions on the Lineage device page. Looks to function pretty well (talk/text/data works), but there are still some bugs that need squashing (Miracast rendering is slow/blocky on both the phone and monitor, sometimes when coming back from sleep mode the color rendering is messed up and can only be resolved via reboot, etc). Good first groups of builds though.
[Moto G7 Play ROMs, Kernels, Recoveries, & Other De] Viva La Android R.I.P.:
Man, you're the best. Thanks so much for the detailed information. I needed to know that before trying things out. Thanks much [MENTION=7815789]PoochyX[/MENTION].

---------- Post added at 02:03 AM ---------- Previous post was at 02:01 AM ----------

Thanks [MENTION=3867776]xtermmin[/MENTION]. Good into to know.

---------- Post added at 02:09 AM ---------- Previous post was at 02:03 AM ----------

[/COLOR [MENTION=7815789]PoochyX[/MENTION], has anybody tried pulling the qcom.fstab from /vendor/etc/ using adb pull, changing the force encryption flag to 0, then pushing it back? We had to do this on the Moto E5 Play (8.0.0 Oreo) in order to decrypt the device. Once the fstab is pushed back onto the device, the /userdata partition can be formatted in custom recovery and it'll decrypt. But, the E5 Play isn't A/B partitioned so I realize this may not even be possible on the G7 Play.