• We are moving to xdaforums.com.

    Until then, this forum is in read-only mode.
    You will be automatically redirected once the migration is complete.

[Recovery][UNOFFICIAL] TWRP Dirty Port For G7 Play

Search This thread

jasonmerc

Senior Member
Dec 14, 2012
1,850
937
www.ixquick.com
Moto G8
TWRP DIRTY PORT FOR G7 PLAY​

My friend was looking to get a G7 Play, so I wanted to whip something up for him really quick. I managed to make a dirty port of TWRP for the G7 Play, taken from the G7 TWRP image since they're the same SDM632 chipset. Until you guys get a real, proper build of TWRP done with the proper source code, consider this a stop gap to at least be able to flash things! It's not perfect obviously but hopefully it's good enough for now!

AS ALWAYS, I DO NOT TAKE RESPONSIBILITY IF FLASHING THIS BRICKS YOUR PHONE. WHAT YOU CHOOSE TO DO TO YOUR PHONE IS ON YOU!!!

WHAT WORKS:

WHAT DOESNT WORK:
  • Because this is a dirty port, the recovery will think this is a G7, when as we all know this is in fact a G7 Play. There is nothing I can really do about this, this is the nature of dirty ports
  • Not sure, don't have the phone to test for myself

DOWNLOAD:
  • DOWNLOAD LINK HERE
  • I cannot provide any source code since this was a dirty port, so no actual source was used. The only things I used to make this were a G7 TWRP image, a G7 Play boot image, and carliv's image kitchen

HOW TO USE:
  • Reboot to fastboot
  • Flash the dtbo with fastboot flash dtbo dtbo.img
  • After that boot from the recovery with fastboot boot recoveryname.img

THANKS TO:
  • @Alberto97 for the G7 TWRP image I dirty ported from
  • The G7 Play Telegram group for testing out the image I made, since I don't have a G7 Play to test this on myself. Specifically @noslen7 for testing the image and figuring out how to get it to run (need to flash the dtbo first) and for sending me the image I used above to show it's working and bootable
  • Carliv for that Carliv Image Kitchen he made, that tool rocks!
 
Last edited:
  • Like
Reactions: Baron Bronson

scritch007

Senior Member
Jan 5, 2011
699
4,909
Reims
I can't test it anymore but if it's uses the same things as the one I built which was inspired by Alberto, do not try to install the TWRP unless you have already flashed the second bank.

fastboot boot recovery.img indeed won't harm so you can try that.

Any idea what works more then the one I built?
 

jwreidmoto

Senior Member
May 9, 2019
85
10
Great work!

First of all thanks for your hard work. I was really happy to see your post. I have followed the instructions exactly and I got "Failed (too many links)" when it attempted to boot my phone into recovery.
I am using XT1952-4_CHANNEL_RETCA_9.0_PPY29.105-5
Any ideas why it might have failed?
Thanks
 

daftshanks

Member
Jul 11, 2019
6
16
First of all thanks for your hard work. I was really happy to see your post. I have followed the instructions exactly and I got "Failed (too many links)" when it attempted to boot my phone into recovery.
I am using XT1952-4_CHANNEL_RETCA_9.0_PPY29.105-5
Any ideas why it might have failed?
Thanks
That's the same one I'm trying to use, tried the dtbo from the same firmware got the same results. Possible EU/Canada firmware as the screenshot of the phone that was shared is in celcius :(
 

noslen7

New member
Jan 18, 2019
1
0
This is how i boot this recovery successfully

That's the same one I'm trying to use, tried the dtbo from the same firmware got the same results. Possible EU/Canada firmware as the screenshot of the phone that was shared is in celcius :(

step 1 fastboot flash dtbo dtbo.img
s000.tinyupload. com/download.php?file_id=26286860633744490329&t=2628686063374449032989765

step 2
fastboot boot "recovery above"

s000.tinyupload. com/download.php?file_id=24332259722784445351&t=2433225972278444535138860
 

daftshanks

Member
Jul 11, 2019
6
16
step 1 fastboot flash dtbo dtbo.img
s000.tinyupload. com/download.php?file_id=26286860633744490329&t=2628686063374449032989765

step 2
fastboot boot "recovery above"

s000.tinyupload. com/download.php?file_id=24332259722784445351&t=2433225972278444535138860
I appreciate your reply on this. However the dtbo filebyou provided is about 3/5ths of the dtbo from my stock firmware, normally they would be at least close to the same file size. Can I ask you what firmware you are on? And were you able to permanently install TWRP? Possible root?
 

jwreidmoto

Senior Member
May 9, 2019
85
10
Downloaded dbto.img got same result

I downloaded the above dbto.img and flashed it instead of my own stock dbto.img and got the same result when I tried to boot from recovery - Failed ( too many links). I think the recovery IMG is not working for our Canadian ROM edition.
 

Rickjfer

Member
Jul 16, 2013
7
1
Which dtbo.img to use? In the download area you only have the image of recovery


HOW TO USE:
  • Reboot to fastboot
  • Flash the dtbo with fastboot flash dtbo dtbo.img
  • After that boot from the recovery with fastboot boot recoveryname.img
 

jwreidmoto

Senior Member
May 9, 2019
85
10
dbto.img

That was in response to another query. I used my own dbto.img from my stock ROM. That part flashes fine it's the recovery.img that comes back with " failed( too many links) I have a Canadian phone.
 

Yster13

New member
Jan 5, 2019
1
0
thank you

it worked for me fine it did give me some problems when i tried booting direct so i flashed to boot then went to recovery mode thru bootloader menu and it worked once in twrp i installed the original boot.img and im good.
 

ninjakira

Senior Member
Nov 6, 2016
583
260
32
batavia, ohio
Yo I'm coming from the g6 play forum with a quick question. Does this by chance work with the same current root method for the g6 play which is booting in twrp and formatting data to decrypt it then flashing twrp and flashing through twrp the encryption disabler zip then flashing magisk. If someone is able to confirm that I can possibly try to make a decent guide for you guys. We don't have a offical twrp that decrypts on its own and the twrp we have ain't a dirty port so I know there may be some differences when it comes to twrp related issues but it's better than nothing lol
 

Viva La Android

Recognized Contributor
Jul 31, 2019
1,650
747
Northeastern Tennessee
LG G Pad 8.3
Moto G
Yo I'm coming from the g6 play forum with a quick question. Does this by chance work with the same current root method for the g6 play which is booting in twrp and formatting data to decrypt it then flashing twrp and flashing through twrp the encryption disabler zip then flashing magisk. If someone is able to confirm that I can possibly try to make a decent guide for you guys. We don't have a offical twrp that decrypts on its own and the twrp we have ain't a dirty port so I know there may be some differences when it comes to twrp related issues but it's better than nothing lol
There is one significant difference (as it regards rooting) between the Moto G6 Play and the Moto G7 Play. The G7 Play uses the A/B partition index while the G6 Play uses a standard GPT index. The current dilemma with root for the G7 Play involves the A/B partition config. Developer topjohnwu has been notified of this issue on the Magisk support thread, and has stated that he is working on a resolution at present.
 

Spaceminer

Senior Member
There is one significant difference (as it regards rooting) between the Moto G6 Play and the Moto G7 Play. The G7 Play uses the A/B partition index while the G6 Play uses a standard GPT index. The current dilemma with root for the G7 Play involves the A/B partition config. Developer topjohnwu has been notified of this issue on the Magisk support thread, and has stated that he is working on a resolution at present.

There has to be more to it than this. There are plenty of devices using A/B partitioning that can be rooted with Magisk. As far as I know, Magisk has supported A/B since version 17.1. Reading through the threads it sounds like more a TWRP problem than a Magisk one.

Has anyone tried patching boot_a and boot_b with Magisk and flashing both at once?
 
  • Like
Reactions: Viva La Android

Fdraco10

Senior Member
Sep 9, 2016
655
93
Managua, Nicaragua
There has to be more to it than this. There are plenty of devices using A/B partitioning that can be rooted with Magisk. As far as I know, Magisk has supported A/B since version 17.1. Reading through the threads it sounds like more a TWRP problem than a Magisk one.

Has anyone tried patching boot_a and boot_b with Magisk and flashing both at once?

You try and let's us know
 

Viva La Android

Recognized Contributor
Jul 31, 2019
1,650
747
Northeastern Tennessee
LG G Pad 8.3
Moto G
I don't have the device otherwise I would. That's why I'm asking if anyone has tried it yet.
Yes. I patched both boot_a and boot_b with Magisk v19.3. My device booted into the OS with no problems at all, yet Magisk Manager indicates that root is not installed. Topjohnwu has been notified of the root issue with the Moto G7 Play, and has stated on the Magisk support thread that he is looking into a resolution. It's not a TWRP issue at this point because there is no unofficial or official TWRP for the G7 Play as of yet. Like you, I fully agree this is a bizarre issue. Root strategies which are working on the Moto G7, G7 Power & G7 Plus are not working on the G7 Play. Although Magisk has certainly supported A/B devices for some time now, no universal root method is completely infallible. There are many devices -- both A/B and standard GPT -- that encounter problems with Magisk from time to time. Luckily for the Android community, topjohnwu works hard on resolving any known issues like the one at hand.
 
Last edited:
  • Like
Reactions: Spaceminer

Spaceminer

Senior Member
Yes. I patched both boot_a and boot_b with Magisk v19.3. My device booted into the OS with no problems at all, yet Magisk Manager indicates that root is not installed. Topjohnwu has been notified of the root issue with the Moto G7 Play, and has stated on the Magisk support thread that he is looking into a resolution. It's not a TWRP issue at this point because there is no unofficial or official TWRP for the G7 Play as of yet. Like you, I fully agree this is a bizarre issue. Root strategies which are working on the Moto G7, G7 Power & G7 Plus are not working on the G7 Play. Although Magisk has certainly supported A/B devices for some time now, no universal root method is completely infallible. There are many devices -- both A/B and standard GPT -- that encounter problems with Magisk from time to time. Luckily for the Android community, topjohnwu works hard on resolving any known issues like the one at hand.

I read the responses in his thread about that, and it seems like you guys aren't getting root without a working TWRP. The problem that was laid out, is that fastboot can't patch existing files, it can only overwrite them. Without a custom bootloader, Magisk would never be able to patch existing files through fastboot.

Personally, I think that's a very sh*tty position to be in, and I want to help you guys out. If you or anyone else wants to upload your most recent boot.img, it'll save me some time. I'm not too familiar with the A/B partition setup, but I am very familiar with TWRP. I think that I can get it working for you folks. I will make this happen or break my brain trying. No phone with an unlockable bootloader should go unrooted! Thank you for answering my question by the way. That's one less thing to troubleshoot.

I just want to confirm a few things before I get to work.

Is your base model number xt1952?

Is your code name Channel?

Where is the current TWRP hacked from? (Moto G7, G7 Power, G7 Plus?) - Moto G7. I found it in the OP.

And are you guys arm32 or arm64?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    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

    Code:
    adb root
    adb shell
    setprop persist.sys.phh.mainkeys 0
    reboot
    6
    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.
    5
    Hi folks, first, thank you to Spaceminer for all his didication to helping us with TWRP4.img and all the people who teamwork that make the thread so interresting, Viva La Android, ninjakira, jasonmerc, jwreidmoto for all his questions and all others.

    In order to root this phone, I interrested to this post. I have a Motorolla G7 Play XT1952-4 PSB29-105-134-4 RETCA.

    I read all the posts in that thread, I understand that there's is no ROOT solution with magiks so far, doesn't it ?

    But it seems to have way to installed TEMPORARLY the TWRP by install it from the RAMDISK with TWRP4.img, doesn't it ?

    Once TWRP4.img is installed in RAMDISK, it's seems possible to patched PERMANENTLY the BOOT image with TWRP4.img, doesn't it ?

    I rooted few phones by fellowing step by steps a procédure. I'm not familiar with all the Fastboot commands that required a A/B boot system.
    Hello @ghislain_racine and welcome. Yes, this A/B partitioning scheme has certainly changed the conventional methods for rooting Android devices. On the Moto G7 Play, since the ramdisk no longer resides within the /boot partition, Magisk has no other choice than to be installed to the /recovery partition. Using the boot image patching method from Magisk Manager, it is necessary to select the "Recovery Mode" option in Advanced Settings before patching your boot image. And, of course, once the Magisk patched boot image has been installed to your device, both Magisk and recovery mode reside in the same place. Booting to recovery is then nececessary during every reboot on order for your Android OS to run Magisk systemless root.
    To answer your question, yes the Moto G7 Play (including the xt1952-4) has a Magisk root solution. However, the A/B partition scheme and the system-as-root configuration of our device mandates booting to recovery in order to properly use Magisk.
    I hope I've explained this correctly, and I would ask one of the more learned members to correct my dictum if I've made any mistakes. My device is also the xt1952-4 (Boost Mobile) and I'm running Magisk systemless root via the recovery mode method.
    Magisk's creator and maintainer, @topjohnwu, gives a detailed explanation of installing Magisk to recovery in his gitbub.io support page. https://topjohnwu.github.io/Magisk/install.html
    4
    I just made a post, I was able to get Magisk on the G7 Play for the most part if anyone is interested. I know this was for TWRP but somewhat in the same boat.

    https://forum.xda-developers.com/g7-play/how-to/magisk-g7-play-xt1952-4-installed-t3975477
    4
    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.