Today I would like to make an article that helps those who want to restore the official firmware (Stock) of their Motorola Moto G. The steps that follow are taken from a post on blog XDA where they are masters in these subjects, I have made the translation and added some personal comments about what was my experience.
Why would you want to go back to Android Stock?
Well the truth, I don’t know, basically it could be that you were using a ROM and you got tired of it or it started giving you problems. In my case I had a stock ROM and what happened to me was that the cell phone in the last update to Android 4.4.4 got an error during it and apparently the operating system was corrupted because when I wanted to restart it, it no longer started. So my only way out was to flash a stock ROM. Well said the above, let’s get to work with what we should do, I have also created a video to make it easier to understand, but if you like the detailed steps you can continue reading later:
Previous steps
- This guide applies if you currently have your computer on an Android KitKat edition, if you currently have Lollipop, downgrading is a bit different and I am going to publish a specific guide for it.
- Have your Moto G with the bootLoader unlocked. Apparently it is not entirely necessary, but I think it is the most recommended.
- You must have the USB drivers installed for your Moto G. I recommend that the computer you use, if it is Windows, has Windows 7 onwards, getting Windows XP to recognize the Moto G is a nightmare. It is best to install the Motorola Device Manager which can be obtained from the official Motorola site.
- Download a stock ROM according to your operator and Moto G model. There are 2 sites where they can be downloaded. Here it is very important to recognize which is the correct ROM according to your Moto G. I had to make a false attempt before downloading the one that was suitable for me.
Site 1
Site 2
You must bear in mind that if the ROM you download comes with the .TAR.GZ extension, you will have to do a different procedure than the ROMs that come with the .ZIP format
- Install the Android SDK for PC (which is quite heavy) or the lite version that only brings what we need for this process and is very light (download Minimal ADB).
- Activate USB debugging mode on your Moto G (only if you haven’t done it before) before turning it off and starting flashing.
- Make a backup of all your things as the process may involve the formatting of user data.
- Prepare for something to go wrong, these procedures are performed at your own risk, so no one guarantees success. I had to do it 2 times before it worked for me because I downloaded the wrong ROM the first time. Needless to say, you do this at your own risk.
Process
- Unzip the stock ROM that you downloaded into a folder on your PC (preferably a subfolder in the root of drive C). You should consider that ROMs that come in .TAR.GZ format can be decompressed with software such as 7-ZIP.
- If your ROM comes in .TAR.GZ format download the mFastboot-v2 that comes in this link and unzip it in the same folder that you used in the previous step. If your ROM came in .ZIP format this step is not necessary.
- Restart the Moto G in FastBoot mode. To do this, the easiest thing is to turn it off, and then while it is off, press the power button and the volume down for 3 seconds and then release. Also if you have trouble doing it you can use the ADB to pass a restart instruction through Windows.
adb reboot-bootloader
You should arrive by any of the 2 ways to a menu on your cell phone that looks like this:
Normal Powerup Recovery Factory Switch Console [NULL: null] Barcodes BP Tools
- Either with Minimal ADB or with the Android SDK, open a command window (start – run – cmd.exe) and go to the folder where you unzipped the ROM.
From here the procedure opens in 2 depending on whether your ROM arrived in .TAR.GZ or in .ZIP
ROM in .TAR.GZ format
In the command window enter the following instruction, the command “/ eu” is to request the deletion of user data
flashall.bat /eu
Adjustment: If you are doing a Downgrade, that is, going to a lower version of android than the one you already have, you must first adjust 2 files before doing this step or else it will generate an error.
Open the file flashall.bat with a notepat and delete lines 89 and 90, that is, the following
CALL :fastboot_flash partition gpt.bin
IF %errorlevel% NEQ 0 EXIT /b 1
Then open the file flashall.sh with notepad and delete lines 120 and 121, that is, the following
run $fastboot -s "$serial_number" flash partition gpt.bin
if [ $? -ne 0 ]; then echo "ERROR: fastboot failed."; exit -1; fi
Ready. Hopefully your computer will restart after running the entire script with a new stock Android.
ROM in .ZIP format
Enter the folder where you unzipped the ROM with the command window, and start entering the following commands one by one, waiting for the OK confirmation after each one of them. At the end of the cell phone it will restart Android Stock.
mfastboot flash partition gpt.bin
mfastboot flash motoboot motoboot.img
mfastboot flash logo logo.bin
mfastboot flash boot boot.img
mfastboot flash recovery recovery.img
mfastboot flash system system.img_sparsechunk1
mfastboot flash system system.img_sparsechunk2
mfastboot flash system system.img_sparsechunk3
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1
mfastboot erase modemst2
mfastboot flash fsg fsg.mbn
mfastboot erase cache
mfastboot erase userdata
mfastboot reboot
NOTES:
- The first meal may fail you if you are downgrading, in that case you skip it and continue with the others.
- The 3 commands “mfastboot flash system system.img_sparsechunk” are numbered from 1 to 3, but in some ROMs they go from 0 to 2, so check the files of your ROM in the folder and if it is the case adjust the numbers in the commands .
- The coming “mfastboot erase userdata” if you get an error, try changing the USB port on your computer. It worked for me to change it. It has also been reported that USB 3.0 ports give problems.
Have ROOT access
It is possible that after having your Moto G in the Stock ROM you want to obtain ROOT access, the following guide explains how to achieve it.
Read also: