Rooting Moto G 4g XT1039

I rooted my Moto G 4g XT1039 first generation phone and started tweaking a lot. In june 2015 the long awaited OTA update to android 5.1 came, and didn't install. The original android 4.4.4. was too much altered to be able to install the OTA update. It's a pity that the error message only tells that there 0s been an error and that nothing has been altered.

After a lot of searching on the internet I discovered that you need the following to do:

be sure that Adb and fastboot are properly installed on your system. Read all about it here (Install ADB and Fastboot in Ubuntu 14.04).

First download the proper image of android 4.4.4 for your phone. How to find the proper file look here (Stock Android 4.4.4 firmware).

Make sure that you've enabled USB debugging.

    1. Go to Settings >> About Phone and press on "Build Number" 7 times. It'll tell you when you're a "developer"

    2. Go to Settings >> Developer Options and enable USB Debugging

Then extract the zip file in a folder.

To use fastboot: Shut down your Moto G, unplug any USB cable. Hold Power and Volume down simultaneously and release power. The phone boots into fastboot mode. Now connect the USB cable to your computer.

Enter a terminal in the same folder as the extracted zip file and use the following commands ( be sure to use the newest version of fastboot.:

Here's the code (I've omitted the userdata flash so you keep your data): (Source)

Code:

fastboot flash partition gpt.bin fastboot flash motoboot motoboot.img fastboot flash logo logo.bin fastboot flash boot boot.img fastboot flash recovery recovery.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 modem NON-HLOS.bin fastboot erase modemst1 fastboot erase modemst2 fastboot flash fsg fsg.mbn fastboot erase cache fastboot reboot

After this proces you lost root, but your system is in original state with any installed program preserved.

Now check for the OTA systemupdate you 'd like to install. On my phone it all worked flawlessly.

Now you can re root if you wish but I'm not sure if any next OTA will work if you do so.

There are other ways to install android 5.1, but I have not tested these:

For your convenience (and mine) I have some links for you:

The Moto G 4g XT1039 lolypop collection installable with TWRP recovery.

This recovery doesn't need to be installed on your phone to be able to use it:

use

fastboot boot recoveryname.img

instead of

fastboot flash recoveryname.img

to use it withhout installing is.

Some information about fastboot

Recover from failed update to 4.4.4

Moto tool (windows only)

Easy root Moto G