apply OTA to rooted phone? - Moto G4 Play Questions & Answers

i have an unlocked rooted but otherwise stock G4P and it has an OTA but fails to install. Is there a full ROM I can apply which won't wipe? Or some other way which is not involving a full wipe?

nigelhealy said:
i have an unlocked rooted but otherwise stock G4P and it has an OTA but fails to install. Is there a full ROM I can apply which won't wipe? Or some other way which is not involving a full wipe?
Click to expand...
Click to collapse
I tried, failed, and eventually gave up. I haven't had the motivation to do a full wipe/flash, but I tried everything else I could think of before giving up.

hp420 said:
I tried, failed, and eventually gave up. I haven't had the motivation to do a full wipe/flash, but I tried everything else I could think of before giving up.
Click to expand...
Click to collapse
Did you tryied reinstall the full stock rom & recovery (through Fastboot) without wipe?

rafaelrgi said:
Did you tryied reinstall the full stock rom & recovery (through Fastboot) without wipe?
Click to expand...
Click to collapse
I had a twrp backup of my system partition, which I restored, then fastboot flashed the stock kernel, and wiped caches. Safetynet passed, but the ota would not flash. It said there was an unexpected change in the system, or something to that affect.
I'm not aware of any true, untouched flashable rom zip available. I suppose it wouldn't take long to make one, I just didn't have one available to me.

hp420 said:
I had a twrp backup of my system partition, which I restored, then fastboot flashed the stock kernel, and wiped caches. Safetynet passed, but the ota would not flash. It said there was an unexpected change in the system, or something to that affect.
I'm not aware of any true, untouched flashable rom zip available. I suppose it wouldn't take long to make one, I just didn't have one available to me.
Click to expand...
Click to collapse
To install the OTA update the stock recovery is required, and Twrp is a custom recovery.... after restore the backup you should reinstall the stock recovery before apply the OTA.

rafaelrgi said:
To install the OTA update the stock recovery is required, and Twrp is a custom recovery.... after restore the backup you should reinstall the stock recovery before apply the OTA.
Click to expand...
Click to collapse
sorry, didn't see you were asking about fastboot. no, I didn't flash the factory image. I didn't want to go that far and didn't really care enough to do a full wipe

Have you tried Magisk? Could potentially work

hp420 said:
I had a twrp backup of my system partition, which I restored, then fastboot flashed the stock kernel, and wiped caches. Safetynet passed, but the ota would not flash. It said there was an unexpected change in the system, or something to that affect.
I'm not aware of any true, untouched flashable rom zip available. I suppose it wouldn't take long to make one, I just didn't have one available to me.
Click to expand...
Click to collapse
A TWRP backup restore doesn't fix the issue. You have to reflash SYSTEM , BOOT(if modified), RECOVERY(if modified), and OEM through fastboot. That is a "block flash," instead of TWRP, which is "file based restore."

apply OTA to rooted phone
Could someone please give me this zip ota moto g4 play I need this file since I thank you.

VR25 said:
A TWRP backup restore doesn't fix the issue. You have to reflash SYSTEM , BOOT(if modified), RECOVERY(if modified), and OEM through fastboot. That is a "block flash," instead of TWRP, which is "file based restore."
Click to expand...
Click to collapse
What about other partitions :
gpt, bootloader, adspso, modem
Must they be restored ?
Just after OTA, is it possible to make a raw image backup with TWRP in R/O mode ?

hamelg said:
What about other partitions :
gpt, bootloader, adspso, modem
Must they be restored ?
Just after OTA, is it possible to make a raw image backup with TWRP in R/O mode ?
Click to expand...
Click to collapse
You only need to restore SYSTEM, OEM, BOOT AND RECOVERY images. That's all you'll ever need. NEVER touch other partitions, unless you are upgrading.
To make RAW image backups of SYSTEM and OEM partitions, use terminal in TWRP
Or "adb shell" from your computer (running as root)
adb shell
ls -al /dev/block/platform/soc/7824900.sdhci/by-name
This command will give you the names of the SYSTEM and OEM partitions of your device, Moto G4 Plus. For example, for Moto Z Play (my device), they are mmcblk0p53 and mmcblk0p51 respectively.
So, the commands would be (again, that's an example for MOTO Z PLAY):
Backup
dd if=/dev/block/mmcblk0p53 of=/sdcard/system.img
dd if=/dev/block/mmcblk0p51 of=/sdcard/oem.img
Restore
dd if=/sdcard/system.img of=/dev/block/mmcblk0p53
dd if=/sdcard/oem.img of=/dev/block/mmcblk0p51

Thanks much VR25.
With your help, I have successfully applied the latest OTA

hamelg said:
Thanks much VR25.
With your help, I have successfully applied the latest OTA
Click to expand...
Click to collapse
Confused. The VR25 guidance is when you had taken a full backup when stock, how to restore back to stock to then apply the OTA. You are describing how to apply the OTA on a rooted device without a pre-rooted backup?

You don't need backups to apply the latest OTA.
Get the stock corresponding to your device.
flash LOGO, SYSTEM, OEM, BOOT AND RECOVERY images.
Apply November OTA
Apply February OTA
I did that without wiping my data.
If you want to avoid reset to stock & apply all OTAs, you must have a binary backup of system partition, not a file based backup (see comment #8).
I asked about this issue here :
https://forum.xda-developers.com/showpost.php?p=72029402&postcount=55

hamelg said:
You don't need backups to apply the latest OTA.
Get the stock corresponding to your device.
flash LOGO, SYSTEM, OEM, BOOT AND RECOVERY images.
Apply November OTA
Apply February OTA
I did that without wiping my data.
If you want to avoid reset to stock & apply all OTAs, you must have a binary backup of system partition, not a file based backup (see comment #8).
I asked about this issue here :
https://forum.xda-developers.com/showpost.php?p=72029402&postcount=55
Click to expand...
Click to collapse
Where is the stock for my device
Where is the OTA for my device
My device is the USA unlocked G4P XT1607

nigelhealy said:
Where is the stock for my device
Where is the OTA for my device
My device is the USA unlocked G4P XT1607
Click to expand...
Click to collapse
Exactly this question, but then the XT1602. Flashed the stock parts, but no message of an OTA and they are nowhere to be found. Or does anyone have latest stock version full ROM?

TheEvilVirus said:
Exactly this question, but then the XT1602. Flashed the stock parts, but no message of an OTA and they are nowhere to be found. Or does anyone have latest stock version full ROM?
Click to expand...
Click to collapse
Yeah, others were just saying too high a level to not actually helpful. As I did this last week I'll tell you now is as step by step as I can to actually try to be helpful.
Firstly you need to know you will wipe data, there's no avoiding it, that I could find so backup everything, that can be a mix of TWRP backup of data to SDCARD external, USB OTG, or Titanium backup to online / SD / OTG. In my case I prefer to simply install everything and configure everything from scratch.
Follow this guide to return to stock.
In my case I'm on Ubuntu Linux desktop, fastboot got a "no permissions" type message so I had to sudo in front.
The stock for your device, well look at your device Status page now before you start, Settings -> About Phone -> it says Software Channel "retus" so when I go to the list of ROMs in the above guide go to mirrors.lolinet.com - firmware - moto - harpia - official - then I went to Retus, you'd go to a different one probably.
Note these are old stock ROMs I think from September so there have been one or two updates since then.
Follow the step by step guide, basically lots of fastboot commands.
The step where it says fastboot oem lock it bawks and say fastboot oem lock begin and that will do another wipe, so given a later fastboot oem unlock would do a 3rd wipe I didn't do the oem lock, I left mine unlocked and that worked fine.
Let it boot, setup, you will then be in an old stock ROM, then if it doesn't offer to do an update, go into Settings, System Updates, and trigger it to look. It will then download and apply a stock OTA ontop of the stock ROM. In my case it was 1 OTA, 1 update, then that that complete. You then are on stock current ROMs.
Then root and whatever you want.
But note, to get to the impending N OTA, you'll probably have to right back to the top here because your rooted Moto G4 Play will likely refuse the future OTA as the system is modified, so you'd have to repeat, return to an old stock ROM and then let it go through the 1 or 2 or 3 OTAs to get to that future release.
Hence you'd be doing the return to stock twice.
If the mirrors could be updated to newer stocks it would bypass the OTA. My other phone - the OnePlus3T they offer mirrors of full ROMs, they are far easier to use because if you are rooted you download the full ROM not just the delta incremental of the change of the OTA, and then you can flash in recovery the full ROM and it ignores the system state, and no wiping of data. The fact the mirror site is out of date is causing the need to wipe so the OTAs work on an unmodified system.
Fortunately I have multiple phones so I can use another for the few hours this all takes.

works great, I just flash it and without wiping data
hamelg said:
You don't need backups to apply the latest OTA.
Get the stock corresponding to your device.
flash LOGO, SYSTEM, OEM, BOOT AND RECOVERY images.
Apply November OTA
Apply February OTA
I did that without wiping my data.
If you want to avoid reset to stock & apply all OTAs, you must have a binary backup of system partition, not a file based backup (see comment #8).
I asked about this issue here :
https://forum.xda-developers.com/showpost.php?p=72029402&postcount=55
Click to expand...
Click to collapse
works great and finally my phone can upgrade the OTA updates:laugh::good:

VR25 said:
To make RAW image backups of SYSTEM and OEM partitions, use terminal in TWRP
Or "adb shell" from your computer (running as root)
...
Restore
dd if=/sdcard/system.img of=/dev/block/mmcblk0p53
dd if=/sdcard/oem.img of=/dev/block/mmcblk0p51
Click to expand...
Click to collapse
Here is time to apply the may OTA MPIS24.241-15.3-21.
I restored the vanilla system.img MPIS24.241-15.3-16 with dd, but it didn't work. The OTA failed with the error "system partition has unexpected content" because the sha1sum was incorrect.
Here is the solution :
Before restoring with dd, you must check "Mount System partition read only" is enable in the MOUNT menu of TWRP.
With TWRP 3.1, you need no more to use dd. Now, the feature "system image backup" is available

Related

Manual OTA Update process step-by-step (Stock/Rooted/Xposed)

For stock rooted/TWRP users, this is a step-by-step process of manually updating your Moto involving flashing stock firmware, updating, and restoring TWRP, root, and apps afterwards.
Benefits:
**It's really simple- once you get familiar with this process, you can do it fairly quickly.
**Take the time to read through and get everything set up and you'll be set for future updates.
**No begging the internet for flashable zips.
Preface:
So my situation is i'm running stock, bootloader unlocked, rooted, and xposed on my US XT1540 2GB Moto G. I went through the process this morning of updating to the new 23.46.4 update. Thought I'd share what I did for anyone out there wanting to update with questions ; hopefully some can be answered here. I'm familiar with flashing firmware files from my previous Moto X's '13 & '14 so trust me it's not a big deal to flash back stock firmware to update. This process should be applicable to any variant of the Moto G and and to any future updates as well, not just the one mentioned here as of 09/19/15. Just be mindful of your phone's version and use the appropriate firmware.
1) BACKUP
First, make sure everything worth keeping is on your microSD. Flashing stock firmware will wipe your phones internal memory so pictures, music, downloads, SMS, etc need to migrate. Also make sure you have SuperSU and Xposed on your microSD for re-installation. This might be obvious for some and you might have everything going to your microSD (sdcard1, EXTsdcard) already, but one thing you might miss is Titanium Backup...
Save apps in Titanium to microSD: Menu>Preferences>Backup folder location>Click to change>Ext. SD card>Create a new folder>Use current folder
Nandroid in TWRP to microSD: toward the bottom click on "Storage: Internal storage" and choose "Micro SDcard"
If you're super smart, after making that backup you'll copy that to your pc.
2) DOWNLOADS
Get the most recent firmware for your device from lost101's firmware thread (thank him threads like this are so helpful)- http://forum.xda-developers.com/2015-moto-g/general/index-moto-g-factory-firmware-images-t3169639
Download and install the drivers for you phone, I believe the generic android driver will work but you can also get them from Motorola Device Manager: https://motorola-global-portal.custhelp.com/app/answers/detail/a_id/88481
Download mini-sdk.zip, attached to the the bottom of this post. Useful light weight sdk containing adb & fastboot which should cover all your flashing needs. If you're not developing apps, full blown android sdk is bloatware
3) SETTING UP ADB/FASTBOOT
Enable USB debugging in Developer options
Extract mini-sdk.zip to a folder. Extract and add the contents of your firmware to that folder.
Open a cmd prompt on the mini-sdk folder (shift + right click, "Open Command Window Here")
Let's verify that adb sees the device:
Code:
adb devices
Should see "XXserial#XX device". If you get "offline", be sure to check your phone for the adb authorization dialog.
We're ready to flash firmware so reboot into fastboot:
Code:
adb reboot bootloader
4) STOCK FIRMWARE INSTALLATION
Once phone is in fastboot, enter the following commands in the cmd prompt (open on the mini-sdk folder containing the firmware files) one at a time. Let the current flash command finish before entering the next, especially at the img_sparsechunck steps because they take a 10-15 sec each. Also make sure all of the filenames match what you have; substitute accordingly.
Code:
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 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 modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
5) UPDATE
When you reboot, if you don't get prompted for update check for it- About phone>System updates
Download & install update
When update is finished and phone boots back up, enable Android debugging in developer options.
6) FLASH BACK TWRP/ROOT/XPOSED
Place TWRP img file in mini-sdk folder. Boot back into fastboot and flash TWRP.
Code:
adb reboot bootloader
Code:
fastboot flash recovery twrp-osprey-2.8.7-test1.img
Vol up/down in bootloader to boot recovery.
Once in recovery flash Supersu & xposed (optional of course) from your microSD and reboot.
Install Titanium from play store, go back into preferences and point to backup folder on the microSD and restore apps.
When xposed and modules are reinstalled through Titanium, you will need to reboot to enable. After that you'll need to tweak your preferences in system options like notifications or display, but any settings in modules (like gravity box) will be restored as long as you backed up app+data in TB. Easier than a custom rom clean flash in that aspect.
So that's it, with that you should be back up and running. Let me know if I missed some steps or if you have questions about the process.
*****
BTW, Installing xposed from scratch for those confused on what files to do what with: http://forum.xda-developers.com/show....php?t=3034811
Flash this one in recovery: xposed-v74-sdk22-arm.zip (or most current)
Install this apk after you reboot: XposedInstaller_3.0_alpha4.apk (or most current)
Please Delete
agleroy said:
Thanks for the guide. Still gonna wait for a flashable zip though.
Click to expand...
Click to collapse
You're better than that. Trying to empower you here...
Please Delete
Hey, could you use normal/dark colors? Reading light yellow and blue is difficult, even when highlighting it with a cursor. Thanks!
a.cid said:
Hey, could you use normal/dark colors? Reading light yellow and blue is difficult, even when highlighting it with a cursor. Thanks!
Click to expand...
Click to collapse
I took all the color out and tweaked it a bit. I was using the dark theme and everything looked pretty good, but when I switched to the light theme... yeah annoying.
I'm still trying to decide if I want/need to root, and/or install a custom ROM on this phone. I have always done so on past phones, but this phone runs so well I don't want to mess it up, and I'm not sure the few features I'm missing warrant messing with things.
Thank you the tutorial though. I will certainly keep it for reference.
Sent from my MotoG3 using XDA Free mobile app
Why does every single guide say to erase the userdata partition??? This is totally unnecessary. Instead, boot into twrp and wipe your userdata. The difference is in your internal storage. If you follow the guide you wipe your internal storage in the very last command. My way, you just do a factory reset on the data partition which doesn't wipe the storage
Also, flashing stock recovery is an unnecessary step when it's being immediately replaced by twrp again.
Selmak said:
I'm still trying to decide if I want/need to root, and/or install a custom ROM on this phone. I have always done so on past phones, but this phone runs so well I don't want to mess it up, and I'm not sure the few features I'm missing warrant messing with things.
Thank you the tutorial though. I will certainly keep it for reference.
Sent from my MotoG3 using XDA Free mobile app
Click to expand...
Click to collapse
This isn't a custom rom...it's the official motorola firmware update
Thanks for this guide , it's good to know, but I would have to wait for a flasheable UPDATE.zip because my phone's configuration (XT1543, dual sim, 16gb storage, 1gb ram) doesn't have a stock firmware download link in the main thread... and also I don't want to reinstall my apps , haha.
If it works like the other 2 generations of moto g, and at least with the first moto x (all from my personal experience) just skip the erase userdata part and you'll keep your personnal data.
Ota update will go smoothly, no need to restore anything afterwards except root and recovery, indeed.
A backup is always a good thing, sure just in case, but i never used mine on all the ota's I installed on those 3 phones (moto g 2013 16gb, moto g 2014 and moto x 2013)
I don't own a moto g 2015 but my gf does, a 16gb/2gb ram one, she just got it so she installed the update before rooting. If nobody tries it before I'll try it with the next update .
cannot access filehost to get xt1541 5.1.1 any alternative link?
after I updated to 6.0 my computer is not recognising the device? any solutions?
Please add "fastboot flash system system.img_sparsechunk.6" to the top post. This could prevent idiots from sitting in a boot loop for an hour, while they try furiously to find a way out, an error in the download, revert to a previous firmware... Yeah, that was stressful.
Is this the same for the XT1548 virgin mobile 1G of ram and 8G of memory. I understand that it's probably not the same file I just don't really want to wait for the flashable .Zip. But I also don't want to mess up my only device as of now.
Hey i need help....my xt1550 is unlocked and running on stock 6.0 right now......i have installed custom ROMs and rooted the device before.....but now its unrooted and running stock but iam still not able to recieve ota updates.......why?
csumanth16 said:
Hey i need help....my xt1550 is unlocked and running on stock 6.0 right now......i have installed custom ROMs and rooted the device before.....but now its unrooted and running stock but iam still not able to recieve ota updates.......why?
Click to expand...
Click to collapse
If you have stock recovery and an update touched /boot and /system partition, you can take an OTA update. If you have TWRP, root, or other modification in the mentioned areas you cannot take an OTA update.
Having an unlocked bootloader only is not relevant.
What if you unrooted, a rooted stock recovery device, is it safe to take an OTA?
acejavelin said:
If you have stock recovery and an update touched /boot and /system partition, you can take an OTA update. If you have TWRP, root, or other modification in the mentioned areas you cannot take an OTA update.
Having an unlocked bootloader only is not relevant.
Click to expand...
Click to collapse
MrTooPhone said:
What if you unrooted, a rooted stock recovery device, is it safe to take an OTA?
Click to expand...
Click to collapse
No... If your rooted the /boot partition has been modified.
acejavelin said:
No... If your rooted the /boot partition has been modified.
Click to expand...
Click to collapse
And does it remain notably changed even after going through a full unroot via SuperSU?
MrTooPhone said:
And does it remain notably changed even after going through a full unroot via SuperSU?
Click to expand...
Click to collapse
No, doing a full unroot will return the original /boot partition, but be aware this will not undo any changes you made to /system with root access (such as debloating or Xposed modules), and even if you undo those changes, the Android system has already marked the /system partition as tampered so a check will fail.

Can I Ota update while rooted on stock firmware

I am currently on stock rom but rooted. An Ota update popped up can I update without bootloop
I would like to know the same thing
Naruto101 said:
I am currently on stock rom but rooted. An Ota update popped up can I update without bootloop
Click to expand...
Click to collapse
stkman32 said:
I would like to know the same thing
Click to expand...
Click to collapse
No you can't take an OTA if you have any modifications to /system (root). Have a look at my guide:
http://forum.xda-developers.com/nexus-6p/general/guides-how-to-guides-beginners-t3206928
I got an 8MB update for the november patch. Being on TWRP and root i need to convert back to stock before i can have it leave me alone? Is there a way to flash the patch without doing that?
Thanks for answering my question
roughriduz said:
I got an 8MB update for the november patch. Being on TWRP and root i need to convert back to stock before i can have it leave me alone? Is there a way to flash the patch without doing that?
Click to expand...
Click to collapse
No way around it, any modifications will cause the update to fail.
Heisenberg said:
No way around it, any modifications will cause the update to fail.
Click to expand...
Click to collapse
@amoeller had me flash the modified boot.img for MDB08M then flash the MDB08M system.img and vendor.img from the factory image. I rebooted bootloader, the booted to TWRP and re-flashed supersu. I am now on the November patch without having to remove TWRP and all works well. My user data was also untouched.
roughriduz said:
@amoeller had me flash the modified boot.img for MDB08M then flash the MDB08M system.img and vendor.img from the factory image. I rebooted bootloader, the booted to TWRP and re-flashed supersu. I am now on the November patch without having to remove TWRP and all works well. My user data was also untouched.
Click to expand...
Click to collapse
User data should never be affected during an OTA anyway.
This is actually the first time I've unlocked a phones bootloader and stuck with the stock rom. I usually use some kind of popular rom with it's own built in OTA (CM/Viper One)
How often do you guys actually update your phones for OTA? It seems like a real hassle
GloriousGlory said:
This is actually the first time I've unlocked a phones bootloader and stuck with the stock rom. I usually use some kind of popular rom with it's own built in OTA (CM/Viper One)
How often do you guys actually update your phones for OTA? It seems like a real hassle
Click to expand...
Click to collapse
I am rooted now so I'll wait a while before updating an ota until there's a big deal of info. However, in the past if I was sticking with stock there's usually at least one developer who posts the updates with root and stuff built in so you can easily flash with twrp. So I'm kind of waiting for that. That or cataclysm or another awesome rom that's close to stock.
GloriousGlory said:
This is actually the first time I've unlocked a phones bootloader and stuck with the stock rom. I usually use some kind of popular rom with it's own built in OTA (CM/Viper One)
How often do you guys actually update your phones for OTA? It seems like a real hassle
Click to expand...
Click to collapse
I wait for factory image for that build and flash over the new images when they become available (provided that root can still be achieved). Some will do a clean wipe and start fresh with the new build and reload in their apps and user data, others will just dirty flash the updated system (and boot/bootloader or whatever else was changed too).
If you think about it, it really isn't all that different from taking an OTA, the difference is that we're applying the commands to flash instead of having it automated. It's not that big of a trade off in my book.
I have 2 questions...
What is the easiest way to make flashing updates a breeze if I have mods in /system partition? I have heard of "freezing" them. Or is the only option... to delete every mod and flash updates? If so, should I keep a note of every change I make to/system?
And last... Should I make a backup of any file i am replacing or overwriting in /system? And if so, do I have to put them back how they were before flashing an update?
Delete
If you're rooted then you need to download the full factory image, extract system and vendor and flash those. Reflash SuperSU.
roughriduz said:
@amoeller had me flash the modified boot.img for MDB08M then flash the MDB08M system.img and vendor.img from the factory image. I rebooted bootloader, the booted to TWRP and re-flashed supersu. I am now on the November patch without having to remove TWRP and all works well. My user data was also untouched.
Click to expand...
Click to collapse
It’s probably easier and quicker just to flash stock factory images separately instead of having to jump through hoops with OTAs. Like I told @roughriduz just flash the updated partition(s) that were updated like system.img, vendor.img, or whatever and just flash SuperSU in TWRP after.
The steps @roughriduz took was
1. Download and extract latest factory image.
2. Download matching modified boot.img for that build (For example MDB08M).
3. Flash system, vendor, and any other partitions (like radios, etc) with fastboot if they were updated in the OTA. Don’t bother to flash stock recovery because we’re not using an OTA. Flashing userdata.img is just like a factory reset.
4. Boot directly into TWRP and flash SuperSU.
5. Reboot and profit.
This method gives you the latest stock build rooted with TWRP while keeping your data because I hate having to redo my phone.
amoeller said:
It’s probably easier and quicker just to flash stock factory images separately instead of having to jump through hoops with OTAs. Like I told @roughriduz just flash the updated partition(s) that were updated like system.img, vendor.img, or whatever and just flash SuperSU in TWRP after.
The steps @roughriduz took was
1. Download and extract latest factory image.
2. Download matching modified boot.img for that build (For example MDB08M).
3. Flash system, vendor, and any other partitions (like radios, etc) with fastboot if they were updated in the OTA. Don’t bother to flash stock recovery because we’re not using an OTA. Flashing userdata.img is just like a factory reset.
4. Boot directly into TWRP and flash SuperSU.
5. Reboot and profit.
This method gives you the latest stock build rooted with TWRP while keeping your data because I hate having to redo my phone.
Click to expand...
Click to collapse
A couple questions:
1. Step 1 refers to the latest factory image that contains the update, correct?
2. Step two refers to the boot.img that contains root?
3. At what point in this process do you flash the modified boot.img, before or after applying the other images?
Thanks for your help!
JimmyJunk said:
A couple questions:
1. Step 1 refers to the latest factory image that contains the update, correct?
2. Step two refers to the boot.img that contains root?
3. At what point in this process do you flash the modified boot.img, before or after applying the other images?
Thanks for your help!
Click to expand...
Click to collapse
1. Latest factory image is the latest factory image from the nexus factory images page. It's not an update like ota, but rather the entire image they would return you to stock if all is flashed.
2. Flashing a modified boot does not give you root. You still have to flash SU, so saying the modified boot contains root isn't right.
3. I flash boot first unless there is an updated bootloader.
JimmyJunk said:
A couple questions:
1. Step 1 refers to the latest factory image that contains the update, correct?
2. Step two refers to the boot.img that contains root?
3. At what point in this process do you flash the modified boot.img, before or after applying the other images?
Thanks for your help!
Click to expand...
Click to collapse
1. This can be whatever the latest factory image is at the moment. It’s currently MDB08M. All the OTA does is update your phone to whatever build it was made for. Factory images already have previously released updates built into them. You can upgrade but avoid downgrading unless you want to factory reset your phone.
2. I’m referring to the boot.img without root by @mrRobinson found https://www.androidfilehost.com/?fid=24269982086992320 although this process can be used for systemless root also. For systemless root you wouldn’t flash SuperSU in TWRP but instead sideload the SuperSU APK as per Chainfire’s instructions and use the matching systemless root boot.img
3. I don’t think it matters but as long as you have the matching modified boot.img with the system.img installed before you restart, you should be fine.
amoeller said:
It’s probably easier and quicker just to flash stock factory images separately instead of having to jump through hoops with OTAs. Like I told @roughriduz just flash the updated partition(s) that were updated like system.img, vendor.img, or whatever and just flash SuperSU in TWRP after.
The steps @roughriduz took was
1. Download and extract latest factory image.
2. Download matching modified boot.img for that build (For example MDB08M).
3. Flash system, vendor, and any other partitions (like radios, etc) with fastboot if they were updated in the OTA. Don’t bother to flash stock recovery because we’re not using an OTA. Flashing userdata.img is just like a factory reset.
4. Boot directly into TWRP and flash SuperSU.
5. Reboot and profit..
Click to expand...
Click to collapse
What the heck did I do wrong here? I just tried to apply the November OTA update to my MBD08K build, it didn't work, and now I am in the process of doing a full reset and rebuild of my phone (flash-all of factory images from Google)
Here are the notes I made as I attempted to follow the procedure in this thread:
Code:
- Download latest build for MBD08K from https://developers.google.com/android/nexus/images?hl=en
- Extract boot.img, system.img, vendor.img to C:\adb (or wherever where adb and fastboot are
installed). You have to
- Right-click, open command window here
- Ensure USB debugging is enabled on phone (grant permissions on phone if you get the popup)
- In command prompt, "adb devices"
- Should see serial number and "device"
- type "adb reboot bootloader"
- Should get to bootloader screen with little android man lying down with hatch open
- type "fastboot devices" - should see your serial # again and "fastboot" beside it.
- type "fastboot flash boot boot.img"
- type "fastboot flash system system.img"
- type "fastboot flash vendor vendor.img"
- Use volume keys to boot into recovery (in my case TWRP)
- Swipe to allow modifications
- Install -> SuperSU.zip that you should have on your phone from last time.
- Reboot system
I saw a red "your phone is corrupt" scary message on startup... took a while to boot. Couldn't get past the dancing circles.
Interrupted boot, rebooted to fastboot, tried to flash old modified boot.img
Booted again, got encryption unsuccessful warning
Flashed most recent boot.img again, stuck booting forever
try again:
- flash system.img
- flash vendor.img
- flash boot.img (modified)
reboot to recovery - your device can't be checked for corruption (yellow warning instead of red)
- swipe to allow modifications
- reboot with TWRP, swipe to install SuperSU
- Encryption unsuccessful. Prompt to factory reset. Click OK. Boots through TWRP.
Give up, start flashing factory images.
EDIT: I might be the stupidest person alive. I think I should have been using the files for MDB08M. Arggghhhh. Someone please confirm I am an idiot.
Edit 2: Factory reset worked, I am at MDB08M. Now rooting again... grr. At least I backed up all my apps & settings to Google Drive with TB.
Edit 3: Rooted and restoring all apps with TB. If anyone has any insight into where I F'ed up I'd appreciate it.

[HELP]: XT1644 Keeps Rebooting to TWRP After Moto Security Update

Received security update notification from Moto, and installed.
Moto G4+ XT1644 (4GB/64GB)
TWRP 3110, ElementalX kernel, Magisk rooted, custom logo
bootloader unlocked
Latest TWRP backup on 08/31/17
After install:
Phone now always reboots to TWRP
tried wiping data, cache, Dalvik but no difference
tried restore backup but still reboots to TWRP
Can only shut phone off via power button
Any advice to get my phone back to normal will be greatly appreciated. Thanks.
mel2000 said:
Received security update notification from Moto, and installed.
Moto G4+ XT1644 (4GB/64GB)
TWRP 3110, ElementalX kernel, Magisk rooted, custom logo
bootloader unlocked
Latest TWRP backup on 08/31/17
After install:
Phone now always reboots to TWRP
tried wiping data, cache, Dalvik but no difference
tried restore backup but still reboots to TWRP
Can only shut phone off via power button
Any advice to get my phone back to normal will be greatly appreciated. Thanks.
Click to expand...
Click to collapse
You messed up your rom by installing official update on custom kernel. Can you boot from twrp to system? What happens if you do that? Which stock rom you have exactly? Otherwise you can flash stock rom with fastboot, but never downgrade!
strongst said:
Can you boot from twrp to system? What happens if you do that? Which stock rom you have exactly? Otherwise you can flash stock rom with fastboot, but never downgrade!
Click to expand...
Click to collapse
Thank you for your reply, strongst. When I press the Reboot->System buttons in TWRP, the phone boots back to TWRP recovery.
Here are the stats I recorded before things went sideways:
Original stock firmware Build Number - NPJS25.93-14-4
Original OS version - 7.0
Original Kernel - 3.10.84-gb9596e1 [email protected] #1 Fri Mar 3 02:04:02 CST 2017
Original Baseband version - M8952_70030.25.03.62RATHENE_RETUSA_CUST
Updated Kernel - 3.10.84-ElementalX-G4-1.04 [email protected] #1 Sat Mar 11 14:16:55 EST 2017
Note: I found NPJS25.93-14-4 firmware at
https://www.getdroidtips.com/npjs25-93-14-4-march-security-moto-g4-plus
but it's titled as "March 2017 security patch" OTA update. I'm not sure if that is full replacement firmware or not.
If necessary, should I simply flash NPJS25.93-14 (full firmware) via fastboot and allow Moto to finish the updates via OTA?
mel2000 said:
Thank you for your reply, strongst. When I press the Reboot->System buttons in TWRP, the phone boots back to TWRP recovery.
Here are the stats I recorded before things went sideways:
Original stock firmware Build Number - NPJS25.93-14-4
Original OS version - 7.0
Original Kernel - 3.10.84-gb9596e1 [email protected] #1 Fri Mar 3 02:04:02 CST 2017
Original Baseband version - M8952_70030.25.03.62RATHENE_RETUSA_CUST
Updated Kernel - 3.10.84-ElementalX-G4-1.04 [email protected] #1 Sat Mar 11 14:16:55 EST 2017
Note: I found NPJS25.93-14-4 firmware at
https://www.getdroidtips.com/npjs25-93-14-4-march-security-moto-g4-plus
but it's titled as "March 2017 security patch" OTA update. I'm not sure if that is full replacement firmware or not.
If necessary, should I simply flash NPJS25.93-14 (full firmware) via fastboot and allow Moto to finish the updates via OTA?
Click to expand...
Click to collapse
You can also flash the latest available for your device with June security patch. After that you can root again with ex kernel if you want https://forum.xda-developers.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138
Make sure to mount storage within twrp first and save your internal memory before flashing stock rom!
In future, if that happens, you could try booting to the bootloader, then on the bootloader screen, press 'Start' and try to get your device to boot normally. Credit to: https://forum.xda-developers.com/showpost.php?p=72114657&postcount=170
Personally, I'd go with strongst's suggestion to flash the June 2017 stock fastboot ROM - you'd have to revert to stock (completely) anyway to accept the OTA - as you've found out, OTAs will only successfully flash onto a device with stock recovery, kernel, and unmodified system including no root. You may as well update at the same time to the same patch level that the OTA would have brought you up to.
echo92 said:
In future, if that happens, you could try booting to the bootloader, then on the bootloader screen, press 'Start' and try to get your device to boot normally. Credit to: https://forum.xda-developers.com/showpost.php?p=72114657&postcount=170
Personally, I'd go with strongst's suggestion to flash the June 2017 stock fastboot ROM - you'd have to revert to stock (completely) anyway to accept the OTA - as you've found out, OTAs will only successfully flash onto a device with stock recovery, kernel, and unmodified system including no root. You may as well update at the same time to the same patch level that the OTA would have brought you up to.
Click to expand...
Click to collapse
This 100%. Boot into bootloader and choose start from there. I ran into the same issue last night whilst trying to update my XT1644 and figure this out through trial and error. Once I got it back up though, flashing many stock recoveries that I found online couldn't get the update to work either. It would error out a few seconds after booting into the stock recovery and starting the update. I finally resigned to re-flashing a stock image of marshmallow and updating it all again from there. I wanted to pull the stock recovery before I replaced it with TWRP again but I couldn't find a way to do that. Any method I found required having root access already, and of course I can't get root access without flashing a custom recovery first.
echo92 said:
In future, if that happens, you could try booting to the bootloader, then on the bootloader screen, press 'Start' and try to get your device to boot normally.[/url]
Click to expand...
Click to collapse
Thanks for all replies. Rebooting from the bootloader screen brought my phone back to normal. Same March 2017 patch, as well as the same TWRP and ElementalX kernel and build number. Unlocked bootloader logo.bin remains intact. Magisk is still at v13.3 and it passes SafetyNet. Internal memory intact. I'm relieved.
Settings->System Updates->New version NPJ25.93-14.5
However, I'm now contemplating whether it'll be worthwhile to patch my phone to the NPJ25.93-14.5, June 2017 update.
Can I assume that the June 2017 1.1 GB "patch" contains the full NPJ25.93-14.5 firmware for XT1644?
( https://www.androidfilehost.com/?fid=889764386195918175 )
Is there a way to flash the June 2017 ROM via TWRP, and without having to reinstall ElementalX kernel, etc.?
mel2000 said:
Thanks for all replies. Rebooting from the bootloader screen brought my phone back to normal. Same March 2017 patch, as well as the same TWRP and ElementalX kernel and build number. Unlocked bootloader logo.bin remains intact. Magisk is still at v13.3 and it passes SafetyNet. Internal memory intact. I'm relieved.
Settings->System Updates->New version NPJ25.93-14.5
However, I'm now contemplating whether it'll be worthwhile to patch my phone to the NPJ25.93-14.5, June 2017 update.
Can I assume that the June 2017 1.1 GB "patch" contains the full NPJ25.93-14.5 firmware for XT1644?
( https://www.androidfilehost.com/?fid=889764386195918175 )
Is there a way to flash the June 2017 ROM via TWRP, and without having to reinstall ElementalX kernel, etc.?
Click to expand...
Click to collapse
Yes it's the full rom. And no, you need to flash kernel and magisk after every rom flash, stock twrp, fastboot or custom rom doesn't matter(otherwise it's already included).
strongst said:
Yes it's the full rom. And no, you need to flash kernel and magisk after every rom flash, stock twrp, fastboot or custom rom doesn't matter(otherwise it's already included).
Click to expand...
Click to collapse
Thanks again strongst. I'm still contemplating because of the complexity. However, the constant phone notification to update is weakening my resistance. Not sure I want to have to look at that for days on end.
Just to clarify, are you stating that I won't have to reinstall TWRP? That would be a relief.
Would it suffice to copy my internal SD to my PC and restore it later? Do I need to copy everything? Will my Nandroid backup save my Magisk settings?
I did make a TWRP backup of the XT1644 updated to NPJ25.93-14.5. I could share it with you if you'd like. However, you'd still need to flash ElementalX and root after.
mel2000 said:
Thanks again strongst. I'm still contemplating because of the complexity. However, the constant phone notification to update is weakening my resistance. Not sure I want to have to look at that for days on end.
Just to clarify, are you stating that I won't have to reinstall TWRP? That would be a relief.
Would it suffice to copy my internal SD to my PC and restore it later? Do I need to copy everything? Will my Nandroid backup save my Magisk settings?
Click to expand...
Click to collapse
You need to flash twrp after you flashed the stock rom cause the stock rom flash the stock recovery. Copy the whole internal memory, better to save everything when you don't know exactly what you need
Restore the whole internal memory isn't good, just restore what's missing if you recognize it. Your magisk settings will be saved with nandroid, that's true, but don't restore your partitions from nandroid backup from your prior rom version to the new, that cause trouble. Make backup of your apps with titanium backup instead.
Just to clarify - are you on the Amazon software channel (amz) or do you have the Amazon Prime edition of the XT1644 (with the ads on the lockscreen)? I'm just curious as whether this NPJ25.93-14.5 update is exclusive to Amazon or if it's more widespread.
EDIT - seen a couple of users reporting they've received it on the retus channel, so maybe more widespread to US users, maybe to include the Verizon emergency calling patch that the G5 Plus got too?
tmp000 said:
I did make a TWRP backup of the XT1644 updated to NPJ25.93-14.5. I could share it with you if you'd like. However, you'd still need to flash ElementalX and root after.
Click to expand...
Click to collapse
That sounds great tmp000. I'd definitely like you to share it. How would I go about flashing it? Any particular precautions? Thanks.
mel2000 said:
That sounds great tmp000. I'd definitely like you to share it. How would I go about flashing it? Any particular precautions? Thanks.
Click to expand...
Click to collapse
Sorry, I'm not an expert, so I can't say much about precautions. What I will do is tell you what I did to get my phone to its current state now is:
Backup my data
After failing to apply the NPJ25.93-14.5 update many times through a bunch of different stock recoveries that I found online (including versions extracted from full stock ROMs), I found a way to downgrade back to the stock ROM of Marshmallow for the XT1644. I applied all the OTA updates, all the way to NPJ25.93-14.5.
At this point, I flashed TWRP recovery again. At the same time, right after running the command to flash TWRP with fastboot, I also flashed logo.bin to get rid of that unlocked bootloader message. I then booted into TWRP and then backed up the system and boot partition as it was (so stock kernel and no root).
In TWRP, I flashed ElementalX, and then SuperSU after that (I know you are using a different root method so flash yours).
Then I restored the data (data partition only) of the backup I made.
After that, I rebooted into system and everything booted up just fine. I had root access and all of my data was intact. Your steps 2 and 3 would be:
Put my backup with your other backups in the TWRP folder
Do an wipe in TWRP to wipe dalvik cache, cache, system, and boot. DO NOT WIPE INTERNAL STORAGE
Then continue on with step 4 from above. And of course, I can't emphasize enough to back up your data. Not just through TWRP, but any photos, etc that you can copy onto your computer first. I'll PM you a link to my backup.
strongst said:
Your magisk settings will be saved with nandroid, that's true, but don't restore your partitions from nandroid backup from your prior rom version to the new, that cause trouble.
Click to expand...
Click to collapse
Thanks for the advice. However, I'm having trouble determining exactly what I need to backup before the firmware flash.
Which folders from the Root dir of internal memory need to be saved?
Do I need to save the SDCARD directory?
Can I use TWRP to restore individual apps within the Nandroid backup instead of the whole archive?
Just trying to be extra careful to preempt things from going sideways. Thanks.
echo92 said:
I'm just curious as whether this NPJ25.93-14.5 update is exclusive to Amazon or if it's more widespread.
Click to expand...
Click to collapse
I have the retail version of xt1644 and hope that NPJ25.93-14.5 is intended for or compatible with that.
tmp000 said:
I'm ready to do the NPJ25.93-14..5 update. For clarity, I reordered your steps for the update:
Backup my data
Put my backup with your other backups in the TWRP folder
Do an wipe in TWRP to wipe dalvik cache, cache, system, and boot.DO NOT WIPE INTERNAL STORAGE
In TWRP, I flashed ElementalX, and then SuperSU after that (I know you are using a different root method so flash yours).
Then I restored the data (data partition only) of the backup I made.
Click to expand...
Click to collapse
Am I to assume that after step 2 or 3, the actual updating consists of doing a TWRP Restore using the NPJ25.93-14.5 folder that I downloaded? Do I do the wipes before the Restore update? Thanks again for all your help.
mel2000 said:
Am I to assume that after step 2 or 3, the actual updating consists of doing a TWRP Restore using the NPJ25.93-14.5 folder that I downloaded? Do I do the wipes before the Restore update? Thanks again for all your help.
Click to expand...
Click to collapse
Yes, wipe then restore the backup. Sorry for the terrible instructions with missing steps.
mel2000 said:
Received security update notification from Moto, and installed.
Moto G4+ XT1644 (4GB/64GB)
TWRP 3110, ElementalX kernel, Magisk rooted, custom logo
bootloader unlocked
Latest TWRP backup on 08/31/17
After install:
Phone now always reboots to TWRP
tried wiping data, cache, Dalvik but no difference
tried restore backup but still reboots to TWRP
Can only shut phone off via power button
Any advice to get my phone back to normal will be greatly appreciated. Thanks.
Click to expand...
Click to collapse
When you are booted in twrp, reboot to bootloader of system (obviously). Then press power button when it displays start. Like this the phone will boot into system and not in recovery
Or
Just reboot to bootloader and read the thread attached with it.
https://forum.xda-developers.com/moto-g4-plus/how-to/moto-g4-plus-xt1640-43-athene-npj25-93-t3549369
Be sure to turn on usb debugging and oem unlock mode
DgnrtnX said:
When you are booted in twrp, reboot to bootloader of system (obviously). Then press power button when it displays start. Like this the phone will boot into system and not in recovery
Or
Just reboot to bootloader and read the thread attached with it.
https://forum.xda-developers.com/moto-g4-plus/how-to/moto-g4-plus-xt1640-43-athene-npj25-93-t3549369
Be sure to turn on usb debugging and oem unlock mode
Click to expand...
Click to collapse
Thank you for your reply DgnrtnX. It matches the successful solution I received from exho92 on 09/01/17. The only issue is that I need to boot via that method each time. I no longer boot directly into my system. However I plan to update to NPJ25.93-14.5 shortly so I'm hoping the reboot issue will go away if that upgrade goes well.
USB debugging and OEM unlock were already enabled and remain so.

Downgrading bootloader version

Does anyone know about this ?
The last version of the firmware that got OTA'ed to my phone is POTTER_RETAIL_7.0_NPNS25.137-93-8.
The only twrp backup of the firmware I have is while it was on POTTER_RETAIL_7.0_NPNS25.137-93-4.
When I tried to flash the phone with v 93-4 using fastboot, I got denied because of the version being older than that of the bootloader. But the problem is that I was able to erase prior to attempting writing ...
I need to re-install a stock rom in the phone, but POTTER_RETAIL_7.0_NPNS25.137-93-8 cannbot be found anywhere yet.
I though about twrp-flashing the phone with my 93-4 backup, but I am hesitant, I fear bricking the phone.
Is there any alternative to patience while waiting for POTTER_RETAIL_7.0_NPNS25.137-93-8_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip eventually appearing somewhere ?
Or, in other words, knowing that the last OTA to my phone installed v 93-8, is there any way to flash POTTER_RETAIL_7.0_NPNS25.137-35-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip for instance ?
CanadianGixxerman said:
I though about twrp-flashing the phone with my 93-4 backup, but I am hesitant, I fear bricking the phone.
Click to expand...
Click to collapse
An older version (your twrp backup) will work with a newer bootloader, however you can't do any OTAs. An OTA will try to apply the same changes to the bootloader that were already made, resulting in a hard brick - though the OTA would fail anyway since you don't have an intact /oem partition. You will have a functional phone, and you can get back on track after 93-8 images or Oreo are released.
I know because I'm in a similar situation. I wanted to update from 93-4 to 93-8, and I had an intact /system image backup, but /oem was mounted before so I had to flash it via fastboot. Little did I know it was from the wrong channel (retus instead of reteu), resulting in the OTA updating everything except for oem and messing stuff up, so I just flashed a 93-4 twrp backup. Everything works, patiently waiting for Oreo.
bazinga137 said:
I just flashed a 93-4 twrp backup.
Click to expand...
Click to collapse
Just curious. Did you have a full system image backup through twrp or just the system partition? I have a twrp backup of 93-8 stock boot, logo, oem, recovery, and system PARTITIONS which I thought would allow me to restore and take ota. However, since doing that I've read that system needs to be the full IMAGE backup through twrp. Confused so I haven't restored to take the 93-10 update which I got notification of yesterday.
craigl14 said:
Just curious. Did you have a full system image backup through twrp or just the system partition? I have a twrp backup of 93-8 stock boot, logo, oem, recovery, and system PARTITIONS which I thought would allow me to restore and take ota. However, since doing that I've read that system needs to be the full IMAGE backup through twrp. Confused so I haven't restored to take the 93-10 update which I got notification of yesterday.
Click to expand...
Click to collapse
Honestly, I am not sure. I did a twrp back up with the default selected partitions. But it turned out that this backup is not reliable. The phone does boot up on it, but suffers from applications crashes all over. Last I discovered is that the phone itself was not working for a phone, meaning making receiving calls is not possible.
craigl14 said:
Just curious. Did you have a full system image backup through twrp or just the system partition? I have a twrp backup of 93-8 stock boot, logo, oem, recovery, and system PARTITIONS which I thought would allow me to restore and take ota. However, since doing that I've read that system needs to be the full IMAGE backup through twrp. Confused so I haven't restored to take the 93-10 update which I got notification of yesterday.
Click to expand...
Click to collapse
It needs to be an image backup for OTAs. Unlike a regular backup, image backups are block-by block pristine copies, and restoring them preserves dm-verity and all /system checks. On the other hand the /oem partition cannot be backed up as an image (I asked GtrCraft, the official maintainer of twrp for some moto devices), and since OTAs also check if /oem has been tampered with, the update fails.
Updates will only pass if /oem has never been mounted, and you have a system image backup.
bazinga137 said:
It needs to be an image backup for OTAs. Unlike a regular backup, image backups are block-by block pristine copies, and restoring them preserves dm-verity and all /system checks. On the other hand the /oem partition cannot be backed up as an image (I asked GtrCraft, the official maintainer of twrp for some moto devices), and since OTAs also check if /oem has been tampered with, the update fails.
Updates will only pass if /oem has never been mounted, and you have a system image backup.
Click to expand...
Click to collapse
Dumb question...How do I know if the oem partition is tampered with or has never been mounted? I am rooted with elementalx kernel and supersu. TWRP partition stock backup made immediately after taking 93-8 update and before flashing twrp, rooting, etc. I know I am hosed without the system IMAGE as far as ota's go, but I'm just trying to learn.
I'm in the same boat. Pretty much stuck on 93-8 forever until a new full image is released somewhere. I might just move onto a custom Oreo rom.
dunderball said:
I'm in the same boat. Pretty much stuck on 93-8 forever until a new full image is released somewhere. I might just move onto a custom Oreo rom.
Click to expand...
Click to collapse
Well, I did that. I have tried a few cutom roms : Pixel Exprerience, Resurection Remix, AOSP extended, AOSiP and Dirty Unicorns. The latter and AOSiP are those I find the most reliable. Avoid PE and RR, too buggy, AOSP-E has issues with SIM/SDcard here.
But I will want to go back to stock moto rom when I can (ie : full 93-8 load fastboot flashable is released).
If moto had been quicker to release Oreo AND fix the wifi bug, I would not have given up on retus.
I guess I have an even more fundamental dumb question than my twrp restore issue and maybe it belongs in another thread. Aside from advanced excel formulas, I have no programming experience of any kind, let alone android. However, it seems to me that if I have a full firmware package for 93-4 (which I do) and a "blur" ota update file that takes it to 93-8 (which I do), I should be able to create a full 93-8 firmware package file myself from those two files without waiting on the file hosting sites. Maybe this is way too advanced a process but it seems to me this is 1+2=3 variety.
craigl14 said:
I guess I have an even more fundamental dumb question than my twrp restore issue and maybe it belongs in another thread. Aside from advanced excel formulas, I have no programming experience of any kind, let alone android. However, it seems to me that if I have a full firmware package for 93-4 (which I do) and a "blur" ota update file that takes it to 93-8 (which I do), I should be able to create a full 93-8 firmware package file myself from those two files without waiting on the file hosting sites. Maybe this is way too advanced a process but it seems to me this is 1+2=3 variety.
Click to expand...
Click to collapse
Your device now being at 93-8 is what's in the way. It seems like you can restore your twrp 93-4 on it, but you won't be able to relock the BL, hence OTA will not work.
CanadianGixxerman said:
Your device now being at 93-8 is what's in the way. It seems like you can restore your twrp 93-4 on it, but you won't be able to relock the BL, hence OTA will not work.
Click to expand...
Click to collapse
Sorry for the confusion. My restore issue is with the fact that I did not make a full system image twrp backup of stock 93-8. If I had, I would be able to restore and take ota's (assuming the oem issue doesn't interfere which I don't know about).
My last question is more fundamental and broader. There are quite a few people waiting on firmware updates. It just seems to me that if I have a full firmware package and an update package for that firmware, I should be able to create a newly updated full firmware package independent of what happens to be on my phone at any one time. Again, maybe really stupid and way beyond my capabilities.
I'm on a slightly same boat as OP, but I don't have my backup since I thought it was on my SD and wiped my phone, with the backup only there. I was on 93-8 when I wiped. Would getting a 93-4 backup work?
This question might of been answered but I did not see it when I read through this thread.
craigl14 said:
Sorry for the confusion. My restore issue is with the fact that I did not make a full system image twrp backup of stock 93-8. If I had, I would be able to restore and take ota's (assuming the oem issue doesn't interfere which I don't know about).
My last question is more fundamental and broader. There are quite a few people waiting on firmware updates. It just seems to me that if I have a full firmware package and an update package for that firmware, I should be able to create a newly updated full firmware package independent of what happens to be on my phone at any one time. Again, maybe really stupid and way beyond my capabilities.
Click to expand...
Click to collapse
I took a full backup of my system image through twrp, and I was on 93-8. I'll upload it when I have time and you can give it a try.
CanadianGixxerman said:
[...] but you won't be able to relock the BL, hence OTA will not work.
Click to expand...
Click to collapse
Why would you need to relock the BL to take an OTA?
craigl14 said:
My last question is more fundamental and broader. There are quite a few people waiting on firmware updates. It just seems to me that if I have a full firmware package and an update package for that firmware, I should be able to create a newly updated full firmware package independent of what happens to be on my phone at any one time. Again, maybe really stupid and way beyond my capabilities.
Click to expand...
Click to collapse
Sadly you can't apply an OTA to the firmware images, if that's what you're thinking. They need to be signed by moto to be flashable through fastboot. And if you'd want to provide someone with a twrp backup of a firmware higher than theirs, their bootloader would need to be updated too, via an OTA.
bazinga137 said:
if that's what you're thinking.
Click to expand...
Click to collapse
Thanks. That's exactly my question. So the answer is that Motorola controls the process. Makes sense. Any thoughts on my oem mounting question?
craigl14 said:
Thanks. That's exactly my question. So the answer is that Motorola controls the process. Makes sense. Any thoughts on my oem mounting question?
Click to expand...
Click to collapse
I really can't think of a way of checking the mount count of Android partitions, and I haven't found anything online.
I discovered the mount counter thingy when sweeping through logs of a failed OTA. I'm really not sure where the OTA script reads it from.
craigl14 said:
Sorry for the confusion. My restore issue is with the fact that I did not make a full system image twrp backup of stock 93-8. If I had, I would be able to restore and take ota's (assuming the oem issue doesn't interfere which I don't know about).
My last question is more fundamental and broader. There are quite a few people waiting on firmware updates. It just seems to me that if I have a full firmware package and an update package for that firmware, I should be able to create a newly updated full firmware package independent of what happens to be on my phone at any one time. Again, maybe really stupid and way beyond my capabilities.
Click to expand...
Click to collapse
I made a full backup of 93-8, but still i can't lock bootloader. We need complete firmware, until then, Lineage OS is the answer.
---------- Post added at 11:55 PM ---------- Previous post was at 11:52 PM ----------
bazinga137 said:
Why would you need to relock the BL to take an OTA?
Click to expand...
Click to collapse
No idea, i saw this first time now on Motorola. On any other manufacturers i could lock bootloader, and even get OTA updates just by flashing stock recovery and having unlocked bootloader was not a problem.
If your device was formally updated to NPNS25.137-93-8 (March 2018 security patch), then you could try to flash the NPNS25.137-93-4 (Jan 2018 security patch) update again as you previously tried (link to the Jan 2018 stock firmware for EU/US and Asia devices: https://mirrors.lolinet.com/firmware/moto/potter/official/RETAIL/ ). You may wish to ignore the security downgrade errors (you cannot downgrade bootloaders anyway, presumably to prevent you opening security vulnerabilities) when you flash, which should just be for GPT and bootloader. You may also see 'image signed with bad key' for recovery and boot as well, but verify those partitions, and the other partitions report [OKAY] after flashing. That way, you should have a NPNS25.137-93-4 system, with a NPNS25.137-93-8 bootloader, and when you boot you should have a device reporting with fully stock NPNS25.137-93-4. The next OTA you should receive is the NPNS25.137-93-8 OTA and then the NPNS25.137-93-10 April 2018 security patch OTA, which should bring you up to the latest stock firmware.
By reflashing the NPNS25.137-93-4 firmware, this should also restore your OEM partition to being untampered (read only status?), as should your system partition (which should be read only, I recall that swiping to allow modifications in TWRP sets your system partition to read-write, which causes the OTA to fail).
Normally, I would advise against downgrading and using OTA updates, as this is a prime way of hard bricking. However, in this case you are downgrading your device firmware to the firmware directly preceding the newest firmware you had (i.e. downgrading to NPNS25.137-93-4 from NPNS25.137-93-8), with the next OTA being NPNS25.137-93-8, which brings you back up to the build you had, this may be safe. To your device, you are flashing the same bootloader from the NPNS25.137-93-8 OTA as currently on your device, which should not hard brick.
If you previously had stock NPNS25.137-93-10, then I cannot recommend this procedure as you'll be downgrading two firmware versions (and you'll have to wait for newer stock firmware to be leaked), else if you try flashing NPNS25.137-93-4 onto the April 2018 firmware and try using OTA updates, you may hard brick and have a pricey paperweight. I also do not know if this will work by cross-flashing from the NPN25.137-92 series of updates either.
Of course, as the NPNS25.137-93-4 firmware is older than your bootloader, you will not be able to re-lock your bootloader (you'll need a newer firmware, probably the April 2018 or newer security patch stock firmware), but being back on full stock, you should be eligible for OTAs provided you only downgraded from NPNS25.137-93-8 (and that March 2018 security patch was the latest stock firmware on your device).
If you are truly concerned about hard bricking, then I would follow other member's suggestions in this thread and stay with TWRP flashables of the stock ROM, as they do not usually affect the bootloader.
Any questions or comments before you perform this procedure, please ask.
bazinga137 said:
I really can't think of a way of checking the mount count of Android partitions, and I haven't found anything online.
I discovered the mount counter thingy when sweeping through logs of a failed OTA. I'm really not sure where the OTA script reads it from.
Click to expand...
Click to collapse
Thanks. Weird. Sorry for hijacking this thread. But if my process were to take OTA after which it reboots, then IMMEDIATELY reboot into bootloader, fastboot BOOT into twrp (not flash it) and take a backup of boot, logo, oem, recovery and system (FULL IMAGE), how would that change oem?
CanadianGixxerman said:
Well, I did that. I have tried a few cutom roms : Pixel Exprerience, Resurection Remix, AOSP extended, AOSiP and Dirty Unicorns. The latter and AOSiP are those I find the most reliable. Avoid PE and RR, too buggy, AOSP-E has issues with SIM/SDcard here.
But I will want to go back to stock moto rom when I can (ie : full 93-8 load fastboot flashable is released).
If moto had been quicker to release Oreo AND fix the wifi bug, I would not have given up on retus.
Click to expand...
Click to collapse
What's buggy about PE? I was just about to try it...

How to OTA a Moto G6 plus when rooted with Magisk?

My phone (XT1926-3) offered the July 2018 OTA today. I followed the advice at https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md and did the following:
- Magisk Manager > Uninstall > Restore Images
- Settings > System > System Update
The phone started to download the OTA (about 300 MB), but afterwards said something like "sorry, that didn't work out".
I then did:
- Magisk Manager > Install > Install
and then phone is fine for now.
I can probably catch the download URL for the OTA by using the logcat method. But what would I do with an OTA zip? The OTA is significantly smaller than a complete firmware (about 2 GB).
bornheim2 said:
My phone (XT1926-3) offered the July 2018 OTA today. I followed the advice at https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md and did the following:
- Magisk Manager > Uninstall > Restore Images
- Settings > System > System Update
The phone started to download the OTA (about 300 MB), but afterwards said something like "sorry, that didn't work out".
I then did:
- Magisk Manager > Install > Install
and then phone is fine for now.
I can probably catch the download URL for the OTA by using the logcat method. But what would I do with an OTA zip? The OTA is significantly smaller than a complete firmware (about 2 GB).
Click to expand...
Click to collapse
I'm not sure if that's possible, but I wouldn't try it. The best way is to reflash stock and then accept the OTA. Afterwards, you can reinstall Magisk.
See if the firmware update has been posted here. In either case do a backup with Titanium Backup first. If the complete firmware update has been posted, flash it with fastboot in the bootloader. If it had not been posted, flash the latest version available and then Ota. After your up to date reflash magisk in twrp.
Sent from my moto g(6) plus using Tapatalk
Hi,
At time, is no solution to update with OTA with a rooted MotoG6+ with Magisk.
I'm working on a workaround.
Regards.
You can also use Lenovo Moto Smart Assistant and "Rescue" your device. It basically downloads the firmware and flashes it for you (wiping everything on the device (excluding External SD). That's what I did.
New OTA update arrived today. Is there already a solution for this? I thought that the new systemless Magisk would "fix" this, but OTA update still fails. No clue why. I even ended up in a bootloop, but switching active partition back to b fixed that...
I don't get why we should be excluded from updates, just because we want to be root on the devices we own. It just doesn't make sense.
This time I tried removing Magisk and restoring boot and system partition (from backup before installing Magisk) before starting the OTA because someone said that when you start the OTA it switches A_B partitions and restoring from backup doen't restore them in the right place and thats why it might fail (or something like that) BUT same result. OTA fails! I guest every month I'll have to flash stock (losing everything on the phone in the process) -> install OTA -> reinstall everything.
WHY exactly the OTA fails? It shouldn't detect that the partitions are modified because they're not (restored from backup before Magisk).
ivailogeimara said:
You can also use Lenovo Moto Smart Assistant and "Rescue" your device. It basically downloads the firmware and flashes it for you (wiping everything on the device (excluding External SD). That's what I did.
Click to expand...
Click to collapse
I have XT1926-3 and Lenovo Moto Smart Assistant says that my device is not supported. Do you have the same device?
joris1977 said:
I have XT1926-3 and Lenovo Moto Smart Assistant says that my device is not supported. Do you have the same device?
Click to expand...
Click to collapse
I used LMSA when I was running OPW113.89 to update to OPW113.89-2 (via the Recovery option). It asked me to select the product and model of the phone. I selected "Moto G Plus (6th Gen)" for the product and for the "Model Name" I had XT1926-2,XT1926-3,XT1926-5,XT1926-6,XT1926-7,XT1926-8,XT1926-9. The new version of the LMSA has 3 buttons at the top of the rescue screen: "Lenovo Phone", "Lenovo Tablet", "MOTO Phone". Make sure that you select "MOTO Phone"
I'll try it again because I just tried to recover system partition backup (made with TWRP) with TWRP and bricked my phone. And for some reason I can't flash the images from the firmware with fastboot. For some of the images that have A and B partitions it tries to flash them to non existent partitions. For example:
Code:
fastboot flash boot boot.img
or
Code:
fastboot flash system system.img_sparsechunk.0
tries to flash them to boot__b or boot__a or system__b or system__a (with double '_')
The annoying thing is that I don't have Windows outside VM so every time I need to run LMSA I have to create WINTOGO usb just to run LMSA.
ivailogeimara said:
I used LMSA when I was running OPW113.89 to update to OPW113.89-2 (via the Recovery option). It asked me to select the product and model of the phone. I selected "Moto G Plus (6th Gen)" for the product and for the "Model Name" I had XT1926-2,XT1926-3,XT1926-5,XT1926-6,XT1926-7,XT1926-8,XT1926-9. The new version of the LMSA has 3 buttons at the top of the rescue screen: "Lenovo Phone", "Lenovo Tablet", "MOTO Phone". Make sure that you select "MOTO Phone"
I'll try it again because I just tried to recover system partition backup (made with TWRP) with TWRP and bricked my phone. And for some reason I can't flash the images from the firmware with fastboot. For some of the images that have A and B partitions it tries to flash them to non existent partitions. For example: or tries to flash them to boot__b or boot__a or system__b or system__a (with double '_')
The anoying thing is that I don't have Windows outside VM so every time I need to run LMSA I have to create WINTOGO usb just to run LMSA.
Click to expand...
Click to collapse
Why did you try to update with lenovo assist? Was your rom clean as in no Magisk?
What TWRP did you use, and was your device encrypted?
Need much more info to be able to help, also what is your main OS because you don't need windows for fastboot.
Have you tried booting original boot.img through fastboot?
Maybe changed active slot?
Coldstream said:
Why did you try to update with lenovo assist? Was your rom clean as in no Magisk?
What TWRP did you use, and was your device encrypted?
Need much more info to be able to help, also what is your main OS because you don't need windows for fastboot.
Have you tried booting original boot.img through fastboot?
Maybe changed active slot?
Click to expand...
Click to collapse
Uninstalled Magisk from Magisk manager. Device is encrypted. The TWRP I use is from this thread.
The previous time I used LMSA was because uninstalling Magisk (which flashed boot partition backup) didn't help with installing the OTA (it still failed). And flashing the images from firmware with fastboot gave error. It tried to flash them to boot__a or boot__b, system__a or system__b (with double underscore). I was gonna try updating with LMSA again but decided to try flashing images from the firmware manually with mfastboot this time and it worked. It'll be good if in the guide for "how to return to stock" it said that the included fastboot is mfastboot.
I just flashed the stock images (without data,cache) with mfastboot and I'm trying to update again via OTA.
Update: OTA installed successfully!
PS: Can I check if some partition is modified in some way like OTA does?
ivailogeimara said:
WHY exactly the OTA fails? It shouldn't detect that the partitions are modified because they're not (restored from backup before Magisk).
Click to expand...
Click to collapse
Yeah I am asking myself the same question. I grabbed a log file and it shows a lot of:
Code:
/system/bin/update_engine: [libfs_mgr]Error finding 'slot' in device tree
I am clueless, but it seems that Magisk somehow disabled the ability for the phone to see slot A. An error that stays even after Magisk is fully removed; I even flashed the untouched boot.img back. But that made no difference.
I also tried sideloading the OTA with ADB on the recovery screen, but that fails too & I see the same error on the screen.
BTW You can grab the OTA with help of this website: http://erfanoabdi.000webhostapp.com/
I am always a bit hesitant in posting log files with a lot of stuff that I don't understand, but as an attachment I add here the lines of the log that contain messages about the update_engine.
joris1977 said:
Yeah I am asking myself the same question. I grabbed a log file and it shows a lot of:
Code:
/system/bin/update_engine: [libfs_mgr]Error finding 'slot' in device tree
I am clueless, but it seems that Magisk somehow disabled the ability for the phone to see slot A. An error that stays even after Magisk is fully removed; I even flashed the untouched boot.img back. But that made no difference.
I also tried sideloading the OTA with ADB on the recovery screen, but that fails too & I see the same error on the screen.
BTW You can grab the OTA with help of this website: http://erfanoabdi.000webhostapp.com/
I am always a bit hesitant in posting log files with a lot of stuff that I don't understand, but as an attachment I add here the lines of the log that contain messages about the update_engine.
Click to expand...
Click to collapse
I think this:
Code:
12-20 13:31:48.480 1134 1134 E update_engine: [1220/133148:ERROR:delta_performer.cc(1099)] The hash of the source data on disk for this operation doesn't match the expected value. This could mean that the delta update payload was targeted for another version, or that the source partition was modified after it was installed, for example, by mounting a filesystem.
12-20 13:31:48.480 1134 1134 E update_engine: [1220/133148:ERROR:delta_performer.cc(1104)] Expected: sha256|hex = 66305C30BC5570791036FFC5B57E620D516B35664C3EE5B27F97FBFD5E288817
12-20 13:31:48.481 1134 1134 E update_engine: [1220/133148:ERROR:delta_performer.cc(1107)] Calculated: sha256|hex = E2D46DB42162711333E99BF1CBD0224F5867F6E7387FA276D30EC54755AF454B
is where the update fails. I'm not sure though what partitions is the OTA checking.
I flashed every partition listed in servicefile.xml (in the stock firmware files that you can flash) and after that I was able to install the OTA. Next I made backups/images (not restorable though) with dd of all the partitions that are listed in servicefile.xml because clearly one or multiple of those get changed after installing Magisk and that's why the OTA fails. After that I installed magisk and made backups with dd again and compared the two to see what changes after installing Magisk. These are the partitions that were changed after Magisk and are in servicefile.xml:
Code:
bluetooth_b
boot_b
dsp_b
modem_b
oem_b
I guess uninstalling Magisk only restores the boot partition and one of the others fails the check. Probably oem_b.
PS: Well I guess for now the solution will be to flash everything listed in servicefile.xml (except system and system_b) via mfastboot before each OTA.
Thanks for your informative post @ivailogeimara
Lenovo fixed their Lenovo MOTO smart assistance, so now you can reflash your device. with the help of this app. I just reflashed my device and everything is working as expected.
If you use LMSA it downloads a zip file with the full OS where the new OTA is already included. Probably you can cut off the rescue operation after the full zip has arrived and you can just use that zip to flash the boot partition and that oem_b. partition I didn't try that, because I had limited time, had already backed up all my data and I needed a working phone. This is probably what I will try next time an OTA arrives.
Maybe we should make the magister developers aware about the troubles with the Moto G6 plus. It is probably I bug somewhere that uninstalling Magister does not fully restore the old install.
ivailogeimara said:
These are the partitions that were changed after Magisk and are in servicefile.xml:
Code:
bluetooth_b
boot_b
dsp_b
modem_b
oem_b
I guess uninstalling Magisk only restores the boot partition and one of the others fails the check.
Click to expand...
Click to collapse
This is exactly what I get on my phone. For the last two OTAs these are the partitions that fail the checksum verification. As you mentioned this is fixed by flashing the partitions from a known good source.
I used TWRP via "mfastboot boot twrp.img" to dump boot.img, modify it via Magisk-Manger and then flash it using mfastboot. I don't see any way how I would modify the other partitions (except boot, of course) this way.
I looked into the oem-partition and it has its "last mounted" timestamp changed to something very, very recent. This is why I rule out TWRP. My best guess is that Magisk mounts those partitions shortly as rw maybe on boot? That would already be enough to make the hash fail
So basically to be able to install the OTA:
1. after clean stock reinstall (before magisk installation) backup the above mentioned partitions
2. install magisk, etc.
3. later when an OTA update comes restore the backed up partitions + remove magisk and then install the OTA
4. back to step 1
I suppose the partitions can also be restored if you find the firmware that is identical to what the phone is currently running.
Or???
axsdenied1 said:
I suppose the partitions can also be restored if you find the firmware that is identical to what the phone is currently running.
Or???
Click to expand...
Click to collapse
Yes, that's what I did. Never thought to pull a backup of a partition that would only "ever" be changed by the OTA process I googled a bit for my version number until I found a matching stock ROM.
Moto g6 + rooted with twrp and magisk. I have an OTA update.
The OTA gets errored out right after I download the update and it tries to install it.
Phone version: XT1926-7
Using latest twrp 3.2.3
Magisk v18.0 installed.
Successfully enabled root just the other day.
Now I get the OTA update ppw29.116-11 wanting there pie update to rollout, was so happy. Except it keeps saying unsuccessful right after it's done downloading and tries to install I guess.
Has anyone found a safe workout for this?
It is outlined in the post just before the one you made...
So
before installing Magisk you should have made a backup from the following partitions:
bluetooth_b
boot_b
dsp_b
modem_b
oem_b
when an OTA update comes, remove magisk and restore the backed up partitions.
then install the OTA
make a backup again.
This should work, but I didn't test it yet.

Categories

Resources