[GUIDE] Moto G - Restore stock firmware

MartinXXL

New member
Dec 24, 2017
1
0
0
Stuck possibly because I flashed android 6.0.1 over nougat.

I am stuck in a loop between the unlock warning and the erasing robot on a XT1622
after trying to flash
XT1622-1624_ATHENE_MPJ24.139-63_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml
with
minimal_adb_fastboot_v.1.4.2
on a Moto G4 with 2 SIM slots under Nougat.

Any advice please?
 

Tiaghin

Member
Jan 30, 2018
5
0
0
Hi guys. I have o moto G XT1541 and Osprey system installed. But the system are frozen sometimes. I need downgrade for make work. I use this procedure to install the stock rom normally or other proceeding? Or have problems for installed stock rom in my system of moto G.
Thanks bro
 

Cyr4x

Senior Member
Jun 1, 2012
93
25
0
HINT:
If your bootloader is unlocked, flash every system sparsechunk greater than the first one with -u parameter. For the latest stock 5.1 it goes:
Code:
fastboot flash system system.img_sparsechunk.0
fastboot -u flash system system.img_sparsechunk.1
fastboot -u flash system system.img_sparsechunk.2
fastboot -u flash system system.img_sparsechunk.3
Otherwise fastboot will erase system partition before flashing each chunk, so you will finish with just the last one flashed and stuck at "unlock bootloader warning" screen as a result.
 
  • Like
Reactions: donmac999

Finnigan28

New member
Mar 31, 2018
1
0
0
Pre-requisites:

a) Download and install Motorola Drivers:
http://forum.xda-developers.com/showthread.php?t=2550635

b) Download and extract the stock firmware of your choosing from:
Looks like this link is now broken :'-( http://sbf.droid-developers.org/phone.php?device=14
The firmwares with '_umtsds' in the file name are for the 'dual-sim' versions of the Moto G, it's probably not a good idea to flash these onto single sim phones, or vice-versa.

Edit: More firmwares for international retail and carrier devices can be found here:
http://www.filefactory.com/folder/c6cdedc45a775d27

Edit: The firmware files have been updated most of the firmware archives are now in .tar.gz archives which include Motorola fastboot and flashing scripts for OSX, Linux and Windows.

On windows the .tar.gz archives need to be opened and extracted using a 3rd party archive manager. e.g. 7-zip, or PeaZip, Windows cannot extract these files natively, Linux and OSX can.

I used the retail British firmware (fastboot_falcon_retgb_user_4.3_14.10.0Q3.X-76-LGG-8_54_release-keys-cid7-Retail_GB.tar.gz), extracted to c:\

c) If the firmware file you downloaded is a .xml.zip file then download Motorola Fastboot View attachment 2427667 (attached to this post) and extract the .exe into the same folder as the stock firmware files (the same folder as the .bin and .img files). If your firmware is a .tar.gz file then skip this step.

d) Get ADB (if you don't already have this, I suggest downloading and installing Minimal ADB and Fastboot by shimp208:
https://drive.google.com/file/d/0B1S0LCuXCnnmOWhnUk1ZWVdQakE

Disclaimer:

Follow these instructions at your own risk. If something goes wrong don't blame me!

I have only tested this on a UK Retail Moto G with an unlocked bootloader, however as these are the original stock signed image files from Motorola it should work on all devices.

See notes at the bottom of this post for downgrading from 4.4.2 to 4.3.

Edit: tkm89 reports that he was able to use this guide to restore Stock Retail British firmware on a bootloader locked Tesco-mobile Moto G


Steps to restore stock firmware:

1) Reboot the phone into bootloader mode. There are 2 ways to do this.
I) The 'hardware' way.
a) Unplug the USB cable and power off the phone.
b) Press and hold 'Volume down' then power on the phone.
c) Connect USB cable to your computer.​

II) The 'software' way.
a) Enable developer mode on the Moto G (Settings-> 'About Phone'. Tap 7 times on 'Build Number')
b) Enable USB debugging. (Settings -> 'Developer options' -> 'USB Debugging' -> check)
c) Connect phone to computer via USB, you should see a new ADB device detected and drivers installed.
d) Open "Minimal ADB and Fastboot". Type:
Code:
adb reboot-bootloader

You should see the Moto G bootloader screen with the following options:
Code:
Normal Powerup
Recovery
Factory
Switch Console [NULL: null]
Barcodes
BP Tools
2) Open a command prompt / terminal (Start -> cmd.exe in Win7) and browse to the folder with the extracted firmware.

In my case:
Code:
cd c:\falcon_retgb_user_4.3_14.10.0Q3.X-76-LGG-8_54_release-keys-cid7-Retail_GB
3a) If you downloaded and extracted a firmware in .tar.gz format

In windows, run the 'flashall.bat' script Type:
Code:
flashall.bat /eu
The "/eu" switch forces userdata to be erased from the device, this is the same as a factory reset or wipe this is recommended when restoring stock firmware.
In Linux/OSX run the flashall.sh script. Type:
Code:
chmod +x flashall.sh
./flashall.sh
Downgrading:
The scripts will fail with an error on downgrading from 4.4.2 to 4.3. Open the script in a text editor (notepad) and delete (or comment) the following:
Lines 89-90 in the flashall.bat file:
Code:
CALL :fastboot_flash partition gpt.bin
IF %errorlevel% NEQ 0 EXIT /b 1
Lines 120-121 in the flashall.sh file:
Code:
run $fastboot -s "$serial_number" flash partition gpt.bin
if [ $? -ne 0 ]; then echo "ERROR: fastboot failed."; exit -1; fi

3b) If you downloaded and extracted a firmware in .xml.zip format.

Flash each of the partitions in sequence using mfastboot, you need to enter the following commands one-by-one checking that each one returns an [OKAY]
Code:
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
Downgrading:
The 1st command "mfastboot flash partition gpt.bin" will fail on 4.4.2 to 4.3 downgrade. Skip this command if you are downgrading and continue with the other commands, which should work.​

4) Wait, you should now be rebooted into a fully stock Moto G firmware.
Thank you, it worked great.
 

stuarto76

New member
Mar 27, 2009
2
0
0
Thanks

HINT:
If your bootloader is unlocked, flash every system sparsechunk greater than the first one with -u parameter. For the latest stock 5.1 it goes:
Code:
fastboot flash system system.img_sparsechunk.0
fastboot -u flash system system.img_sparsechunk.1
fastboot -u flash system system.img_sparsechunk.2
fastboot -u flash system system.img_sparsechunk.3
Otherwise fastboot will erase system partition before flashing each chunk, so you will finish with just the last one flashed and stuck at "unlock bootloader warning" screen as a result.
You are saviour, I've spent nearly two days trying to sort this!
 

tekweezle

Senior Member
Jun 20, 2012
747
110
0
i've got an old Moto G from Boost(I think its an XT1031) that was converted to run on Verizon(PagePlus Cellular). However, Verizon has disallowed these phones on their network now.

I want to convert it back into a Sprint/Boost compatible phone. Would this process do it? If so, which file would I need?
 
G

GuestK00425

Guest
i've got an old Moto G from Boost(I think its an XT1031) that was converted to run on Verizon(PagePlus Cellular). However, Verizon has disallowed these phones on their network now.

I want to convert it back into a Sprint/Boost compatible phone. Would this process do it? If so, which file would I need?
Hi, It will be a long process to get the unlock code from Verizon. And They need to contact Motorola to allow the code to unlock the device. Its better to root it and install a Stable OS like Euphoria and use any of the network you want.
 

tekweezle

Senior Member
Jun 20, 2012
747
110
0
This phone won't ever run on Verizon ever again. It's IMEI is not in their white list and they don't activate 3g phones without lte anymore. It's a CDMA phone. Sprint on the other hand may still do it. My goal is to activate it on Freedompop Sprint Service. I just installed LineageOS 14.1 and it's working as good as new.

However, when I did the initial conversion from Boost to Verizon, I am sure that the radios got flashed and converted to allow it to communicate on Verizon. I want to undo that.
 
Last edited:

axel9546

Member
Feb 13, 2017
10
1
0
Help me

Hello guys
Ive Tried to reset and restore my phone to stock. I tried gpe rom 5.1 and extracted on the same folder as the mfastboot.
Then execute the commands, but i get errors like "failed to validate system image" or "hab failed check system" etc etc
I get more than 5/6 errors. Then i try reboot but it reboot on recovery and system wont start. Any help? Have motog 1032
 

Sofiane omega

Senior Member
Feb 20, 2015
295
128
0
can someone help me I have an XT-1039 running LOS 14.1 I want to go back to fully stock no twrp or custom ROM a Full stock after I read this thread I start thinking that my phone might brick if I use all those files since I am not really good with Motorola phones I want to know if it is safe for me to re-flash the bootloader,radio and the other stuff
PS my phone was running Android 5.1 before I install Lineage OS 14.1
thanks for reading
 

hu3hu3br

New member
Nov 14, 2014
1
1
0
thanks

works, thank you !

moto G first generation XT1033 dual chip 8GB locked bootloader Brazil 4.4.4kitkat from tim
works with this rom XT1033_FALCON_RETBR_DS_5.1_LPBS23.13-56-2_cid12_CFC.xml.zip

just need pay very attention to flash all this files: system.img_sparsechunk.0 , 1, 2 and 3

wifi working, radio working...
 

Zuikkis

Senior Member
Nov 20, 2013
57
15
28
Hi!

I have european xt1032 which was previously running RR 6.0 (android 8.1).. For various reasons, I need to downgrade it to Lollipop or Kitkat. I figured stock rom might be a good option, but I can't make it work.

Which rom should I choose? I have tried these:

XT1032_FALCON-RETEU_5.0.2_LXB22.46-28.1_1_cid7_CFC_1FF.xml.zip

- boots, but asks for key to decrypt storage? Wtf? Also display looks slightly garbled..

fastboot_falcon_reteu_user_4.3_14.10.0Q3.X-76-LGG-11_57_release-keys-cid7-EURetail_EU.tar.gz

- Boot loops, showing just the "bootloader unlocked" warning and then reboot.

What should I flash instead? The filefactory is super slow without Premium account, it takes 2 hours to download a zip..

I don't necessarily need stock, some Lollipop custom rom might work for me as well..

Edit: Ah, "decrypt storage" thing was because my data partition was no ext4.. Now this is making more sense. :)
 
Last edited:

lbcsc.clx

Senior Member
Sep 14, 2013
75
1
0
chirala
fastboot devices command it shows 1 devices attached
then executing flashall.bat in stock ROM (.tar) for moto one Power
it shows an error
THE SYSTEM CANNOT FIND THE PATH SPECIFIED
AFTER FEW LINES
NOT FOUND ANY DEVICES CONNECTED . PLEASE CH......................
 

lbcsc.clx

Senior Member
Sep 14, 2013
75
1
0
chirala
flashall.bat error

Pre-requisites:

a) Download and install Motorola Drivers:
http://forum.xda-developers.com/showthread.php?t=2550635

b) Download and extract the stock firmware of your choosing from:
Looks like this link is now broken :'-( http://sbf.droid-developers.org/phone.php?device=14
The firmwares with '_umtsds' in the file name are for the 'dual-sim' versions of the Moto G, it's probably not a good idea to flash these onto single sim phones, or vice-versa.

Edit: More firmwares for international retail and carrier devices can be found here:
http://www.filefactory.com/folder/c6cdedc45a775d27

Edit: The firmware files have been updated most of the firmware archives are now in .tar.gz archives which include Motorola fastboot and flashing scripts for OSX, Linux and Windows.

On windows the .tar.gz archives need to be opened and extracted using a 3rd party archive manager. e.g. 7-zip, or PeaZip, Windows cannot extract these files natively, Linux and OSX can.

I used the retail British firmware (fastboot_falcon_retgb_user_4.3_14.10.0Q3.X-76-LGG-8_54_release-keys-cid7-Retail_GB.tar.gz), extracted to c:\

c) If the firmware file you downloaded is a .xml.zip file then download Motorola Fastboot View attachment 2427667 (attached to this post) and extract the .exe into the same folder as the stock firmware files (the same folder as the .bin and .img files). If your firmware is a .tar.gz file then skip this step.

d) Get ADB (if you don't already have this, I suggest downloading and installing Minimal ADB and Fastboot by shimp208:
https://drive.google.com/file/d/0B1S0LCuXCnnmOWhnUk1ZWVdQakE

Disclaimer:

Follow these instructions at your own risk. If something goes wrong don't blame me!

I have only tested this on a UK Retail Moto G with an unlocked bootloader, however as these are the original stock signed image files from Motorola it should work on all devices.

See notes at the bottom of this post for downgrading from 4.4.2 to 4.3.

Edit: tkm89 reports that he was able to use this guide to restore Stock Retail British firmware on a bootloader locked Tesco-mobile Moto G


Steps to restore stock firmware:

1) Reboot the phone into bootloader mode. There are 2 ways to do this.
I) The 'hardware' way.
a) Unplug the USB cable and power off the phone.
b) Press and hold 'Volume down' then power on the phone.
c) Connect USB cable to your computer.​

II) The 'software' way.
a) Enable developer mode on the Moto G (Settings-> 'About Phone'. Tap 7 times on 'Build Number')
b) Enable USB debugging. (Settings -> 'Developer options' -> 'USB Debugging' -> check)
c) Connect phone to computer via USB, you should see a new ADB device detected and drivers installed.
d) Open "Minimal ADB and Fastboot". Type:
Code:
adb reboot-bootloader

You should see the Moto G bootloader screen with the following options:
Code:
Normal Powerup
Recovery
Factory
Switch Console [NULL: null]
Barcodes
BP Tools
2) Open a command prompt / terminal (Start -> cmd.exe in Win7) and browse to the folder with the extracted firmware.

In my case:
Code:
cd c:\falcon_retgb_user_4.3_14.10.0Q3.X-76-LGG-8_54_release-keys-cid7-Retail_GB
3a) If you downloaded and extracted a firmware in .tar.gz format

In windows, run the 'flashall.bat' script Type:
Code:
flashall.bat /eu
The "/eu" switch forces userdata to be erased from the device, this is the same as a factory reset or wipe this is recommended when restoring stock firmware.
In Linux/OSX run the flashall.sh script. Type:
Code:
chmod +x flashall.sh
./flashall.sh
Downgrading:
The scripts will fail with an error on downgrading from 4.4.2 to 4.3. Open the script in a text editor (notepad) and delete (or comment) the following:
Lines 89-90 in the flashall.bat file:
Code:
CALL :fastboot_flash partition gpt.bin
IF %errorlevel% NEQ 0 EXIT /b 1
Lines 120-121 in the flashall.sh file:
Code:
run $fastboot -s "$serial_number" flash partition gpt.bin
if [ $? -ne 0 ]; then echo "ERROR: fastboot failed."; exit -1; fi

3b) If you downloaded and extracted a firmware in .xml.zip format.

Flash each of the partitions in sequence using mfastboot, you need to enter the following commands one-by-one checking that each one returns an [OKAY]
Code:
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
Downgrading:
The 1st command "mfastboot flash partition gpt.bin" will fail on 4.4.2 to 4.3 downgrade. Skip this command if you are downgrading and continue with the other commands, which should work.​

4) Wait, you should now be rebooted into a fully stock Moto G firmware.
fastboot devices command it shows 1 devices attached
then executing flashall.bat in stock ROM (.tar) for moto one Power
it shows an error
THE SYSTEM CANNOT FIND THE PATH SPECIFIED
AFTER FEW LINES
NOT FOUND ANY DEVICES CONNECTED . PLEASE CH......................
 

Attachments

sd_shadow

Recognized Contributor
Sep 21, 2011
16,533
7,490
253
South Dakota
goo.gl
Can you give me a flash file of Moto x5 xt1928-1 ???
This thread is for the Moto g,
Please create a thread in
https://forum.xda-developers.com/general/help
Or
https://forum.xda-developers.com/android/help

Try LMSA Flash Rescue option
https://forum.xda-developers.com/general/general/update-moto-lenovo-moto-smart-assistant-t3951714
Or use
Code:
 fastboot getvar all
https://forum.xda-developers.com/general/rooting-roms/guide-flashing-motorola-firmware-t4042039

To find the correct codename and software channel for the firmware
Product = codename
securestate = bootloader locked or unlocked
carrier_sku = Model #
ro.carrier = Software Channel
Then see
https://mirrors.lolinet.com/firmware/moto
 

Sa5891

Member
Oct 6, 2019
9
0
0
This thread is for the Moto g,
Please create a thread in
https://forum.xda-developers.com/general/help
Or
https://forum.xda-developers.com/android/help

Try LMSA Flash Rescue option
https://forum.xda-developers.com/general/general/update-moto-lenovo-moto-smart-assistant-t3951714
Or use
Code:
 fastboot getvar all
https://forum.xda-developers.com/general/rooting-roms/guide-flashing-motorola-firmware-t4042039

To find the correct codename and software channel for the firmware
Product = codename
securestate = bootloader locked or unlocked
carrier_sku = Model #
ro.carrier = Software Channel
Then see
https://mirrors.lolinet.com/firmware/moto
thanks for replying...

These are the details of my mobile ..my mobile is stuck on fastboot
Product = heart
securestate = engneering
carrier_sku = xt1928-1
ro.carrier = unknown
 
Last edited: