[GUIDE] Sucsessful OTA-Update after Rooting + other system changes

Search This thread

Bender1987

Senior Member
Sep 27, 2014
137
137
Many of you have trouble to install the last OTA-Update (SP 1.July) on their rooted devices.
Here is a quick guide to successfully install the OTA-Update without losing any of your data, only all changes you made to the system are restored to stock.
There is no need to relock your bootloader.

The reason the OTA-Update fails, is that one of the /boot, /system, /logo or /recovery partitions are changed.
For example the /recovery if you flashed it permanently or the /boot partition for rooting. Also the /system partition when you remove same build-in apps or install xposed and do not reverse the changes.
To restore the partitions you have to flash the stock ROM Images of the partitions.
That's all you have to do!

Most of you have the problem that they can't find the right stock ROM with the correct build-no. (or don't have access to the FileFactory folder).

In desperation you just download any stock ROM that contain "XT16xx" and flash it, without any idea what you are doing.
And that is the reason your phones lost the IMEI no.

There is also another problem with changing /system or /boot after the OTA-Update, because usually Motorola don't release a stock ROM image which include the OTA-Update when the next OTA-Update should be a major update to the next Android Version (6.0.1 -> 7.0). So when you make some changes to /system or /boot (rooting) after the OTA-Update you have no stock ROM image files of the current build-no and you have to flash the hole stock ROM image and erase all your data and take then two OTA-Updates (6.0 -> 6.0.1 -> 7.0) to get Android 7.0.
This is the reason you should make a TWRP backup of /system and /boot to restore it and then take the next OTA-Update, maybe to Android 7.0.

[GUIDE]

ONLY FOLLOW THIS GUIDE IF YOU HAVE THE CORRECT STOCK ROM IMAGE !!!
STOCK ROM IMAGE FILE NAME MUST CONTAIN YOUR CURRENT BUILD-NO AND SKU (e.g. XT162) OF THE PHONE !!!

I am not responsible for any damage or failure on your smartphone.


Requirements:
Correct Stock ROM Image for your phone -> FileFactory Moto G
Minimal ADB & Fastboot
Motorola Drivers
TWRP - Custom Recovery


1a. If you get the OTA-Update notification
If you are rooted and the OTA-Update notification pops up, download the update and hit the "later" button. Go with your fav. Filebrowser to:
Code:
/data/data/com.motorola.ccc.ota/app_download
and copy the OTA-Update "Blur_Version.2....." file to your SD-Card.
Go to 2. ↓


1b. If you don't get the OTA-Update notification because you already try to install it and get "error 7"
First option is to wait and drink some cups of tea till the notification popup again and try 1a. ↑
Second option is to go to 2. ↓, but then you have no root access till the notification popup up again.


2. Restore the stock ROM images
Extract only the boot.img, logo.bin, recovery.img, system.img_sparsechunk.0 to .7 files to the MADB&FB folder.
Connect your phone to your PC and open MADB&FB, check the connection with:
Code:
adb devices
return should include your "serial-no" and "device".

Reboot into bootloader with:
Code:
adb reboot-bootloader
and check again with:
Code:
fastboot devices
return should be "serial-no" and "fastboot".

Flash the partitions with:
Code:
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 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
After every command should be a return with "OKAY".

Reboot your Phone with:
Code:
fastboot reboot

After reboot all your data is still there and you can sideload the OTA-Update, if the OTA-Update notification has not already appeared.


3. Sideload from SD-Card
Reboot into recovery:
Code:
adb reboot recovery
After few seconds the dead "Android" should appear with "No command."
HOLD "Power" and then HOLD "VOLUME UP" for 2-1 seconds and release. Now you are in "Android Recovery".
Select "Apply update from SD card" and choose your "Blur_Version.2..." file.
After 20-30 min you get "success" message and select "Reboot system now".

4. Make a backup of /system, /boot, /recovery and /logo
Before you can make some further changes on your /system, /boot, /recovery and /logo, you should backup these partitions for the next OTA-Update.
Follow all steps in the Guide to root systemless -> [ROOT][GUIDE] Systemless Rooting with SuperSU 2.78 , which include the TWRP backup (/system and /boot).
Then come back here and install on your rooted phone -> Partitions Backup & Restore.
Select "LOGO" and "RECOVERY" and change Settings to "Raw partitions image (img)" and save it on your SD-Card.

Now you have all partitions as a backup for the next OTA-Update. So when the next update is coming, you have to flash /logo and /recovery and then restore your TWRP backup and you are able to install the update without issues.

Have Fun and don't pay attention to my writing errors :)
 
Last edited:

pastorbob62

Senior Member
Mar 29, 2013
1,489
560
Springfield
Many of you have trouble to install the last OTA-Update (SP 1.July) on their rooted devices.
Here is a quick guide to successfully install the OTA-Update without losing any of your data, only all changes you made to the system are restored to stock.
You can root your phone again with this GUIDE after the update -> http://forum.xda-developers.com/moto-g4-plus/how-to/root-systemless-rooting-supersu-2-74-2-t3405772
There is no need to relock your bootloader.

I used this procedure a couple of days ago and it worked flawlessly. When I rebooted after flashing all of the stock files, my OTA update notification was there waiting for me to select "Install". I did and it installed without issues.

What is surprising to me is how many people try it with the wrong firmware and then are surprised when they screw up their phones.
 
Last edited:

foxdog66

Senior Member
Jul 28, 2010
471
53
I was so close!!! lol, didn't realize they checked /logo for modifications. Was about to completely wipe everything to get the update to apply. Glad I checked xda before doing so as all I was missing was flashing stock logo.img (restoring system, recovery and boot I had already tried). Thanks Bender1987 for the easy guide.

I have the 64GIG 4G plus (XT-1644)
 
  • Like
Reactions: Bender1987

pblasi

Senior Member
Sep 16, 2011
349
128
Hi @Bender1987,
Thank you for your guides, they are very helpful. I've already unlocked, rooted without flashing twrp, uninstalled some system apps and flashed xposed using Flashfire on my xt1642, and eveything is running fine so far. So, when an OTA update is available (hopefully nougat!) will I receive the notification? Or does the rooting stop even OTA notifications? Thanks!
 

Bender1987

Senior Member
Sep 27, 2014
137
137
@pblasi
You already received the OTA-Update with SP 1.July? If yes, i think the next OTA-Update should be Android 7.0.
 

Bender1987

Senior Member
Sep 27, 2014
137
137
@pblasi
the current build-no is MPJ24.139-63 with Security Patch 1.July.

I add "TWRP backup" which is very important for the next OTA-Update, maybe Android 7.0.
 

pblasi

Senior Member
Sep 16, 2011
349
128
@pblasi
the current build-no is MPJ24.139-63 with Security Patch 1.July.

I add "TWRP backup" which is very important for the next OTA-Update, maybe Android 7.0.

Well, I spent 2 days without touching the phone before unlocking/rooting and didn't receive this ota-update. Maybe it is not available for my version (32gb, 3gb ram, xt1642)...

If I didn't flash twrp, I guess I won't need to restore it, right? Anyway, I made the full backup following your instructions. In which partition is stock twrp included? Boot? Thanks.
 

Bender1987

Senior Member
Sep 27, 2014
137
137
Backup with TWRP only cover system, boot, cache and data partition, that means I have to add some steps to get a backup from logo and recovery -_-

Maybe tomorrow.
 
  • Like
Reactions: pblasi

pblasi

Senior Member
Sep 16, 2011
349
128
Backup with TWRP only cover system, boot, cache and data partition, that means I have to add some steps to get a backup from logo and recovery -_-
Maybe tomorrow.

Let me know if I understood it right. I made a TWRP backup of untouched boot, system and data, rooted and installed xposed without flashing TWRP and without changing logo.bin. Then I should be able to install next OTA update if I previously restore my copies of boot and system in TWRP. Right? No need to flash stock images in this case? Thanks!
 
  • Like
Reactions: manasn

mason2smart

Senior Member
Aug 24, 2016
72
6
Xt1644 not play nice with adb nor does it go into recovery it just reboots when I hold the buttons...or it stays on no command
 

SoNic67

Senior Member
Apr 10, 2011
1,064
201
When I flash the files, for the boot and recovery I get a warning that the "image not signed or corrupt". Eventually it is written... but is that normal?
mfastboot flash recovery recovery.img
sending 'recovery' (16484 KB)...
OKAY [ 0.531s]
writing 'recovery'...
Image not signed or corrupt
OKAY [ 0.153s]
finished. total time: 0.684s
 
Last edited:

SoNic67

Senior Member
Apr 10, 2011
1,064
201
Hmm, it was DL from the usual place, but true, I am not 100% sure about it. However, it "works" but I don't get the OTA.
I am DL now the newer full FW.
LE: That latest full FW worked. I had to reinstall all my apps from backup but...
 
Last edited:

Amit_timA

Senior Member
Jun 23, 2013
181
74
Mumbai
@Bender1987 I have a TWRP backup of unmodified Stock ROM XT1643, so now to install OTA do I just have to flash the nandroid backup & then flash stock recovery to get ota updates? If so then how can I go about flashing stock recovery. Thanks in advance mate
 

Bender1987

Senior Member
Sep 27, 2014
137
137
@Amit_timA
TWRP only backup /system and /boot, to restore recovery you must flash it from a stock rom image. If all partitions are stock after restoring you can get the OTA-Update.
 
Last edited:
  • Like
Reactions: Amit_timA

Top Liked Posts

  • There are no posts matching your filters.
  • 26
    Many of you have trouble to install the last OTA-Update (SP 1.July) on their rooted devices.
    Here is a quick guide to successfully install the OTA-Update without losing any of your data, only all changes you made to the system are restored to stock.
    There is no need to relock your bootloader.

    The reason the OTA-Update fails, is that one of the /boot, /system, /logo or /recovery partitions are changed.
    For example the /recovery if you flashed it permanently or the /boot partition for rooting. Also the /system partition when you remove same build-in apps or install xposed and do not reverse the changes.
    To restore the partitions you have to flash the stock ROM Images of the partitions.
    That's all you have to do!

    Most of you have the problem that they can't find the right stock ROM with the correct build-no. (or don't have access to the FileFactory folder).

    In desperation you just download any stock ROM that contain "XT16xx" and flash it, without any idea what you are doing.
    And that is the reason your phones lost the IMEI no.

    There is also another problem with changing /system or /boot after the OTA-Update, because usually Motorola don't release a stock ROM image which include the OTA-Update when the next OTA-Update should be a major update to the next Android Version (6.0.1 -> 7.0). So when you make some changes to /system or /boot (rooting) after the OTA-Update you have no stock ROM image files of the current build-no and you have to flash the hole stock ROM image and erase all your data and take then two OTA-Updates (6.0 -> 6.0.1 -> 7.0) to get Android 7.0.
    This is the reason you should make a TWRP backup of /system and /boot to restore it and then take the next OTA-Update, maybe to Android 7.0.

    [GUIDE]

    ONLY FOLLOW THIS GUIDE IF YOU HAVE THE CORRECT STOCK ROM IMAGE !!!
    STOCK ROM IMAGE FILE NAME MUST CONTAIN YOUR CURRENT BUILD-NO AND SKU (e.g. XT162) OF THE PHONE !!!

    I am not responsible for any damage or failure on your smartphone.


    Requirements:
    Correct Stock ROM Image for your phone -> FileFactory Moto G
    Minimal ADB & Fastboot
    Motorola Drivers
    TWRP - Custom Recovery


    1a. If you get the OTA-Update notification
    If you are rooted and the OTA-Update notification pops up, download the update and hit the "later" button. Go with your fav. Filebrowser to:
    Code:
    /data/data/com.motorola.ccc.ota/app_download
    and copy the OTA-Update "Blur_Version.2....." file to your SD-Card.
    Go to 2. ↓


    1b. If you don't get the OTA-Update notification because you already try to install it and get "error 7"
    First option is to wait and drink some cups of tea till the notification popup again and try 1a. ↑
    Second option is to go to 2. ↓, but then you have no root access till the notification popup up again.


    2. Restore the stock ROM images
    Extract only the boot.img, logo.bin, recovery.img, system.img_sparsechunk.0 to .7 files to the MADB&FB folder.
    Connect your phone to your PC and open MADB&FB, check the connection with:
    Code:
    adb devices
    return should include your "serial-no" and "device".

    Reboot into bootloader with:
    Code:
    adb reboot-bootloader
    and check again with:
    Code:
    fastboot devices
    return should be "serial-no" and "fastboot".

    Flash the partitions with:
    Code:
    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 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
    After every command should be a return with "OKAY".

    Reboot your Phone with:
    Code:
    fastboot reboot

    After reboot all your data is still there and you can sideload the OTA-Update, if the OTA-Update notification has not already appeared.


    3. Sideload from SD-Card
    Reboot into recovery:
    Code:
    adb reboot recovery
    After few seconds the dead "Android" should appear with "No command."
    HOLD "Power" and then HOLD "VOLUME UP" for 2-1 seconds and release. Now you are in "Android Recovery".
    Select "Apply update from SD card" and choose your "Blur_Version.2..." file.
    After 20-30 min you get "success" message and select "Reboot system now".

    4. Make a backup of /system, /boot, /recovery and /logo
    Before you can make some further changes on your /system, /boot, /recovery and /logo, you should backup these partitions for the next OTA-Update.
    Follow all steps in the Guide to root systemless -> [ROOT][GUIDE] Systemless Rooting with SuperSU 2.78 , which include the TWRP backup (/system and /boot).
    Then come back here and install on your rooted phone -> Partitions Backup & Restore.
    Select "LOGO" and "RECOVERY" and change Settings to "Raw partitions image (img)" and save it on your SD-Card.

    Now you have all partitions as a backup for the next OTA-Update. So when the next update is coming, you have to flash /logo and /recovery and then restore your TWRP backup and you are able to install the update without issues.

    Have Fun and don't pay attention to my writing errors :)
    2
    Probably as I have a modified recovery, installed TWRP. That created problems with OTA.
    SO if I get this correct.
    DO the backup with TWRP now.
    Do the flash.oem bat from within MADFB with loaded files. That will wipe and install the NPJ25-93 (7.1.1) android update..............Does that also wipe the SD, if so I would have to save the TWRP backp to PC
    Then re-root and restore Only data with TWP?????????
    I did not get there were 2 different threads being referred to .
    \Many thanks for the clarification.

    It shouldn't wipe the SD but just to be safe I always do my backup then switch to a different SD Card until everything is flashed and I am back up running. That saves having to copy to the PC. I would also do a Titanium backup to the SD Card before flashing. You will also have to reinstall TWRP after flashing the stock ROM.
    2
    2. Restore the stock ROM images
    Extract only the boot.img, logo.img. recovery.img,

    Bender, maybe change OP to have logo.bin instead of logo.img? Thanks for a great guide, going through it now... I'm stuck all the way back on build48 so missed the last couple of OTA updates.

    Update: worked flawlessly, followed your detailed instructions, now have build 64, restored root, and have necessary backups to undo all this for the Nougat OTA update (whenever that comes...). All thanks to Bender, appreciate all your help in this community!
    1
    I was so close!!! lol, didn't realize they checked /logo for modifications. Was about to completely wipe everything to get the update to apply. Glad I checked xda before doing so as all I was missing was flashing stock logo.img (restoring system, recovery and boot I had already tried). Thanks Bender1987 for the easy guide.

    I have the 64GIG 4G plus (XT-1644)
    1
    If the bootloader exhibits this behavior (blocking an older bootloader), it seems like some 3rd party software should be able to flash the old bootloader along with the down-rev ROM images while the phone is still rooted. Upon boot, everything would be safely restored to the desired and un-rooted downgraded level.



    My thinking was the bootloader plays a role in updates and blocks older bootloaders so perhaps it might have a similar problem with update attempts that are not step-wise.


    Again, it seemed to me that this upgrade situation is the same as when downgrading with a full flash of a down-rev ROM. In both cases the bootloader image is compatible with the full copy image set, but I now understand the difference is the bootloader will permit flashing a newer bootloader in the upgrade case, but not the older bootloader in the downgrade case.



    That's what I thought and I had no trouble when following the guide of the OP without un-rooting. Thanks for answering all my other questions too!

    In theory, you could dd the partitions pertaining to a bootloader in TWRP/root. However, you'd need a trusted copy of the dd partitions, as any modifications could hard brick your device if you were to interfere with the security chain between the bootloader and the upstream bootloader. I also don't see the benefit of attempting to downgrade with 3rd party tools in this manner, as how could you verify that the tool is safe, and not compromising the bootloader in some way? I thought this whole exercise was to maintain the chain of security, not try to break it.

    This paper shows here that in the past the bootloader could be compromised https://www.usenix.org/system/files/conference/woot17/woot17-paper-hay.pdf and in theory you could get root (though the hole has been patched in B1:06 and above bootloaders if I recall), as well as downgrading your bootloader. However, malicious actors could also use this to compromise your device too...