[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
You can find this guide in an always current version here:

https://xdaforums.com/t/guide-moto-g5-plus-flashing-stock-firmware-rooting-12-2020.4205293/

Flashing signed stock firmware

You need

Latest signed stock firmware:

Europe (RETEU):

https://drive.google.com/file/d/13WuhoogtAdoincAyTwCLvRj0d-Z9kL0P/view?usp=sharing

India (RETIN):

https://mirrors.lolinet.com/firmwar...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip

US (RETUS):

https://mirrors.lolinet.com/firmwar...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip

All other locations:

https://mirrors.lolinet.com/firmware/moto/potter/official/

flashallO.bat:

https://www.dropbox.com/s/zfh67uzfle9hsco/flashallO.bat?dl=0

Motorola drivers:

https://drive.google.com/file/d/0B0WGdtNWubBJYnlDcWRBZXltanc/view?usp=sharing

Mini ADB & Fastboot

https://drive.google.com/file/d/1lLYfimKN1U5CJ9cfpTCkhtMiuG8EfXBZ/view?usp=sharing

1) Download the 8.1.0_OPS28.85-17-6-2 firmware for your region (it's the last one for the Moto G5+ (potter), there won't be any updates anymore, so no risk of bootloader downgrading)

2) Install Mini ADB & Fastboot (best place is the root directory of C: or wherever your OS resides).

3) Extract the firmware to that ADB & Fastboot folder.

4) Download my "flashallO.bat" and move it to that folder too.It removes the need for you to manually flash all partitions, just double-click it and it'll run all the commands for you.

5) Download and install Motorola device drivers.The program is called "Motorola Device Manager".

6) 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.

7) Connect the phone to your PC with your USB cable. Type

fastboot devices

to check if your device is connected. A serial number should be shown.

8) Run the flashallO.bat script. (Caution: This will wipe your device completely!) It will take some time to flash, just be patient and don't worry.

If the command window appears for a brief moment and then disappears, the device drivers may not be installed correctly. You can ask me in that case, there are some special drivers that may solve that.

9) Once the command window closes, it should have completed the flashing process 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".

That's it.

You can save your (internal) data when you open the flashallO.bat and delete the command

fastboot erase userdata

so that it will be omitted.

I won't recommend it but it's possible.

Rooting:

You need:

Magisk (at the moment 20.4 is actual):

https://github.com/topjohnwu/Magisk

For devices running android 11 use

Magisk 21.1 (beta): https://github.com/topjohnwu/Magisk/releases/tag/v21.1

TWRP 3.4.0:

Download twrp-3.4.0-0-potter.img

Download page for twrp-3.4.0-0-potter.img

dl.twrp.me

Maybe

Disable_Dm-Verity_ForceEncrypt.zip:

https://yadi.sk/d/HLr5vjnkA8gaqw

- Download TWRP from the above link and place it in your ADB & Fastboot folder.

- Download magisk.zip and Magisk Manager APK and place it in your internal storage.

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

- Navigate to the folder where you placed the TWRP image.

- Hold down the "shift" key and right-click anywhere in the Explorer window,it should give you an option to "Open command window here."

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

- Alternatively, you can use "fastboot boot [filename].img" to temporarily boot TWRP for the purpose of flashing Magisk. This retains the stock recovery.

- 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.

- If you decide to decrypt your device:

In that case go to "Wipe" in TWRP and use "format data" (the option where you have to confirm with "yes"). Just wipe data is not enough!

- If you want your device to stay encrypted skip that step.

- Now press the "Install' button in TWRP and navigate to the location where the magisk.zip is located. Simply tap it and "Swipe to install."

- If you decided to decrypt your device normally magisk should take care that it doesn't get encrypted again.

Magisk only disables the enforced encryption flag, the device will still be encrypted and that's why a wipe of data is necessary to remove the encryption.

If that's not the case and you get problems to reboot flash Disable_Dm-Verity_ForceEncrypt.zip after magisk.zip.

More information about decryption/encryption:

https://didgeridoohan.com/magisk/Magisk#hn_Disabling_dm-verity_and_forced_encryption

- Reboot your device, if the Magisk Manager isn't installed already (it should) install the Magisk Manager APK.

(I think I will make a tutorial out of this if users still need it)

Thanks to @Jrhotrod for the rooting tutorial and other parts!