yashsingh1/xdaforums huggingface dataset:
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Man so close but still not quite. Installed magisk manager but no root...

When I reboot to Twrp it shows the two front screen but then starts having a seizure flashing n ****....... Works to fastboot into the IMG again...

So close.. ummmm
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
Try dumping the boot.img after you've done everything to install twrp, then manually patch it with magisk, and flash it with fastboot.
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Aw damnn it... wish I saw this.

I've managed to brick it by flashing the magisk patched boot image in Twrp ... but it wasn't patched with recovery mode... hmmmmm

---------- Post added at 07:09 AM ---------- Previous post was at 07:07 AM ----------

This will work I'm sure ... right... is this device unbrickable :confused: :( lol

edit: just found your unbrick post :)
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
I'm going to try messing with it, I think you're on to something. Just to be clear was this the process you used?

stock boot > fastboot boot twrp > wipe data > install twrp ramdisk > apply boot loop fix > flash twrp installer zip > flash Magisk

And did you manage to get unbricked?
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Yes that was the process - Not sure if it helps but I had to reboot to twrp after formatting... to do this succesfully I went back to bootloader and then fastboot boot twrp.img again

stock boot > fastboot boot twrp > wipe data > bootloader > fastboot boot twrp > twrp ramdisk > bootloop fix > twrp installer > flash magisk (zip) No Verity zip >

this did boot but it didn't have magisk ... so I'll try creating a boot image as you suggested (once all thd twrp stuff done)

I'm going to do it again now - your unbrick guide was perfect along with the Blank-Flash.rar someone else posted for my device version. Life saver

now I know unbrick is possible and so easy

---------- Post added at 02:11 PM ---------- Previous post was at 01:43 PM ----------

Woo hooo... i've succesfully rebooted from TWRP back to TWRP... first time ever ... now lets try and boot stock

---------- Post added at 02:13 PM ---------- Previous post was at 02:11 PM ----------

hmmm keeps going back to bootloader ... (I went for magisk zip but have also copied over my TWRP boot image prior to installing magisk zip.....

from bootloader I chose "start" and it's booted to setup screen... woo hoo - hoping to see magisk installed
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
One of the problems running on stock is, after installing twrp, trying to reboot into twrp after the setup process, causes a bootloop. Did your method get around this? If so that'd be huge news.
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
[MENTION=7548783]CFKod[/MENTION]

If you want to give this a shot it might work. I added test fix for block devices that just got submitted by osm0sis like 8hrs ago. This hasn't even been reviewed yet.
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
I tried to reboot to twrp from stock...it just flashes the twrp logo... but does allow me to get back to stock so no bootloop only to get back to twrp.

So I tried flashing the boot image I obtained via ADB after installing twrp ramdisk which I've patched with magisk....

I installed to a and b... It's installed

but now recovery boots magisk too.. I'm gonna try a few button combinations...

That zip you have provided installs magisk does it?

I'll give it a shot.

Will play around with it this evening and update the thread
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
If it works right the zip will install magisk.
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Sorry been so busy. No luck dude .

Although new canary is now out. The issue is twrp...it doesnt stay and magisk only works as recovery hmmm
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
By patching the boot IMG once all the twrp bits complete and then flashing...

Magisk still only available when selecting recovery

However...

Holding UP after selecting recovery from bootloader attempts to boot TWRP but it just gets to twrp logo loop... But reboot back to recovery without holding up then loads magisk enabled stock
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
We need to patch system_root/init, which magisk and the disabler won't touch. I'm working on a way to make that happen. It sounds like you've got both installed correctly. I believe the issue at this point is just twrp. It can't decrypt data, and system_root/init forces encryption. Hence the need for a patch. The other alternative is enabling decryption support in twrp. I have some good ideas for either option.

I noticed that twrp is missing keymaster4 libs, so I'm going to try adding them and doing some tests later. My other idea is...

Copy init from /system_root into the ramdisk of the boot.img, repack it. Then patch it with magisk manually, but NOT as recovery. Unpack the patched boot.img and copy the .backup folder and the patched init to system_root, then set proper permissions. Reboot into fastboot, format data, flash the disabler. If it works, it'll trick magisk into using the /system_root ramdisk like it would for recovery mode. But... Since it's actually in the system, this would leave the recovery ramdisk open to install twrp. And it would hopefully, also remove verity and forced encryption from the system.

If something like this will work. It'd put us in an ideal situation. Boot normally and you get a rooted system, boot into recovery and you get twrp.
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Interesting... May also give it a go... So close

I'm decrypted anyway ... Just run a backup and I'll have a look around
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
Sounds good. I already made a test image and pulled the files hours ago. I was just too busy with other projects so I haven't tested it yet. These patched files are from the stock system_root if you want to try it.

.backup -- 0000

Files inside .backup

.magisk -- 0000

init -- 0750

verity_key -- 0644

root_ramdisk/

init -- 0750
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Okay need my phone for next hour for work.

So the files are pulled from stock boot... I need to repack into a stock magisk patched (not recovery mode) boot?

Sorry I'm on the app.. Once I've posted ill see your previous instructions ?

---------- Post added at 06:59 PM ---------- Previous post was at 06:54 PM ----------

I got ya... You did all the hard work.. Ill do it shortly
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
About to reboot but forgot to say...

Patching the TWRP image as discussed before has leff my magisk As attched...

Hopefully your theory works the other way around
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Interestingly...patching the modified boot image for recovery mode and flashing in fastboot...

I did indeed select reboot recovery... But no button combo...

This is now magisk ...
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
You need to send that log to topjonwu. Magisk is trying to patch using x86 binaries, when it should be using arm. It looks like the disabler is working correctly though.

I modified this zip so that it can only use arm binaries. Try flashing this. It's based off the same canary you're using now.
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Ok dude . I'll send over shortly. Didn't even notice myself. Nice work.

Will try your zip now.
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Sorry thought i posted.

Couldn't get anywhere with it.. The only way twrp stays installed is deleting stock...

However, i have a redmi note 9S/pro arriving tomorrow or Monday so can literally use this as a test phone... So feel free to hit me with it..
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
No worries. I figured out some tricks and built some tools that should be useful. We can finally make permanent edits to vendor, oem, or system with this. We can even edit inactive slots and GSIs with our phone. There's a number of edits that I've been meaning to test since discovering this, but I've had a lot on my plate lately so I've been slacking a bit.

Here's the thread I made. Link
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
nice work man - much appreciated! something to keep us occupied too... during this never ending lockdown
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
I've now got Twrp and magisk happily working.. On the version of Los 17.1 posted.

Bootloader.. Select recovery... Hold volume up to boot twrp... Don't to boot to magisk working in los.

The latest magisk canary.. Give magisk super user and it allowed me to direct install magisk... Make sure recovery selected...

Happily reboot to twrp :)
[Moto G7 Play Guides, News, & Discussion] ForForkSake:
Seem to have lost it again after installing modules but still have su with your modified phh su...and twrp is fine
[Moto G7 Play Guides, News, & Discussion] GlitchGamingYT:
Help my recovery still stuck in bootloop

When i reboot to recovery it wont go past startup team win image screen

And when i reboot my phone it wont start up.

I've had to reflash stock firmware well over 20 times in the past couple days. Im having a meltdown. If anyone can help me root my phone with or without a custom recovery such as twrp it would be helpful. Please bote the moto g7 play doesn't come with a recovery partition so the fastboot flash recovery twrp.im or whatever image WILL NOT WORK. the recovery is located inside the boot
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
Just patch your boot image with Magisk using the recovery option, then flash it with fastboot. Magisk can't be installed from twrp for most newer devices.
[Moto G7 Play Guides, News, & Discussion] GlitchGamingYT:
I did try this but it work
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
Which version of Magisk? Both 20.3 & 20.4 should work. I know canary builds have problems though. Did you also reboot to recovery after flashing the patched image? Because you need to do that every time or you won't have Magisk.
[Moto G7 Play Guides, News, & Discussion] RallyFlowBro:
Followed the steps pretty sure I bricked my phone will not boot now.
[Moto G7 Play Guides, News, & Discussion] devine3035:
:laugh: Jus so all is aware, Moto has improved their LMSA tool all the way to point it will fix most handsets hard brick in the same manner as qboot does. But better since it does every phone I believe..Lenovo too if I'm not mistaken....

---------- Post added 7th June 2020 at 12:22 AM ---------- Previous post was 6th June 2020 at 11:25 PM ----------

drive.google.com/file/d/1G-vMFjZZGhNQUShr0bSxV9rHefQgpiI-/view?usp=drivesdk
[Moto G7 Play Guides, News, & Discussion] macromicr0:
Instructions please!?

Hey I was browsing this thread for some solid instruction on how to install TWRP & flash a custom ROM one the MOTO G7 PLAY (XT1952-2),

It seems there has not been an update to the original install instructions & from what I read there has been some detours,

Can someone please update this thread with an A-Z set of instructions for a newbie like myself?

My end goal is to flash any version of LineageOS with MicroG (no gapps),

I have seen this done on this model here: https:// www.youtube.com/watch?v=UXLo15l2i4c

If anyone could better advise me on the process it would be greatly appreciated! :D
[Moto G7 Play Guides, News, & Discussion] Mohammed..:
does this still work?

after fastboot boot twrp4.img it just stays on the twrp logo and the ui does not show up

is there an official twrp for the moto g7 play coming
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
It works. You gotta jump through some hoops though and you must flash a GSI afterward or it's bootloop city. From fastboot...

fastboot erase userdata
fastboot erase cache
fastboot erase DDR
fastboot boot twrp4.img

Then from twrp format user data using the type "yes" method. Then reboot directly into fastboot. And rerun...

fastboot boot twrp4.img

Upon booting up twrp once more, select install > recovery ramdisk > select the twrp4.img from your internal sd or external, (you can copy it from your pc to internal storage at this point) then...

Use twrp to erase system, and install a GSI. Mount /vendor /data and /system. Then flash the universal disabler. After that, flash my modded phh root if you need it. Magisk won't work for this.

Reboot and everything should be working. Reboot recovery should bring you into twrp, and rebooting normally should boot the system. If you want Viper4android, use the non root flashable zip from Zackptg5 and you're good to go. Just install it from twrp. Make sure to mount /system, /vendor, and /data before flashing Viper. Hope this helps.
[Moto G7 Play Guides, News, & Discussion] YaBoiDIOBrando:
What's the "type "yes"" method? I just got a Moto G7 Play to root, and I have the bootloader unlocked. I don't want to screw anything up, so I want to be as careful as possible. Any help would be greatly appreciated. Thank you so much.
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
You can find that under the wipe > "format" option. I wish I could be a little more specific, but I don't have a PC right now so I can't boot it up and confirm that. I'm going off of memory here. Poke around in the wipe options and I'm sure you'll find it. Send me some screenshots if needed. I'm always happy to help.
[Moto G7 Play Guides, News, & Discussion] PoochyX:
Anybody got this twrp working with the android 10 retail stock vendor... Even with GSI decrypted the twrp doesn't stick it apparently only sticks on the android 9 stock retail vendor (of course with the matching boot img of the vendor also)

([emoji88]Caos GSI[emoji88])
[Moto G7 Play Guides, News, & Discussion] Viva La Android R.I.P.:
I've had no luck with TWRP sticking on the Retail Android 10 firmware. I was actually just getting ready to ask this same question.
[Moto G7 Play Guides, News, & Discussion] gogaki:
Sorry but I don't understand. I have followed the instructions above but I simply end up in a TWRP that won't load. I see the splash screen of twrp when trying to enter recovery mode, then it goes black and kind of restarts again, with splash screen.... looping this in eternity. I cannot understand how difficult it should be to root this phone... really...
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
It won't stick on any stock firmware. That's because Motorola implemented a security feature called FEC. It works similar to error correcting ram found in servers. It basically rewrites or attempts to rewrite incorrect data, in this case twrp. That's why you must flash a GSI. FEC is disabled by the bootloader whenever a non stock OS is detected. Zackptg5 and I looked into this heavily. You'd need a custom kernel and a way to flag the stock firmware as a GSI to disable it on stock. Magisk works because it uses mirrors to mount partitions, so as far as FEC is concerned, everything looks like it's in order. That's why we use Magisk on stock, and Phh root on GSIs.
[Moto G7 Play Guides, News, & Discussion] Viva La Android R.I.P.:
Makes sense now that you've outlined it for me. Thanks. I'm not very familiar with the FEC security protocol. Is FEC part of the Android open source code, or is it a feature exclusive to Motorola...a type of proprietary code?
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
Not proprietary, just not widely used. It was introduced in Android 7.0. I didn't know about it either until I got frustrated enough to start digging through our kernel. (Lots of strings/grep until I struck gold.) FEC is probably the worst security feature I've seen yet. Maybe worse than Knox, but I haven't seen the recent iterations that Sammy devices are using. If it weren't for unlocked bootloaders then we'd probably never see root on any device using FEC. There's also some posts about it by me on page 90 of the universal disabler threads. Here's a nice (and horrifying) write-up about it.

https://android-developers.googleblog.com/2016/07/strictly-enforced-verified-boot-with.html
[Moto G7 Play Guides, News, & Discussion] Viva La Android R.I.P.:
Thanks for the info and the link. I need to research FEC, as I keep seeing references about it on some of these newer Moto devices. I hope you and yours are well. Always good to hear from you.
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
It's in the Moto E6, E7, and G8 series so I'm going to have to fight it again at some point. I'm honestly doing better than ever! I have a video conference coming up with Qualcomm to look at potential jobs for developing AI software. I'm on the fast track to success. I might land a very high paying job, I might not, but this is definitely how your get a foot in the door. It's good to hear from you too! It's always been a pleasure.
[Moto G7 Play Guides, News, & Discussion] Viva La Android R.I.P.:
Wow. I'm truly impressed but not the least bit surprised...Qualcomm...AI software. You are a gifted and talented developer so I have no doubt you'll go far. I wish you all the luck in the world on your endeavors. Who knows?...you may have a hand in Qualcomm's future Snapdragon chipsets. I would like nothing more than to see just that. The Snapdragon 975 Spaceminer Edition. :good:
[Moto G7 Play Guides, News, & Discussion] Viva La Android R.I.P.:
Yeah [MENTION=7718083]Spaceminer[/MENTION], I just done some in-depth research on the enhanced dm-verity protocol, Forward Error Correction (FEC). Man, I see exactly what you're saying: it's a nightmare for customizations like TWRP. Like dm-verity wasn't bad enough. Interleaving and the Reed-Solomon standard?? Geeze. Android 10's mandatory system-as-root standard seems to complicate matters even worse. Android seems to be headed in a direction where rooting isn't even going to be worth the complexities involved. I guess the pre-Nougat days got me spoiled. I've gotta make the effort and learn all of these newer security protocols. It feels overwhelming.
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
The worst part is, the bigger your system partition, the larger the size of data it can "correct". Currently our system partition is large enough to cover the oem, and vendor partitions. I'm going to nip this right in the ass, just wait. I don't know how, I don't know when, but it's going to happen. Impossible is not in my vocabulary.
[Moto G7 Play Guides, News, & Discussion] Viva La Android R.I.P.:
Haha. I know when you get into the "nipping in the ass" mindset, great things happen. I'm curious on how FEC can be disabled. Since dm-verity, AVB, & force-encryption can typically be disabled by modifying some kernel flags (e.g., fstab patching), is there a flag to disable FEC? Or does the entire kernel need to be recompiled absent FEC? Or is FEC even controlled on the kernel level?
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
I think it can be disabled by hex patching the kernel. I have yet to make it happen, but I'm fairly certain that it can be done. The easiest way to know, would be to build a stock kernel with and without it enabled, and try to patch the kernel with it, to be like the the one without it. The big issue I encountered when trying was that I wasn't sure what the end result should look like, and it had a tendency to corrupt the boot.img. For instance, the older methods relied on removing "verify" from the partition lines in the dtb, or dtbo. That was easy because it was human readable. This however is only partially readable. So we need to get a comparison to know the exact values to change. I also think the rest of it, any null bytes need to be filled with zero or some kind of space delimiter to retain the boot.img size. Essentially we need the header and footer to stay the same length from each other. I hope that makes sense. It's much easier for me to have the idea in my head, than it is to express it.
[Moto G7 Play Guides, News, & Discussion] PoochyX:
I was able to get the android 10 vendor to stick to your twrp by using the 3.4.0 0 twrp made to flash the 64 bit payload format custom G7 play roms (which I don't use tho ) by decrypting vendor with it and removing the init mimi hab sh file... When you use the old twrp to decrypt the android 10 vendor with decrypt zip it doesn't do it properly like it would say it's decrypted in security settings but the twrp would still flicker booting it from device...

([emoji88]Chaos GSI[emoji88])

View attachment 5088833
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
Was this on the stock OS or with a GSI? I'm asking because the bootloader disables FEC on a GSI. So if you found a way around it on stock firmware, that's an epic achievement.

Another thing if you have the time or the patience... Can you install 64bit twrp on stock without formatting data, or bootlooping when data is already encrypted? I'm on stock Android 10 right now and I need to fix my phone without a PC. (It's buggy as hell.) If I could dd twrp and boot into it without loops, then I could achieve this task. Without a PC though, I don't want to try and cross my fingers.
[Moto G7 Play Guides, News, & Discussion] PoochyX:
It was defintely on GSI..... The 64 bit twrp doesn't stick with stock pie or stock Q boot img it's just fastboots it only sticks with the 64 bit img and decrypting the vendor it came with...

([emoji88]Chaos GSI[emoji88])
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
I can install a GSI through termux, but I can't change slots. Would you have any ideas how to get around that?
[Moto G7 Play Guides, News, & Discussion] PoochyX:
Na only thing I could think of is using another device with root privileges as a fastboot terminal and run fastboot commands with termux

([emoji88]Chaos GSI[emoji88])
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
Yeah that was the same solution I had stumbled across. I can't exactly erase my brother's phone to unlock it though. So I've been in limbo. I can't dd a gsi to the slot I'm running either. It's the chicken/egg problem.
[Moto G7 Play Guides, News, & Discussion] PoochyX:
Damn bro that's crazy when you get back tho we still need that orange fox #OneDay

([emoji88]Chaos GSI[emoji88])
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
I can still work on that if you want. I just need to use AIK and I can't test anything.
[Moto G7 Play Guides, News, & Discussion] PoochyX:
Yeah that be [emoji91]

([emoji88]Chaos GSI[emoji88])
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
You got it boss! I'll start tonight.
[Moto G7 Play Guides, News, & Discussion] PoochyX:
[emoji817]

([emoji88]Chaos GSI[emoji88])
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
You know of a good donor to pull from? I could use 64bit twrp and the G7 Power or River if you're okay with that. Mix and match some parts and get the engine running. Who's got Orange available?
[Moto G7 Play Guides, News, & Discussion] PoochyX:
Nope the adoption agency is kind of empty

([emoji88]Chaos GSI[emoji88])
[Moto G7 Play Guides, News, & Discussion] Spaceminer:
The orphanarium is apparently open for business! I found a donor from the G7 Power, so we're going 64bit. I'll send you a pm when I have something to test. Just an FYI, I have official business to conduct on the 1st and 2nd, of the coming month. So it might be a little slow this week. I have nothing better to do tonight or tomorrow though.
[Moto G7 Play Guides, News, & Discussion] Zaxx32:
Qwick noobish question...is is possible to root River running 10 if I don't istall/use Twrp? Also, as far as rooting (with twrp) is it the same for G7 Play an G7 River?

Does is look like there's gonna be a Twrp for 10 released that works with rooting the G7?

I'm dyin' to root my G7 on QPUS30-52-16-2-7, what r my options (I'll even do without Twrp if need be.) Tia for your time!
[Moto G7 Play Guides, News, & Discussion] 00p513:
TWRP for Moto G7 here: https://xdaforums.com/moto-g7/development/twrp-moto-g7-river-t3921365
[Moto G7 Play Guides, News, & Discussion] PoochyX:
Installing twrrp is pretty straightforward

([emoji880]Omni Rom[emoji880])