[GUIDE][ROOT][Moto G6][ALI] TWRP, Root, and Magisk installation guide.

Search This thread

Android-Jack

Member
Apr 12, 2015
49
5
0


---------- Post added at 09:10 PM ---------- Previous post was at 08:49 PM ----------

Quote:
Originally Posted by Xero1017
Successfully rooted my g6 1925-6 with the 19-4 build. Only issue now is that I cannot setup fingerprint security at all. I went through device setup and did fingerprint + pattern, entered pattern but it kept looping back when I needed to setup fingerprint. I skipped it thinking it was a temp glitch but now when I go to settings it keeps crashing when I click on fingerprint setup.

Anyone else with this issue?

Update, wiped my cache, re installed magisk zip, footed and got fingerprint capabilities back but now the play store won't run... going to try again when I'm back home. Curious if anyone else noticed play store, fingerprint reader, or any other 'core' function not working after rooting?

Thanks

Did you resolve the issue?

===========================================================

Want to buy a Moto G6 XT1925-6, USA, and read through this thread. Want to confirm that the post #1 instructions are good for this variant before purchase? Their are not many root G6 threads or root confirmations and success posts .

Thanks!
 

stifmaster81

Senior Member
Feb 27, 2013
751
47
48
on the web lolifirmware do not take more images of the motorcycle g6, the monthly performances are only by ota?

Enviado desde mi moto g(6) mediante Tapatalk
 

stifmaster81

Senior Member
Feb 27, 2013
751
47
48
I do not know but you dont miss much the July patch does not change anything important
As you can tell from a Nexus to this phone ... my god what a phone potato

Enviado desde mi moto g(6) mediante Tapatalk

---------- Post added at 07:02 PM ---------- Previous post was at 06:56 PM ----------

What is the last motorcycle patch g 6 Ali? the one from maio? or is there another more updated? If so, can you pass the link? Thank you

Enviado desde mi moto g(6) mediante Tapatalk

---------- Post added at 10:47 PM ---------- Previous post was at 10:41 PM ----------

how much to the last thing, I just have to put the official rom of my mobile XT1925 / 4, but if I put for example XT1925 / 10 what would happen? and the last question, when updating would be worth the boot. img

Enviado desde mi moto g(6) mediante Tapatalk
Someone can clarify the doubt ... Thank you forum. . .

Enviado desde mi moto g(6) mediante Tapatalk
 

Alexibarra98

Member
Feb 12, 2018
22
9
0
As you can tell from a Nexus to this phone ... my god what a phone potato

Enviado desde mi moto g(6) mediante Tapatalk

---------- Post added at 07:02 PM ---------- Previous post was at 06:56 PM ----------

Someone can clarify the doubt ... Thank you forum. . .

Enviado desde mi moto g(6) mediante Tapatalk

you can do it, if the firmware corresponds to your model then when flashing it will start, it will work but it can give you some problems like 4g or wifi, do it at your own risk, I recommend you make a backup in twrp before

---------- Post added at 06:41 PM ---------- Previous post was at 06:35 PM ----------

I can make a backup with my security patch for July (OPS27.82-87) and upload it but as I said it can give you problems if you install it, better wait for your cell phone to update
 

stifmaster81

Senior Member
Feb 27, 2013
751
47
48
Extras:

THIS AREA STILL CONTAINS LEGACY DOWNLOADS AS WELL AND ARE THUS NOT ENSURED TO WORK


The following is provided for backup purposes only in case you forgot to back up. When pulled from the phone, the images are the full partition size, not actual size.

XT1925-6 (OPS27.104-15-10) Factory pulled files
These files will get you back to stock as far as this guide is concerned. Remember though, 'bad key' will be displayed as they were pulled from a device instead of being provided by Motorola
Factory boot image - XT1925-6_factory-boot.img
Factory recovery image - XT1925-6_factory-recovery.img
Factory fstab.qcom file - factory-fstab.qcom - You can push this file to /vendor/etc/ to go back to stock vendor parition if you need. Factory boot images will probably have an issue booting without vendor being completely stock.


The following images have been provided by other XDA members:
XT1925-2
Factory boot image - XT1925-2_factory-boot.img
XT1925-4
Factory boot image - XT1925-4_factory-boot.img
XT1925-5
Factory boot image - XT1925-5_factory-boot.img

for the new version 82-87 the boot.img of the 82-72 version does not work in bootloop, will you release new versions of the boot?
 

dejello

Senior Member
Oct 15, 2010
223
263
0
for the new version 82-87 the boot.img of the 82-72 version does not work in bootloop, will you release new versions of the boot?

Upload and provide a link and I'll get on it :good:

[EDIT] Found the zip link on lolinet... You can try this: OPS27.82-87_no-verity_boot.img Let me know if it's working and I'll add to to the first post.
 
Last edited:

ChefGeoff

Member
Jan 7, 2018
21
5
3
36
Altoona, PA
Sorry wrong terminology, I can boot into TWRP but when I go to install the magisk zip (what I was calling flashing) I cannot get the data partition to mount no matter what I do. I've gone step by step in this guide multiple times and can't get data to mount.

Any ideas? Thanks

You have to flash twrp after you boot into twrp, and then reboot into recovery and then you have to wipe data and then you can see contents of SD card to flash magisk.
 

tomjohnson9009

New member
Jul 31, 2018
2
0
0
If you have device not found then you need to ensure the usb device is installed correctly. Once correct drivers are installed it should work as expected

The drivers were fine. The fact I was flashing anything was proof. My problem ended up being I was flashing the incorrect file. 19-4 no verity worked perfectly and I am now rooted. Dragging files into the command prompt window for pushing files on to my phone was easier than figuring out where the adb folder is on my computer. For example "adb push (file in your download folder on your computer)".
 

Jleeblanch

Senior Member
Feb 6, 2012
2,003
5,715
203
Colchester, VT

Attachments

  • Screenshot_20180903-122133.jpg
    Screenshot_20180903-122133.jpg
    120.5 KB · Views: 214
Last edited:

Jleeblanch

Senior Member
Feb 6, 2012
2,003
5,715
203
Colchester, VT
Have new unrooted phone with opss27.104-15-10. how can it be root with the update? Or is root limited to the no_verity builds per post #1 links?

Thanks!
I've been busy most of the day, but am working on that as we speak.

Make sure to backup your updated stock boot.img (using the steps provided in the OP) before you attempt any messing around. I've personally tried a few things and each time I've ended up in a boot loop and even a couple times (mostly due to the forced encryption) I've had to re-flash the stock rom and start from scratch. I have not yet manually patched the boot.img myself to remove the "verify" flag from /system & /vendor as I wanted to experiment a little being that I was running a clean unmodified setup.

One good thing that's came out of this tho was I created a nice little script for Linux users to re-flash the stock rom for our device. I'll probably share that in the [STOCK][ALI] Firmware Moto G6 thread at some point.
 

Android-Jack

Member
Apr 12, 2015
49
5
0
I've been busy most of the day, but am working on that as we speak.

Make sure to backup your updated stock boot.img (using the steps provided in the OP) before you attempt any messing around. I've personally tried a few things and each time I've ended up in a boot loop and even a couple times (mostly due to the forced encryption) I've had to re-flash the stock rom and start from scratch. I have not yet manually patched the boot.img myself to remove the "verify" flag from /system & /vendor as I wanted to experiment a little being that I was running a clean unmodified setup.

One good thing that's came out of this tho was I created a nice little script for Linux users to re-flash the stock rom for our device. I'll probably share that in the [STOCK][ALI] Firmware Moto G6 thread at some point.

So i should:

OTA update patch?
Backup updated build?
Install no_verity per OP or wait for a no_verity with update/patch from you?

Appologies for the basic noob questions. I have successfully rooted two different phones in the past few years and both times went pefect on first attempt. This phone has me a bit more concerned/intimidated.

On win 10, not linux.
 

Jleeblanch

Senior Member
Feb 6, 2012
2,003
5,715
203
Colchester, VT
So i should:

OTA update patch?
Backup updated build?
Install no_verity per OP or wait for a no_verity with update/patch from you?

Appologies for the basic noob questions. I have successfully rooted two different phones in the past few years and both times went pefect on first attempt. This phone has me a bit more concerned/intimidated.

On win 10, not linux.
Wait for updated patched boot.img from myself or the OP.

I would also hold off on permanently flashing TWRP as it probably won't stick anyway. But you can fastboot boot twrp.img to back up stock images (at minimum boot and recovery). Just follow that section in the OP to backup as much as you can. I personally backed up system, vendor, boot, recovery, persist, logo and oem (I think more partitions too) as well as fstab.qcom. That last one is the same as the previous version so if you already did that, don't stress it.
 

Jleeblanch

Senior Member
Feb 6, 2012
2,003
5,715
203
Colchester, VT
OPSS27.104-15-10-4 OTA Update

I finally had a chance to mess with the boot.img from the latest OTA update for OPSS27.104-15-10-4 (retus).

I was able to successfully remove verity and gain root with Magisk! I'll upload the new boot.img here shortly for the users who accepted the OTA update and want to root.

I'm also happy to note that my custom kernel also works on the latest update, so I'll be opening a new thread in the Moto G6 development section later on today as well

Another thing, I'm also trying to work on another option for ALL Moto G6 users to be able to remove verity (and root if you want) without the need to maintain new boot.img's every time there is an OTA update. No promises just yet, but I got some ideas. It would make things a hell of a lot easier for everyone if I can pull it off.
 

Attachments

  • Screenshot_20180908-115106.png
    Screenshot_20180908-115106.png
    119.2 KB · Views: 140
Last edited:

Android-Jack

Member
Apr 12, 2015
49
5
0
I finally had a chance to mess with the boot.img from the latest OTA update for OPSS27.104-15-10-4 (retus).

I was able to successfully remove verity and gain root with Magisk! I'll upload the new boot.img here shortly for the users who accepted the OTA update and want to root.

I'm also happy to note that my custom kernel also works on the latest update, so I'll be opening a new thread in the Moto G6 development section later on today as well

Another thing, I'm also trying to work on another option for ALL Moto G6 users to be able to remove verity (and root if you want) without the need to maintain new boot.img's every time there is an OTA update. No promises just yet, but I got some ideas. It would make things a hell of a lot easier for everyone if I can pull it off.

Great!!

You mentioned in an earlier post not to "permanently flash twrp". Doesnt the op unstructions flash twrp permanently?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 36
    Update March 23, 2019: I'd like to apologize to everyone. It looks like I am not going to be able to actively keep this thread updated like I used to. I have had too much going on at home an work and it doesn't look like it's going to settle down any time soon. The thread is still usable so I will leave it open for discussion.

    Code:
     * Your warranty is now void.
     *
     * I am not responsible for bricked devices, dead SD cards, fires, rigged elections,
     * thermonuclear war, or you getting fired because the alarms failed and you
     * could not call in.
     *
     * Please ensure you have an advanced understanding of this device before
     * flashing it! YOU are choosing to make these modifications or your own free will.
    Thread Notes:
    • I cannot stress this enough--Please READ EVERY STEP FULLY to be sure of what you need to do.
    • Some steps listed in this process WILL wipe your userdata. If you have anything you need to save back it up first. While flashing via bootloader you should see it say "(bootloader) Image not signed or corrupt" - (and can show "bad key" or "N/A" while booting) this is normal expected behaviour as the image is no longer properly signed by motorola (I had to repack as our dtb's are compressed inside the boot image)
    • This thread is not about custom roms - You may be able to run them using the boot images provided, but this thread does NOT cover that
    • This guide assumes your are on COMPLETELY STOCK (FACTORY) FIRMWARE. If you have previously flashed *any* other firmware, system images, kernels, or anything else I cannot say for sure that this guide will work for you
    • This WILL affect your ability to get OTA's if/when they come. This thread does not cover getting back to stock. It's up to you to figure out how to get back to stock if you want the update. You're best bet to avoid issues (boot-loops, non-booting, failed updates, etc) is to go completely back to stock first!
    • Android GSI's - For the record, I have booted GSI's made (Aonly-32bit) however there are some issues I've noticed regarding sounds while using them. Again, this thread is NOT the place to discuss problems with this.
    • TWRP - We can now use official twrp! Please click this link to see details. I have edited the first post to reflect the current state of our twrp images. If you see an error or run across an issue please let me know and I"ll see about fixing it. I have linked an unofficial build I made in the official thread to fix some issues with the official build. When I get a chance to properly verify the new test-build (made by the twrp gerrit) I will see about having the official one updated.
    • PIE - These instructions were made using Oreo, not Pie. There are differences in the boot images at the very least (you may not need a modified boot image for Magisk). I have not flashed Pie yet to test things. If you want to test, please let me know how things work out for you.

    Working Images:
    The variant models below have been verified working using one of the firmware versions listed.
    XT1925-2, XT1925-3, XT1925-4, XT1925-5, XT1925-6, XT1925-13
    • OPS27.82-19-4 (Build Date: Fri Mar 9 11:04:39 CST 2018)
    • OPS27.82-41 (Build Date: Sat Mar 24 01:37:45 CDT 2018)
    • OPS27.82-72 (Build Date: Sun May 27 02:13:41 CDT 2018)
    • OPS27.82-87 (Build Date: Mon Jul 16 14:54:23 CDT 2018).
    • OPSS27.82.87-3 (Build Date: September 2018 Security Update)
    • OPSS27.82-87-6 *Provided by @Jleeblanch
    • OPS27.104-15-10 (Build Date: Wed Mar 28 21:13:40 CDT 2018)
    • OPSS27.104-15-10-4 (Build Date: July 2018 Security Update) *Provided by @Jleeblanch
    • OPS27.104-92 (Build Date: September 2018 Security Update)
    • OPSS27.104-92-2 (Build Date: November 2018 Security Update) *Provided by @Jleeblanch
    *
    *Waiting for confirmation:
    *OPS27.82-57
    *

    Prerequisites:

    • Unlocked bootloader.
    • ADB/Fastboot installed on your machine ( https://developer.android.com/studio/releases/platform-tools ) If you have issues with commands make sure you have a current build of ADB and fastboot.
    • At least some knowledge of how to use ADB and fastboot, this guide does not cover that.
    • Some knowledge of how TWRP/custom recoveries work.


    Finally, the guide:


    Step 1) Downloading TWRP and modified boot image

    Download TWRP and a modified boot image that matches your factory firmware version to the ADB/Fastboot folder on your computer. The boot image downloads are based on the premise of the firmware you are running. If yours is not listed please back up (next step) and provide a link for me to edit.
    Reboot to your bootloader. You can do this by turning on your device while holding the power and volume down buttons at the same time. Once the device reboots to the bootloader connect your phone to your computer.



    Step 2) Backing up your stock boot and recovery images and fstab.qcom file--if you have these already you can safely skip to step 3.

    Open a terminal/command prompt on your computer and type the following to boot into TWRP (If your filename is different, please replace the filename below with yours):
    Code:
    fastboot boot twrp-v3.2.3-ali.img
    Once TWRP boots (it may take a bit to boot because it is trying to decrypt your userdata. It will fail as TWRP--at least for now--needs to be flashed to decrypt properly. Swipe to allow modifications if you want if asked), type the following in your computer's terminal/command prompt to back up your boot and recovery images:
    Code:
    adb pull /dev/block/bootdevice/by-name/boot stockboot.img
    Code:
    adb pull /dev/block/bootdevice/by-name/recovery stockrecovery.img

    If you intend to remove encryption you'll want a backup of your fstab.qcom file:
    To back up your fstab.qcom file (modified in a later step) we need to mount Vendor in TWRP first if it's not already mounted. From TWRP's main menu press 'Mount'. You can see if the vendor partition is mounted (check mark next to the word 'Vendor') . If it isn't mounted just press 'Vendor' and it should mount. Next type the following:
    Code:
    adb pull /vendor/etc/fstab.qcom factory-fstab.qcom

    Reboot to the bootloader.



    Step 3) Installing TWRP and modified boot images

    Run the following command from your computer's terminal/command prompt to install the TWRP image to your device (If your filename is different, please replace the filename below with yours).
    Code:
    fastboot flash recovery twrp-v3.2.3-ali.img

    Run the following command from your computer's terminal/command prompt to install the boot image to your device.
    usage:
    Code:
    fastboot flash boot <insert-boot-image-name-here>.img
    example:
    Code:
    fastboot flash boot OPS27.104-92_no-verity_boot.img



    Step 4) Wiping your data on your phone to remove the current encryption. Ensure you have a backup beforehand if you want it.
    This step is only needed if you intend to remove your current encryption, if you don't want to do this please skip to the next step

    Boot into TWRP by using the volume keys on your phone to select "recovery mode" and then press the power button and TWRP will boot up (it may take a bit to boot because it is trying to decrypt your userdata or if you have a screen lock it may ask for it--enter it and proceed. Please read the thread linked above for help if you enter it incorrectly.)

    Swipe to allow system partition modifications if you want and are asked. If you wish to backup your data and restore it after formatting then do so now. Next click the "Wipe" button in TWRP and then "Swipe to Factory Reset". This step should have formatted data as it was encrypted (removing internal storage ) however if it didn't and data is still not mountable in TWRP you can use the "Format Data" button above "Swipe to Factory Reset", this will format data and remove EVERYTHING from the internal storage as well. You may need to format data again and reboot into TWRP. DON'T REBOOT TO SYSTEM YET.



    Step 5) Removing forced-encryption upon first boot (you may still choose to encrypt after booting--Moto's firmware defaults to saying it's encrypted, at least on mine, in the security tab of settings but it's not and the option to encrypt still exists within that menu)
    This step is only needed if you intend to remove forced encryption, if you don't want to do this please skip to the next step

    **THIS STEP DOES NOT REMOVE CURRENT ENCRYPTION--IT ONLY REMOVES FORCED ENCRYPTION DURING THE FIRST BOOT: YOU MUST HAVE COMPLETED STEP 4 ABOVE TO REMOVE CURRENTLY ENCRYPTED DATA**

    This file has been verified working on Oreo and may not function correctly on Pie, please be aware of this: see HueyT's Post.
    Download the force-encryption disabler zip to your ADB/Fastboot folder: [AFH] Force_Encryption_Disabler_For_ALI_Oreo_v2.zip

    Now push that zip file to your phone. The example uses the /tmp directory. From your computer's terminal/command prompt type the following into your command prompt/terminal from your adb/fastboot folder:
    Code:
    adb push Force_Encryption_Disabler_For_ALI_Oreo_v2.zip /tmp

    Flash the zip you just pushed by pressing the Install button in the TWRP main menu, select the folder where you pushed the zip to and install it. We can verify it flashed by mounting vendor manually if it's not mounted and using the following command from your computer's terminal/command prompt and checking the line that mounts /data says "encryptable" instead of "forceencrypted":
    Code:
    adb shell "cat /vendor/etc/fstab.qcom"
    The result should include this line:
    /dev/block/bootdevice/by-name/userdata /data f2fs rw,discard,nosuid,nodev,noatime,nodiratime,nobarrier,inline_xattr,inline_data wait,check,formattable,encryptable=/dev/block/bootdevice/by-name/metadata
    Note where it says "encryptable". That means we now have the choice to do so vs. being forced to. If for whatever reason it still says "forceencrypted" mount vendor manually and try again.



    Step 6) Rooting via Magisk
    This step is only needed if you intend to have root access, if you don't want to do this or wish to do this later please skip to the next step
    To be safe, you may need to reboot back into TWRP to make sure it sees the data partition mounted correctly and again swipe to allow system partition modifications if you want. (I've seen Magisk say forced-encryption was still detected even though it actually wasn't if I didn't reboot)

    Download Magisk from the linked thread to your ADB/Fastboot folder: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

    Run the following command to push the Magisk zip to your device (v17.3 (beta) is current as of the last edit of this post, if it changes please put your version number instead).
    The example uses the /tmp folder:
    Code:
    adb push Magisk-v17.3.zip /tmp

    Flash the Magisk zip from TWRP by pressing the Install button in the main menu and navigate to the /tmp (or wherever you pushed it) folder to select and install it. Magisk should show success without any mention of verity or encryption. If it does, something hasn't gone right and you may need to start again.



    Step 7) Almost finished!

    Reboot your device. If you installed Magisk it will say "N/A" in the top corner of your device for a few seconds (otherwise it should say "bad key"). This is normal. It may look like it bootloops that screen, just let it go and and it should boot the Motorola boot screen and you can setup your device as a new phone.

    Once booted, if you installed Magisk, verify Magisk Manager is installed and the root functionality works.



    Step 8) ???



    Step 9) Profit





    Credits:
    @kwiksi1ver - getting things going for us, work with twrp and verity and allowing me to use his thread as base for this guide.
    @CodyF86 and his Moto E5 thread for clues as to what it would take to turn off DM-Verity (per kwik)
    @Dadud - testing and constantly nuking said device
    @AngryManMLS - testing and communications
    @Vache - Provided us the fix for sdcards in TWRP.
    @Xennet's thread regarding verity and encryption and the disabler zip and everyone there: Disable [DM-Verity]/[Force Encryption] [OnePlus 3T/3] for [Oreo] Oxygen OS
    @likemiketoo - Having had TWRP built for us for testing purposes
    @Jleeblanch - Helping provide various no-verity images and other help/advice like....everywhere
    Everyone else who I am forgetting because let's be honest, I'm sure I have. If you feel like mention is owed please let me know and I'll be happy to add.
    7
    OPSS27.104-15-10-4 OTA Update

    I finally had a chance to mess with the boot.img from the latest OTA update for OPSS27.104-15-10-4 (retus).

    I was able to successfully remove verity and gain root with Magisk! I'll upload the new boot.img here shortly for the users who accepted the OTA update and want to root.

    I'm also happy to note that my custom kernel also works on the latest update, so I'll be opening a new thread in the Moto G6 development section later on today as well

    Another thing, I'm also trying to work on another option for ALL Moto G6 users to be able to remove verity (and root if you want) without the need to maintain new boot.img's every time there is an OTA update. No promises just yet, but I got some ideas. It would make things a hell of a lot easier for everyone if I can pull it off.
    6
    TWRP should be fixed now, back to pretty colors and maybe a cursor? Please redownload

    MotoG6-ali-TWRP.img
    5
    Extras:

    THE BOOT IMAGE LINKS IN THIS POST HAVE BEEN REMOVED TO AVOID CONFUSION: THEY WERE OLD DOWNLOADS WITH IMPROPERLY LABELED NAMES.


    The following is provided for backup purposes only in case you forgot to back up. When pulled from the phone, the images are the full partition size, not actual size.

    XT1925-6 (OPS27.104-15-10) Factory pulled files
    These files will get you back to stock as far as this guide is concerned. Remember though, 'bad key' will be displayed as they were pulled from a device instead of being provided by Motorola
    Factory boot image - *link removed*
    Factory recovery image - *link removed*
    Factory fstab.qcom file - factory-fstab.qcom - You can push this file to /vendor/etc/ to go back to stock vendor parition if you need. You'll need to rename it to 'fstab.qcom' to make it work right. Factory boot images will probably have an issue booting without vendor being completely stock.


    The following images have been provided by other XDA members:
    XT1925-2
    Factory boot image - *link removed*
    XT1925-4
    Factory boot image - *link removed*
    XT1925-5
    Factory boot image - *link removed*
    5
    Thanks to @Jleeblanch we have another no-verity boot image: OPSS27.104-15-10-4_no-verity_boot.img is available for downloading!
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone