[Moto G5 Plus Guides, News, & Discussion] Jrhotrod:
By popular demand, I am posting the full Moto G5 Plus rooting guide! 100% noob-friendly. This is a complete step-by-step guide for virtually every little step. This guide is for WINDOWS ONLY; if you have a Mac or Linux this will not work for you.

This procedure was also updated on September 22, 2018 for the official Oreo 8.1 release. I haven't had a chance to test everything in the "a few notes" section yet, but I'll get to it as soon as I can!

These steps are for those desiring a fresh install of the stock ROM

1) Download the NPN25.137-83 firmware from AndroidFileHost here.

NOTE: This is firmware for the U.S. variant, software channel retus. If you are in India or Brazil, download your special firmwares from firmware.center.

Note: No official Oreo firmware has been released yet, but when it does I'll add the link here.

2) Extract the zip file you downloaded from AFH.

3) Download my flashall.bat from this link. It removes the need for you to manually flash all partitions, just double-click it and it'll run all the commands for you.

4) Move the flashall.bat to the extracted folder with the firmware files inside it.

5) Download device drivers for the phone from this link. The program is "Motorola Device Manager", download and install it.

6) Ensure that ADB and Fastboot are installed on your PC; if not, there is a super-quick installer found here.

7) Download the latest Magisk ZIP from hereand move it to your phone's SD card or internal storage.

8) Reboot your phone to the bootloader. To do this, turn it off, then hold down the power and volume down buttons until you see a bugdroid undergoing open-heart surgery! :silly:

9) Connect the phone to your PC with your USB cable.

10) Run the flashall.bat script. This will take some time to flash, just be patient and don't worry!

NOTE: If the command window appears for a brief moment then disappears, device drivers may not be installed. In this case post on this thread for help with that.

11) Once the command window closes, it should have completed the flashing and you are safe to press the power key on the phone to start Android! Just make sure that the text near the buttons reads "START."

12) Let it boot, and don't be afraid to set it up; rooting will cause no data loss.

Actual rooting process beings here

13) Once everything is set up to your liking, go ahead and download TWRP from this link.

14) Turn the phone off again and reboot to bootloader using previously mentioned key combination.

15) Now here is where things can be a bit version-specific and confusing regarding Windows.

15a) Navigate to the folder where the TWRP image is.

15b) Hold down the "shift" key and right-click anywhere in the Explorer window. If you're on Windows 7 or 8(.1), it should give you an option to "Open command window here." Click that. On Windows 10, however, it will likely only display an option to "Open PowerShell window here." Click that option and it will work just fine.

16) Now input the command: "fastboot flash recovery [filename].img", where [filename] is the name of your TWRP image file. Smack Enter and it will take a mere few seconds to flash the new recovery.

16b) Alternatively, you can use "fastboot boot [filename].img" to temporarily boot TWRP for the purpose of flashing Magisk. This retains stock recovery so you can accept OTAs without a clean install. If you decide to do this, skip to step 18. But if you flashed it like me, continue with the guide as normal.

17) Now that TWRP has been flashed, press the volume down key until you see the label on the side change to read "RECOVERY." At that point you can press the power button and you will boot right into TWRP.

18) Now that you're in TWRP, "Keep system read-only." Press the INSTALL button and navigate to the location where the Magisk ZIP is located. Simply tap it and "Swipe to install."

19) DONE! Reboot Android and PROFIT, you are now rooted.

A few notes:

-[Untested on Oreo] It is impossible to unroot with just the Magisk uninstaller ZIP; this phone's boot.img has some problems with Magisk. So if you do ever need to unroot, run the uninstaller in TWRP, and then go to fastboot mode and flash the stock boot.img from the stock firmware files.

-On Oreo, Magisk modules can be installed as normal, but on Nougat there's a kernel bug that doesn't let them be installed. However, there exists a Magisk module to fix this odd behavior and let you use Magisk modules on Nougat. You can find it in the Magisk repo by heading to the "Downloads" section of the app and just searching with the term "f2fs." It's called "F2FS Loopback Bug Workaround" and developed by [MENTION=5228676]VR25[/MENTION] here on XDA. Flash it through TWRP and modules should work again. Huge thanks to him and his contribution; you should add yours to the pile at the official thread for the module.

-On Oreo, SafetyNet passes just fine without any modifications, but on Nougat the kernel bug makes it so that isn't passed. You can pass SafetyNet on Nougat if you flash only the F2FS loopback module. Thanks to [MENTION=5237901]Wolfcity[/MENTION] for the info here.

-[Untested on Oreo] And finally, if you want, I highly recommend the Xposed Framework, which gives you a metric TON of mods for your phone. Seriously, it's amazing. Look into it a bit!

This procedure will be updated with the official release of Oreo for this device. Stay tuned!