yashsingh1/xdaforums huggingface dataset:
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Can you run the following from adb on your computer once you’re booted to TWRP and post the fstab.qcom file here.

adb shell mount -o,rw /dev/block/platform/soc/by-name/vendor /vendor

adb pull /vendor/etc/fstab.qcom
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
That looks perfect. Let's see if we can get root now. This mini-guide is for your model of G6 only. I can write up a better guide once we confirm this works. Make sure you still have your original recovery.img and boot.img and fstab.qcom in case we run into issues.

Alright with that out of the way I think we can get root following these steps.

Step 1.) Download moto_g6_no_dm_verity_boot.img patched dm-verity boot image and download it into the ADB/Fastboot folder on your computer and boot your phone into bootloader mode.

Step 2.) Run the following command from your computer to install this boot image to your device.

fastboot flash boot moto_g6_no_dm_verity_boot.img

Step 3.) Run the following command from your computer to install the TWRP image to your device. (ensure that TWRP image you downloaded a few posts ago is in the folder you are running the commands from)

fastboot flash recovery moto_g6_TWRP_test2.img

Step 4.) Use the volume keys on the device to select boot to recovery and TWRP will boot up again. When it prompts for a decryption password select cancel again.

Step 5.) From your computer type the following into your command prompt/terminal from your adb/fastboot folder:

adb shell mount -o,rw /dev/block/platform/soc/7824900.sdhci/by-name/vendor /vendor

Step 6.) Download https://drive.google.com/open?id=186Phjtz1H3_CYEPHVT9HQE6O3QwzULdJ this patched fstab.qcom boot image into the ADB/Fastboot folder on your PC.

Step 7.) Run the following command from command prompt/terminal on your computer: (make sure the folder you are running commands from in ADB doesn't contain your original fstab.qcom that you backed up a few posts ago)

adb push fstab.qcom /vendor/etc/fstab.qcom

Step 8.) Next click the "Wipe" button in TWRP and slide "Swipe to Factory Reset" THIS WILL WIPE YOUR DATA ON YOUR PHONE. Ensure you have backup.

Step 9.) Download Magisk Beta 16.4 https://github.com/topjohnwu/Magisk/releases/download/v16.4/Magisk-v16.4.zip to your ADB/Fastboot folder.

Step 10.) Run the following command to push the boot image to your device

adb push Magisk-v16.4.zip /tmp

This will push the Magisk-v16.4.zip to your /tmp folder

Step 11.) Flash Magisk-v16.4.zip from TWRP using the install option and navigate to the /tmp folder to select it and install it.

Step 12.) Reboot your device
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
Came up with an error screen on the bootloader. telling me to use the software repair assistant, and an error below a paragraph explaining how to do that stating Error: Failed to load kernel! Fastboot reason: Fall-through from normal boot mode

Edit: going to try on a fresh firmware install again just to double check i was doing it right.

Edit 2: still failed
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Sounds like my boot.img patch needs more work. I’ll take a look tomorrow. Thanks for trying.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
Anything you'd like me to try tonight?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Can you try to boot to TWRP_test2 or whatever it was called and extract your boot.img from it? I'm wondering if the boot.img you extracted using the other build of TWRP somehow wasn't correct.

I think the following should actually work this time:

adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot newstockboot.img
adb pull /dev/block/platform/soc/7824900.sdhci/by-name/recovery newstockrecovery.img

In theory it shouldn't make a difference to extract them, but I am curious if this will yield a different file.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
https://drive.google.com/open?id=1eq4xR9dRDGLCR6XufhG-5jcXfP70nkWe

https://drive.google.com/open?id=1z1AlZ1asc1Qh2GQv20yCcv6rWJQEWh0_
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Let's try this file: https://drive.google.com/open?id=17JOvg1VS33XmZzJPIco1cR4HAJeWYjJ6

Reboot your phone to the bootloader and try the following command.

fastboot boot moto_g6_no_dm-verity_test2_boot.img

If you phone boots up like normal after testing we can move onto rooting it.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
appears to bootloop, i get the "motorola. powered by android" screen and then a boot animation, but then it goes to a black screen and restarts. might be due to my encrypted data? I've gotta get to work here so ill be back around noon CDT.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
I think we're on the right track.

You should be able to fastboot flash the new boot.img from today, TWRP image (test2), push the fstab.qcom from a few posts ago, and wipe userdata in TWRP. And test if it boots.

Then if that works and it boots up to android, boot to TWRP and try flashing the magisk beta.

I have a good feeling about this today.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
Still getting a failed to load kernel error
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
What I do not understand is that twrp's own website does not remove the official and so we avoid headache .. and another thing, if we root we can not install the others and others, and I think there should be a page only with the images factory motorola g 6, since we are in the subforum of motorcycle g 6, and mix the g6 + the play etc etc andi is a mess

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Okay, this is odd.

Let's backtrack for a second. If your device is on the stock firmware. Can you flash the TWRP test2 to recovery and reboot? Do you get any errors with that?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
No, boots just fine after flashing twrp test 2.

Edit: May i suggest using some better/faster way of communcation for us? discord/telegram/fbmessenger ect. im heading back out to work right now and i'll be back around 4:00 CDT
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
I sent you a PM w/some direct contact info.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Causical:
You guys are Awesome! Keep us updated here if you don't mind, I'm looking forward to some custom ROMing on the regular G6
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] anandkumarkurapati:
[MENTION=7258572]Causical[/MENTION] I was able to root motog6 but not able to use MagiskHide to hide apps from detecting root . Any help ?
[MENTION=507615]kwiksi1ver[/MENTION] Please keep us updated
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
no new progress last night, but i did find out i flashed my phone with older firmware. I think it shipped with ALI_OPS27.82-72 but when i bootlooped i flashed ALI_OPS27.82-19-4 on top of it. can anyone confirm ALI_OPS27.82-72 is the latest software shipping on the phone?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Can you elaborate on your method for rooting?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] jlink38:
I have OPS27.104-15-10, unlocked in the US.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] anandkumarkurapati:
I have ticked the dm-verity and encryption preserved (other combinations dont work) and patched boot.img with Magisk and later 'flash boot'ed the patched_boot.img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
What's your security patch date?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Mvtxk1:
OPS27.82-72 is the latest firmware update, security patch patch date 1st May
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] jlink38:
I have retus and we are still on March 2018
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] anandkumarkurapati:
Magisk Patched boot image

Someone please disable dm-verity :crying:
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
can you tell me the steps to be root? I want to try it and remove the oppressive ads from the applications

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] anandkumarkurapati:
I have ticked the dm-verity and encryption preserved (other combinations dont work) and patched boot.img with Magisk and later 'flash boot'ed the patched_boot.img

But this root is powerless as dm-verity is enabled . xposed framworks cant be installed . Adblockers also wont work fully
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Josio67:
My failed try :(

Until now, the only method that has worked me to get root is with the patched_boot.img that was mencioned above.

I also tried the proposed by [MENTION=507615]kwiksi1ver[/MENTION] but as [MENTION=4685632]Dadud[/MENTION] tried it didnt work :b

By the way, i found this post https://xdaforums.com/showpost.php?p=74326761&postcount=3 that throught if from another device, it had the same problem and got a solution in the verity of the boot img
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
I wish I knew what was different between the g6 and the g6 play in regards to removing dm verity. The method I used for the play does not work for the g6. It's hard to work on stuff without the device.

I'm setting up a development VM to start looking at what exactly is going on with this stuff.

Edit: I'm wondering if my edits are messing with Android verified boot. Maybe I need to resign the edited boot.img.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] anandkumarkurapati:
Cheers !! . really thank you so much for looking into it . Maybe you can grep for verity in the extracted folder of img .
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Causical:
This is my latest firmware, where did you get a more updated one?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Mvtxk1:
I just received the update notification, then updated...
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
ops27.82-72 is retbr (retail Brazil)'s latest firmware,

OPS27.104-15-10 is retus (retail US)'s latest firmware., stick on 104-15-10 to continue to get OTA's, if you flash 82-72 i highly doubt you'll get OTAs
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Mvtxk1:
I got the 82-72 via OTA
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
you're also on the retBR channel. im on retUS, anyone on retUS shouldn't flash either of these and wait for someone to post 104-15-10.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] BuSheeZy:
I was following this post for the TWRP and you guys made me realize something.

I just got this phone via Amazon and I instantly unlocked the bootloader. I remember seeing something in spanish but didn't think anything of it. Now, I'm realizing that my software channel is set to retLA and I live in the USA. I just looked and now I realize the packaging is entirely spanish. Should I return my phone to get retUS or is there something else that I can do? I don't want to be hindered using TWRP or any other unknown issues.

Thanks for working on the TWRP image.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] anandkumarkurapati:
Any luck ? Betting on you , try something
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
Got a busy weekend, might not be able to touch anything until Monday.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
I wish I knew as well lol... I can add permissible selinux easy enough... Away from the house atm but I am messing around as well attempting to learn something...
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] tomtomfr:
Maybe the disable-verity would help (, option of fastboot
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
officially, is TWRR expected officially?

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] mr.7z:
I have a moto g6 xt1925-3

retbr

but I do not have much knowledge about shell :c

Can I help with anything?

I really wanted to twrp for him
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] supergear:
don't think the G6 will ever get root/twrp due to encryption. No idea why they protected this device so well but not the Plus/Play versions
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] mr.7z:
do not say that please :crying:
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
the encryption is by the Kernel, the functional twrp has to come out plus a customizable Kernel as elementalx and goodbye encryption, meanwhile we have to wait.

Enviado desde mi moto g(6) mediante Tapatalk

---------- Post added at 09:45 PM ---------- Previous post was at 09:43 PM ----------

I say it with everyone's knowledge when I had the nexus5x, was, install twrp by adb, format the internal memory and after that install the Kernel by twrp and goodbye encryption

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] trollingwhovian:
Same here I have the us version with Verizon if there's anything I can contribute let me know don't have knowledge with rooting devices but if there's a file or anything I'm in
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] tomtomfr:
I think I found out lemme test it
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
There is a working TWRP build, and a working root. It's just not pretty.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
An official twrp working well? Can you put the link?

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
This build works. It will not decrypt your user data. When it boots and asks for a decryption key just press cancel.

Feel free to test and let me know any other issues you can identify.

https://drive.google.com/open?id=1rs1czXcCuUIxLpQeD-oiW-mpyAB7TZgp

The biggest issue right now is dm verity. Every kernel I’ve built that removes it will not boot. Even after editing the fstab.qcom.

I’d strongly suggest using “fastboot boot filename.img” with the TWRP file.

Edit: It should be noted i do not have a G6. I have a g6 play. I’m just here to help.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
is flasearlo by adb the twrp install magik and to work? or do I have to install do not know what about Boot.img etc etc?

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
Magisk won't work by zip. You need to download the apk for magisk manager, extract your boot image and patch it through the app, then flash though fastboot. Even then it's not going to get you Xposed or ad blocking.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
then it's still not worth flashing the twrp

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
K.. It was mentioned in the posts above that it isn't really worth flashing unless you're willing to test it.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Causical:
Is there any way to make connections with other developers who might have the device that could help? I wish I knew how to Dev, but I have to learn a programming language and everything before that happens.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kwiksi1ver:
That's what this forum is for? This is the development forum.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Causical:
Well okay then...Who owns a G6 and is a Developer?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
By the way 8.1 for the normal g6? Is it beta or already stable? Link ??

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
I am currently using phh treble (vanilla, no su or gapps). I don't have a link at the moment, it's easy enough to search for. We need 32bit, a only. There are a couple of issues I have noticed at the moment (notification sound when screen is off/locked is jumpy and something is up with the sound and switching between handset and speaker modes [doesn't appear to be able to switch while actively playing sounds - phone and Voxer apps tested ]. I haven't looked in to it any.. I also haven't done any other testing of components.

I have been working on building the kernel from source and have one built (zImage), just haven't found a good way to flash it as unpacking the boot image messes with something (I have seen notes of trailing "garbage" being dropped by gzip) in the ramdisk. Viewing in a hex editor shows lots of blank space, for lack of a better word, followed by a small bit of information. I am also new to the hex stuff and it's been years since I delved into building. I managed to get gzip to not work right once during unpacking the boot.img and pulled a ramdisk that appeared to contain the lost garbage, but any attempt to decompress causes the same issue. I was hoping to be able to build an entire boot.img file to avoid the current issues but haven't made it there yet.

Link - https://xdaforums.com/project-trebl...-development/experimental-phh-treble-t3709659
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
Have you tried anykernel2 yet?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
I have it downloaded but haven't yet. Time is sometimes thin for me but will see what happens the next couple of days
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
I know this isn't twrp but I have realized something I haven't realized before. I was breaking AVB with unpack/repack stuff. Got the stock kernel (very slight mod to command line) to repack with Android Image Kitchen using the --avbkey command line. Magisk installed via the app and using the keep avb selection.. Just copy the boot.IMG file to sdcard and use the app to make the changes, then flash it and voila! Unfortunately I'm sure verity still exists but hey! It's Magisk!

Don't know if anyone else had realized all this already and I honestly don't care at the moment.. I am going to bed now.. Will see about picking up again tomorrow with my built kernel to see if it'll boot.

EDIT- re-read the thread and removed the link as the root has been known :P
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
P.S.- I'm still not responsible for what you do with your phone :p
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kemoti:
It's interesting what you write. So how should this Magisk image be installed ? By ADB ?

If it actually works then you will need a separate theme in the style of "Motorola G6 - Magisk Root Guide".

Have you tested or passed SafetyNet?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
That method was known but doesn't let Xposed or ad blockers work. Or more importantly, twrp.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] dejello:
Welp, it was late lol.. I did notice the modules weren't in the list. I think I need to go back and read this thread again as I may have missed out on some things. Off chance I'll ask to get the thread back on track... Anyone figured out the external sdcard issues?

edit - yeah, I see it mentioned several days ago... And I know I read that :P
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Xero1017:
Has anyone with a US moto g6 used any of the .img files in this thread to successfully root? I can't try booting the images myself with my g6 until tomorrow but will certainly report back once I can.

I'm seeing 2 options? in this thread (too lazy to link, apologies) am I wrong? Or are there more floating around out there I could test tomorrow?

I will be booting these, not flashing, also using magisk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] ivanws:
Its possible install root?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] tomtomfr:
Only works when flashed
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Causical:
So I'm just curious, for clarification what are the current advantages right now of having root on the regular G6? Is it fully functional beyond not having Xposed & adblockers or whatever? Like can I run Viper4android and uninstall system apps and stuff?

*Edit: However from what I understand, a modified boot image has to be flashed in order for root to work, but then that causes TWRP to NOT work? So it would be not advisable to do any of this without an operational custom recovery, correct?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] stifmaster81:
by the way, the motorola g 6, will have Android p?

Enviado desde mi moto g(6) mediante Tapatalk
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] TheLoonyRebel:
So what exactly is needing to be done to get TWRP fully working on the G6 at this point?
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] kemoti:
It is a pity that there is no one to create a working TWRP and root for the G6 model. It will probably be the only one without these options.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Mvtxk1:
I agree with you, i also think this is an absurd, almost all Moto G line has developers and many features to be developed and added.

We who own this cell phone are sad about this fact. If I only knew the least of how to do something, I sure would, we are a united community.

Sorry for my bad english.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Causical:
Tell You What... Something we used to do in the old school days back when I was on Android Forums, not sure if it's ever done here [probably], but anyhow [MENTION=507615]kwiksi1ver[/MENTION] has built TWRP and some boot images that work on the G6 Play...Why does that have anything to do with us regular G6 users? Well he has made attempts to get things going for us over here on the regular G6 [ALI] regardless of the the fact that he does not own the device...Soooo what I'm about to tell you now is, I will personally pitch [in part] help with funding to get this Dev a device (or a Dev). So my hugest suggestion right now would be let's start a funding pool to get a device (G6) to a Dev. It always worked on Android Forums to get things rolling. I'll send some PM's in a bit after I get off work.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Mvtxk1:
I think it's a good alternative, I'm grateful for all the users who worked hard and everyone who has this strong will to develop some Custom ROM and Kernel for this phone. As hard as it may be, I believe we can do it, we just need to be patient ...

Grateful for all users in this project!
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] supergear:
hardly anybody has the regular G6. People in the USA buy the G6 Play while everybody else bought the Plus
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] tzzeri:
Yes, but it might take a long time.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] Dadud:
i bought a g6 and live in the USA. the play seemed less of a phone to me.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] skarloey28:
I purchased the G6 as well and am in the USA. I needed a phone for Verizon and I know that Verizon never allows bootloader unlocks so I wasn't going to buy the Verizon G6 Play and the E5 Plus is only offered on Cricket and Sprint. Typically Motorola releases all of their phones unlocked except the Z line. This is the first launch I've seen where all of the US variants are carrier locked with the exception of the G6.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] fix-this!:
The g5 plus had the same issues. It took a long time for twrp, root and Roms. If someone has access to stock firmware you should be able to use magisk to patch the boot and root. You wouldn't even need twrp.

---------- Post added at 03:56 AM ---------- Previous post was at 03:54 AM ----------

Tbh both phones aren't that great. Personally I'm going to wait and see what the rumored moto one power is all about.
[Moto G6 ROMs, Kernels, Recoveries, & Other Develop] skyredx:
It is sad that there is no Developers for the G6 even the firmware are not accurate maybe it's because all of the other Moto's were cheap that's why they took interest in development