In this guide, we show you how to install stock firmware on Moto G5 XT1677 (code-named Cedric). This will help you fix a bootloop issue (for example, stuck at boot logo after flashing a wrong ROM) and unroot a rooted phone. Though, this procedure requires some technical knowhow, anyone can try it, if your Moto G5 is bricked.
The below tutorial requires knowledge on ADB, Fastboot, and how to issue fastboot commands. If you have followed the guide carefully, you can unroot or restore stock firmware on your Moto G5. Prerequisites: – The below given file is for Moto G5 XT1677 (Cedric) variant only. Do not install it on other Moto G5 variants. – Download and install Motorola USB Drivers on your computer (download) – ADB and Fastboot setup on your computer (guide) – Enable USB Debugging. To do so, go to Settings -> About and tap Build version 7 times. It will unlock the Developer options. Then, go to Settings -> Developer options and enable USB Debugging.
How to download and install official Firmware on Moto G5
- Download firmware for Moto G5 XT1677 (Cedric) from here (XT1677_CEDRIC_NPP25.137-15/ XT1677_CEDRIC_NPP25.137-33)
- Extract the downloaded firmware zip file and save all the contents into the ADB installation folder.
- Reboot your Moto G5 into the Bootloader mode (Turn off your phone and then press and hold the Volume Down & Power buttons simultaneously for a few seconds)
- Connect your phone to your PC via USB cable.
- Now, launch a command window from inside the ADB folder (where the firmware files are saved). To do so, click shift key, right click and select open command window here option).
- In the command window, issue the following commands one by one: fastboot oem fb_mode_set fastboot flash partition gpt.bin fastboot flash bootloader bootloader.img fastboot flash logo logo.bin fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash dsp adspso.bin fastboot flash oem oem.img fastboot flash system system.img_sparsechunk.0 fastboot flash system system.img_sparsechunk.1 fastboot flash system system.img_sparsechunk.2 fastboot flash system system.img_sparsechunk.3 fastboot flash system system.img_sparsechunk.4 fastboot flash modem NON-HLOS.bin fastboot erase modemst1 fastboot erase modemst2 fastboot flash fsg fsg.mbn fastboot erase cache fastboot erase userdata fastboot erase customize fastboot erase clogo fastboot oem fb_mode_clear fastboot reboot
- The last command will reboot your device. Troubleshooting: If your phone stuck at boot loop or unable to boot, turn off the device, go to Bootloader mode, launch command window and issue below commands: fastboot erase cache fastboot erase userdata fastboot reboot It will reboot your phone and you will have the stock firmware back on your phone. Any question? Leave it in the comment section below (source)