[Moto G6 Guides, News, & Discussion] sawless:
* Warranty is void

* I'm not responsible for any damage to your phone in mistaking anything specified here

* This guide requires intermediate knowledge

I'm posting this guide because I haven't found any special thread about it, and had to search multiple threads and websites to get a conclusion in how to root Magisk only (without flashing TWRP or any other custom recovery). Focused in not decrypting the phone, or modify any system partition for a full OTA compatibility.

Requirements:

* ADB/Fastboot & Motorola USB drivers installed - (PC)

* Unlocked bootloader - (Phone)

* Stock rom - (Phone)

* Magisk Manager (latest stable version installed on your phone)

* TWRP (compatible to the Moto G6 Play model) - please refer to this thread for more details. ***(Of course, you won't flash it!)

*** PLEASE! REFER TO THE UPDATES BELOW!!! ***

Tutorial:

1. Reboot to bootloader

2. Boot into downloaded TWRP using Fastboot code:

fastboot boot twrp_downloaded.img

(on TWRP ignore any password by canceling)

3. Backup stock boot image using:

adb pull /dev/block/platform/soc/7824900.sdhci/by-name/boot stockboot.img

4. Reboot system using ADB code:

adb reboot system

5. After rebooted, copy backed up stockboot.img to the phone internal memory

6. Install and open Magisk Manager, click [Instal] > [Install] > [Select and Patch a File] and select stockboot.img on internal memory.

7. After boot image patched, copy magisk_patched.img from phone Download folder to PC

8. Reboot to bootloader and flash magisk_patched.img to phone using Fastboot code:

fastboot flash boot magisk_patched.img

9. After done, reboot system using fastboot code:

fastboot reboot

10. All done! Open Magisk Manager and check root! For future OTA updates already rooted with Magisk, I recommend this post: https:// www. the custom droid .com/install-ota-update-rooted-android-device-guide/ - (remove spaces :D)

[UPDATE 1]

I've noticed that Moto G6 simply forces reboot system before update the device, if we go to restore images in Magisk to try it out tutorial post from 10., it'll simply be removed after that.

Even doing so and going ahead to update the device losing Magisk, and still have to back up once more the new updated boot image and patch it on Magisk following my guide above, I got a bootloop patching the newest OTA with Magisk 20.0 (latest).

After almost losing indefinitely root access, I got it done, downgrading Magisk to 19.3.

For doing so, download Magisk 19.3 zip file from GitHub repository and copy it to the SD Card, boot up into TWRP using fastboot (without flashing) then proceed as read-only, after that, install Magisk 19.3 zip file to patch the OTA updated boot image, then it's done.

Root it's working properly without updating Magisk.

I don't know exactly why the latest Magisk it is breaking the OTA updated boot image... Whatever, it's a good approach to get root access back after the recent OTA!

I still need to check if this workaround will be working on new OTA's. That's it.

[UPDATE 2]

After recent update - January 2020, my rooting workaround supporting OTA is working properly as followed solution on UPDATE 1, above.

I didn't test using latest Magisk 20.3 apk due the bootloop when patching boot image in Magisk 20. Don't know if that bug has been fixed...

Updating Magisk after successfully rooted using solution above will not result in a bootloop, but I do recommend downgrade Magisk when new OTA is released.