How to revert Moto G5 XT1670 to stock rom

He.Art

Member
Jun 17, 2016
22
16
0
www.facebook.com
Hello, how are you? My Name Is Cristian and I'm from Argentina.
I've had a Moto G5 for a while and a lot of custom roms were installed on it. However, there were many problems in the process. The roms had bugs, performance issues, and some didn't even boot.
So i made the decision to go back to the factory rom and close the bootloader forever. But it couldn't. Something prevented it. Something was causing the phone to not start properly.
Therefore, after doing so many laps, i was able to do the whole process.
And today i publish this topic so that you can do it too. I hope you can come out triumphant in the process just like me. Have lucky! :)

1) The first thing you should do is download Rescue & Smart assistant. Install on your pc and create account (if you not) or login in.
Code:
https://support.lenovo.com/es/es/downloads/DS101291
2) You will need to find the official firmware of your device. Search for the exact device SKU (model of your phone) and exact region. For example the SKU of my device is XT1670 the region is RETAR (from Argentina). If you are from United States (and try to install RETAR) Rescue & Smart assistant will not recognize the SKU of your device, and will not be able to continue.
Find the exact firmware corresponding to your mobile phone.
Code:
https://mirrors.lolinet.com/firmware/moto/cedric/official/
Unzip the rom in the place that you prefer.

3) Now put your device in bootloader mode and execute the following commands (ignoring any errors in the process)
Code:
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 system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot erase cache
fastboot erase userdata
fastboot reboot
4) Once the above process is finished, start your phone normally. Go to the developer options and activate usb debugging. Plug the phone into PC.
Open "Rescue & Smart assistant" and accept usb debugging on your phone. The app installs some control app, dont worry.
Go to Rescue & Smart assistant and select "Rescue". The program will recognize your phone's SKU if you downloaded the correct firmware. Otherwise, if a wrong sign appears, you will have to repeat step 2 and 3 with the correct firmware.
Click on "Rescue now" and the program will download the firmware corresponding to your phone. After this, the firmware installation will begin.
Why do all this process?
The Rescue & Smart app is official from Motorola. When the official firmware is installed, the signed firmware files are also installed with it. The firmware is official because is delivered directly by Motorola, specifically for your mobile phone, and not by unofficial sites.

5) Hey, wait! the bootloader needs to be blocked. True.
Go to C:\ProgramData\LMSA\Download\RomFiles and you will find there the official rom downloaded by "Rescue & Smart". This rom is unique, signed and official. Only for your phone, only for its hardware. Do not lose it. It will save your ass from many inconveniences, if one day you want to continue experimenting with your phone.
Copy the whole directory in other site and open cmd in it. Now shutdown your phone and start it in bootloader mode.
Now put these commands (ignoring bla bla bla errors):
Code:
fastboot oem lock
fastboot oem lock
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 boot boot.img
fastboot oem lock
And that's it. Your mobile phone is now official and with its bootloader locked. almost factory-made.

So thank you for reading all this and I hope the information has served you a lot. Any questions about it (about this) do not hesitate to consult.
 

He.Art

Member
Jun 17, 2016
22
16
0
www.facebook.com
Great post and thanks for taking the time to post it :good:

For people who might struggle with this I've used Moto Auto Flash Tool v8.2 By Jamesjerss.rar with great success,


https://www.ytechb.com/moto-auto-flash-tool/

Takes a lot of the hard work out of it :good:
The reason i made this post was mainly because a lot of people have problems with unsigned firmware and cannot follow normal recovery processes. However, I will consider this application for future experiments. It seems to be an application that already has the commands prepared, so there are no errors. The problem is that it does not offer the official firmware (from Motorola) directly for the specific device. Anyway it is good not to make mistakes in the commands.
Ty.
 

R1ffR4ff

Senior Member
May 31, 2015
156
26
48
The reason i made this post was mainly because a lot of people have problems with unsigned firmware and cannot follow normal recovery processes. However, I will consider this application for future experiments. It seems to be an application that already has the commands prepared, so there are no errors. The problem is that it does not offer the official firmware (from Motorola) directly for the specific device. Anyway it is good not to make mistakes in the commands.
Ty.
It's a great little program that I had to use Yesterday on a Moto G3 as the normal ADB way as per your post wouldn't work for whatever reason and I've used ADB loads :(

I was my own fault on that phone as I,"Soft Bricked" it using the latest version Magisk uninstall option so NEVER use this option in Magisk. I returned the phone to Stock and then upgraded it to my favourite Custom roms :)