Related
Personally I couldn't careless about stage freight but rather in the bug fixes and enhancements mentioned.
Alsi, will Motorola update the OS as 5.1 + stage freight vs 5.1 alone like they did with jellybean + camera update vs jellybean
What's the easiest way I can go about flashing stock in order to install the OTA. I usually use Nexus toolkit to do it with my Nexus 7, not sure the Moto equivalent though I do have RSD Lite but I don't want to erase my data when flashing stock recovery and such. I'm rooted on 5.1 tmo/unlocked with custom recovery and unlocked bootloader.
edit: I unrooted and uninstalled xposed, flashed stock recovery, boot and system img files but the OTA still failed.
A proper changelog?
Can someone create a flashable zip? I can grab the ota if needed from my XT1053.
I think I've made one myself but it's been so long I'm leary.
---------- Post added at 01:29 PM ---------- Previous post was at 01:24 PM ----------
ohmimpotence said:
What's the easiest way I can go about flashing stock in order to install the OTA. I usually use Nexus toolkit to do it with my Nexus 7, not sure the Moto equivalent though I do have RSD Lite but I don't want to erase my data when flashing stock recovery and such. I'm rooted on 5.1 tmo/unlocked with custom recovery and unlocked bootloader.
edit: I unrooted and uninstalled xposed, flashed stock recovery, boot and system img files but the OTA still failed.
Click to expand...
Click to collapse
Easiest way is to backup data via custom recovery, offload it to your pc. Flash stock using stock script, wiping it clean. Once fully up to date, custom recovery, copy backup and restore it.
USB mode in TWRP makes this relatively painless. Even if encrypted it works perfectly.
ohmimpotence said:
What's the easiest way I can go about flashing stock in order to install the OTA. I usually use Nexus toolkit to do it with my Nexus 7, not sure the Moto equivalent though I do have RSD Lite but I don't want to erase my data when flashing stock recovery and such. I'm rooted on 5.1 tmo/unlocked with custom recovery and unlocked bootloader.
edit: I unrooted and uninstalled xposed, flashed stock recovery, boot and system img files but the OTA still failed.
Click to expand...
Click to collapse
are u getting ""/system/app/3c_main.apk" has unexpected contents."?
ohmimpotence said:
What's the easiest way I can go about flashing stock in order to install the OTA. I usually use Nexus toolkit to do it with my Nexus 7, not sure the Moto equivalent though I do have RSD Lite but I don't want to erase my data when flashing stock recovery and such. I'm rooted on 5.1 tmo/unlocked with custom recovery and unlocked bootloader.
edit: I unrooted and uninstalled xposed, flashed stock recovery, boot and system img files but the OTA still failed.
Click to expand...
Click to collapse
Same thing here. It just fails with no error message.
zyldragoon said:
are u getting ""/system/app/3c_main.apk" has unexpected contents."?
Click to expand...
Click to collapse
Yes, I see this in the error log. After it first failed I unrooted and reflashed a stock factory L-5.1-LPA23.12-15 (Retail) LMR1, just to be absolutely sure I was stock.
I tried to get the OTA again and it failed again.
Here's the relevant bit from last_error_log:
Finding update package...
I:Update location: /cache/Blur_Version.222.21.15.ghost_row.Retail.en.US.zip
Opening update package...
I:read key e=3 hash=20
I:1 key(s) loaded from /res/keys
Verifying update package...
I:comment is 1461 bytes; signature 1438 bytes from end
I:whole-file signature verified against RSA key 0
I:verify_file returned 0
Installing update...
installing gptupgrade updater extensions
file_contexts path is present in /tmp/file_contexts
mount point :/system location: /dev/block/platform/msm_sdcc.1/by-name/system , file system type :ext4Verifying current system...
file "/system/app/3c_main/3c_main.apk" doesn't have any of expected sha1 sums; checking cache
failed to stat "/cache/saved.file": No such file or directory
failed to load cache file
file size of "/system/app/3c_main/3c_main.apk" is 9638
sha1 of "/system/app/3c_main/3c_main.apk" is 5c1d9df1c32e8cc2f0750aec478941e5d7abe817
expected sha1 is: f9aafd2ebf8aa92804c45206f81e2b3b0904d209
cb28a4acc187de6c016ca7ba4ff9b7a5518520a2
1022009344 bytes free on /cache (9638 needed)
dumping bad file /system/app/3c_main/3c_main.apk to /cache/recovery/last_badfile
script aborted: "/system/app/3c_main/3c_main.apk" has unexpected contents.
"/system/app/3c_main/3c_main.apk" has unexpected contents.
E:Error in /cache/Blur_Version.222.21.15.ghost_row.Retail.en.US.zip
(Status 7)
Installation aborted.
Click to expand...
Click to collapse
Also, TWRP shows the following error:
Package expects build fingerprint of motorola/ghost_retail/ghost:5.1/LPA23.12-15/15:user/release-keys or motorola/ghost_retail/ghost:5.1/LPA23.12-15.5/4:user/release-keys; this device has motorola/ghost_retail/ghost:4.4/13.11.1Q2.X-69-3/51:user/release-keys.
I:Legacy property environment disabled.
E:Error executing updater binary in zip '/cache/Blur_Version.222.21.15.ghost_row.Retail.en.US.zip'
E:Error installing zip file '/cache/Blur_Version.222.21.15.ghost_row.Retail.en.US.zip'
Click to expand...
Click to collapse
It's surprising to me that my device would have 4.4 release keys. WTF?
I've attached a couple of log files (one from the installer, one from TWRP) if anyone wants to poke around.
The other thing I noticed was that TWRP leaves the OTA zipfile in /cache, which causes the device to reboot and re-attempt the update automatically ad infinitum. So I used TWRP's file manager to move the zipfile out of /cache (and into /sdcard/Downloads so I could snag it).
vtluu said:
Yes, I see this in the error log. After it first failed I unrooted and reflashed a stock factory L-5.1-LPA23.12-15 (Retail) LMR1, just to be absolutely sure I was stock.
I tried to get the OTA again and it failed again.
Here's the relevant bit from last_error_log:
Also, TWRP shows the following error:
It's surprising to me that my device would have 4.4 release keys. WTF?
I've attached a couple of log files (one from the installer, one from TWRP) if anyone wants to poke around.
Click to expand...
Click to collapse
It seems that the sha1 in the ota does not match the sha1 in stock factory L-5.1-LPA23.12-15 (Retail) LMR1, i saw the same problem in moto's forum.
some people think that is because of unlocked bootloader, but when u try to relock your boot loader, but, it seems the Lollipop images on the factory restore page are even signed correctly, so we cannot even relock the bl now.
so i think we have to wait moto to give us another version of OTA file
This is the OTA file: https://mega.nz/#!NcsDQISa!Q1KWQJpRE-iey897T8JdiVNlNscscS4WXOvsxAratIY
i tried use system update, update from sd card, update from ads
no one works
the sha1 in update-script does not match
vtluu said:
The other thing I noticed was that TWRP leaves the OTA zipfile in /cache, which causes the device to reboot and re-attempt the update automatically ad infinitum. So I used TWRP's file manager to move the zipfile out of /cache (and into /sdcard/Downloads so I could snag it).
Click to expand...
Click to collapse
Um, usually you need STOCK recovery to flash an OTA. TWRP doesn't work.
KidJoe said:
Um, usually you need STOCK recovery to flash an OTA. TWRP doesn't work.
Click to expand...
Click to collapse
I did try the stock recovery first (I reflashed every factory partition image including recovery), and that didn't work.
I only installed TWRP after the stock recovery failed so I could get more information about how the update was failing. (And also so I could reinstall SuperSU.)
TWRP has worked for me with previous OTAs I think. I mean from the looks of it, it's opening and executing the update script like the stock recovery would; why would it necessarily not work (other than possible compatibility issues)?
The ota file is bad, it needs to be fixed.
Glad I'm not the only one with this same issue
The solution to apply the OTA is to use a firmware from here as well as to either use RSD lite or the following commands to flash it:
Code:
./mfastboot erase cache
./mfastboot erase userdata
./mfastboot flash partition gpt.bin
./mfastboot flash motoboot motoboot.img
./mfastboot flash logo logo.bin
./mfastboot flash boot boot.img
./mfastboot flash recovery recovery.img
./mfastboot flash system system.img
./mfastboot flash modem NON-HLOS.bin
./mfastboot erase modemst1
./mfastboot erase modemst2
./mfastboot flash fsg fsg.mbn
./mfastboot erase customize
./mfastboot erase clogo
./mfastboot oem fb_mode_clear
It was working for me on a XT1053 DE.
---------- Post added at 08:03 AM ---------- Previous post was at 07:55 AM ----------
Benoe said:
The solution to apply the OTA is to use a firmware from here as well as to either use RSD lite or the following commands to flash it:
Code:
./mfastboot erase cache
./mfastboot erase userdata
./mfastboot flash partition gpt.bin
./mfastboot flash motoboot motoboot.img
./mfastboot flash logo logo.bin
./mfastboot flash boot boot.img
./mfastboot flash recovery recovery.img
./mfastboot flash system system.img
./mfastboot flash modem NON-HLOS.bin
./mfastboot erase modemst1
./mfastboot erase modemst2
./mfastboot flash fsg fsg.mbn
./mfastboot erase customize
./mfastboot erase clogo
./mfastboot oem fb_mode_clear
It was working for me on a XT1053 DE.
Click to expand...
Click to collapse
I've downloaded the official firmware from Motorola and the update it's not working. What's the difference between this files? I mean the Motorola official firmware and the one you have shared?
What I have seen from this thread, Motorola stock firmware already users those steps when flashing. http://forum.xda-developers.com/showpost.php?p=55516176&postcount=8
Will that make a difference if reflashing stock firmware and using your flash instructions than official stock flash instructions?
Luescoff said:
---------- Post added at 08:03 AM ---------- Previous post was at 07:55 AM ----------
I've downloaded the official firmware from Motorola and the update it's not working. What's the difference between this files? I mean the Motorola official firmware and the one you have shared?
What I have seen from this thread, Motorola stock firmware already users those steps when flashing. http://forum.xda-developers.com/showpost.php?p=55516176&postcount=8
Will that make a difference if reflashing stock firmware and using your flash instructions than official stock flash instructions?
Click to expand...
Click to collapse
The method is not working with stock firmware directly from motorola, I tried that. The phone gets stock, but the ota upgrade fails.
I suppose the other firmware is also original, that's why the OTA works with it. I don't know why there is any difference, why there are more 5.1 firmwares
Yeah, I brought my XT1053 back to stock 5.1 using the Motorola official firmware download (TMO_Retail_XT1053_5.1_LPA23.12-15.222.21.15.ghost_row.Retail.en.US.tgz) from their site, but the OTA update for Stagefright still fails. It's odd, because flashing to stock worked for all the prior OTAs; something seems to be different about this one that's causing it to fail even on a phone that's been rolled back to stock in some circumstances.
Is the 5.1 firmware from Motorola firmware center link from above actually different in some significant way such that it would allow the OTA update to succeed where it fails with the "official" download?
EDIT: I just downloaded the firmware from the link above, and all of the components have different file hashes than the official firmware does, so it isn't just a repackaged version of the main firmware. Given all the issues surrounding the gpt/motoboot files, I don't know if it's particularly safe to flash the files from that motofirmware.center link or not.
EDIT 2: Flashed the motofirmware.center firmware (GHOST_RETAIL_5.1_LPA23.12-15_cid9_CFC.xml.zip) and re-ran the OTA update; everything went smoothly. It looks like there's some sort of issue with the "official" firmware from Moto's site.
I took it. I am unrooted. Boot unlocked .
Strangest thing is that after the app optimization which took around 15 min, the phone is faster and cooler. And get this, I do NOT see cell stand by drain in the battery stats. Will give it a couple of cycles and confirm back.
It seems like there needed to be a thread dedicated to the issues that users have been seeing with this recent OTA, as it seems like there has been a few problems with updating if you ever used Motorola's Stock 5.1 Image, I'll begin by listing the steps necessary to successfully apply the OTA update regardless of what software version you are currently running, there is also a TWRP System Image for those of you who don't want to go through the fastboot process or return to stock
Official OTA Update Procedure
1) Use TWRP and make a full backup, then connect your phone to your computer and transfer the backup files to your computer
2) Reboot your phone into the bootloader, either by doing adb reboot-bootloader or the physical key combination (power off then press and hold the power and volume down key for ~4 seconds)
3) Download the Stock 5.1.0-LPA23.12-15.0 Image from here, do NOT use Motorola's Recovery Image to do this procedure, it will fail, as the hashes are not what the OTA is expecting for the system.img, and extract the contents to a folder on your computer
4) Download the OS relevant attached mfastboot zip and unzip the contents to the same folder on your computer (if you are having issues with mfastboot try reefuge's version and see if it helps!)
5) Open up a command prompt in the directory and use the following commands to flash the 5.1 Stock Image, erasing the userdata partition is not required but it is highly recommended, as you can easily restore the TWRP data partition after doing these steps if you want your personal data back
Code:
[B]not required, but recommended![/B]
mfastboot erase userdata
[B]required[/B]
mfastboot erase cache
mfastboot erase customize
mfastboot erase clogo
mfastboot flash partition gpt.bin
mfastboot flash motoboot motoboot.img
mfastboot reboot-bootloader
mfastboot flash logo logo.bin
mfastboot flash boot boot.img
mfastboot flash recovery recovery.img
mfastboot -P flash system system.img
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1
mfastboot erase modemst2
mfastboot flash fsg fsg.mbn
mfastboot reboot
6) Reboot your phone and do your initial 5.1 phone setup, and then immediately check for System Updates
7) Download the OTA and select to install the OTA
8) Rejoice in your completed OTA update, if the update fails to install, upload the recovery logs (or tell us the problem) and we will try to help!
9) You can now install TWRP and root if desired, and restore your TWRP data backup if you erased it beforehand
TWRP System Image
The TWRP System Image can be used instead of trying to apply the OTA update, this is a backup of my own phone's system partition after doing the OTA update, so it's already on 222.27.5...
Alright, after quite a bit of time uploading...
Here is the TWRP System Image
1) Download the Stagefright System 222.27.5 TWRP backup from the above link
2) Unzip the Stagefright System 222.27.5 folder to your computer
3) Copy the Stagefright System 222.27.5 folder to your phones internal storage, to the TWRP/BACKUPS/TA0000008VJ/ directory
4) Reboot your phone into recovery (TWRP)
5) Click Restore and select the Stagefright System 222.27.5 folder
6) Verify that the System partition is selected and then Swipe to Restore
7) Clear your cache
8) Boot into system and enjoy the new patch
_
Obligatory initial post
If this guide helped you at all, please show your support by either donating or telling people about how they can fix their device, pay it forward!
Please forgive me for being paranoid and not immediately running out and flashing some random OS image off the internet without first asking: what's the provenance of this OS image?
vtluu said:
Please forgive me for being paranoid and not immediately running out and flashing some random OS image off the internet without first asking: what's the provenance of this OS image?
Click to expand...
Click to collapse
The image is a Motorola signed Image, it's just not the same one that they have listed on the Recovery page, here is the details from the factory version info file inside the zip
Code:
BUILD REQUEST INFO:
SW Version: ghost_retail-user 5.1 LPA23.12-15 15 release-keysMSM8960PRO_BP_23255.138.89.00R
MBM Version: 30.BE
Modem Version: MSM8960PRO_BP_23255.138.89.00R
FSG Version: ONEBIN_BP_FSG_2.3.03_v127
Build Fingerprint: motorola/ghost_retail/ghost:5.1/LPA23.12-15/15:user/release-keys
VERSION INFO FOUND UNDER 'ABOUT PHONE' SCREEN:
System Version: 222.21.15.ghost_row.Retail.en.US
Model number: Moto X
Android Version: 5.1
Baseband Version: MSM8960PRO_BP_23255.138.89.00R
Build Number: LPA23.12-15
Build Date: Sat May 9 01:44:45 PDT 2015
OTHER MISC VERSION INFO:
Subsidy Lock Config: None
Blur Version: Blur_Version.222.21.15.ghost_row.Retail.en.US
Version when read from CPV: ghost_retail-user 5.1 LPA23.12-15 15 release-keys
I can confirm that the stock image linked in the original post actually allows the update to succeed. I originally tried flashing the "official" firmware (TMO_Retail_XT1053_5.1_LPA23.12-15.222.21.15.ghost_row.Retail.en.US.tgz) from Motorola's site , since I had used firmware from Motorola's page to go back to stock for previous OTAs successfully, but the Stagefright OTA failed to install over that "stock" version. After flashing over to the image from motofirmware.center (GHOST_RETAIL_5.1_LPA23.12-15_cid9_CFC.xml.zip), the OTA installed smoothly. Looks like someone at Motorola made a mistake with the Lollipop 5.1 firmware they uploaded to their official page.
mastarifla said:
The image is a Motorola signed Image, it's just not the same one that they have listed on the Recovery page, here is the details from the factory version info file inside the zip
Click to expand...
Click to collapse
Thanks for the clarification. :good:
EDIT: false alarm about LTE functionality deleted, my bad. Happy flashing!
Sorry for posting again, but would it be possible to create a zip file for this OTA that will flash in TWRP?
vtluu said:
Thanks for the clarification. :good:
Warning: it looks like I might have lost LTE support on T-Mobile US after applying the above flash (it shows me using HSPA+). Could be a false alarm or me being clueless. Will edit this post once I've verified one way or the other.
EDIT: confirmed, after putting back the image I got from the official Motorola page, I see "LTE" once again under "Cellular network type" in "SIM status", whereas with the above image it said "HSPA+". There might be a way of mixing and matching the radio firmware to fix that, but I haven't tried. At this point I think I'll just sit tight and wait for an update to the update from Moto.
Click to expand...
Click to collapse
T-Mobile default's data to HSPA+, then once you start using data it "revs up" to LTE, this is a network topology thing
You could also use the dialer code (*#*#4636#*#*) to verify that your preferred network type is set correctly, mine is set to LTE/GSM auto (PRL)
Thanks. Will try again. (The most painful part being having to wait 15-20 minutes for ART to recompile my 109 apps after each reflash.)
UPDATE: all good. And the OTA update worked as well.
AaronCompNetSys said:
Sorry for posting again, but would it be possible to create a zip file for this OTA that will flash in TWRP?
Click to expand...
Click to collapse
I think all that has to be done for that is to remove the fingerprints from the flash script right?
If so, here you can try this version in TWRP... I didn't remove the patch hash checks, so if you used the Motorola Image you will still fail when flashing
mastarifla said:
I think all that has to be done for that is to remove the fingerprints from the flash script right?
If so, here you can try this version in TWRP... I didn't remove the patch hash checks, but theoretically they could be removed, but that seems quite risky...
Click to expand...
Click to collapse
I just tried it and it failed to install with TWRP. Bummer! Thanks for trying.
Being on Motorola Stock 5.1 image I flashed stock image linked in OP using RSD Lite. I did not erased Userdata during flash. Afer that OTA installed just fine.
sisterchick said:
I just tried it and it failed to install with TWRP. Bummer! Thanks for trying.
Click to expand...
Click to collapse
When did it fail? Was it due to the sha-1 mismatch? Or was it not even able to begin?
If it was the mismatch, then you would have gotten the same error with the stock recovery, which is resolved by flashing the 5.1 stock image that I linked to in the OP, you could also try removing the hash checks in the build-script, but that would be somewhat risky-ier
Al936 said:
Being on Motorola Stock 5.1 image I flashed stock image linked in OP using RSD Lite. I did not erased Userdata during flash. Afer that OTA installed just fine.
Click to expand...
Click to collapse
Awesome, I added to the OP that you don't need to wipe your data partition but it's still highly recommended
Do I need to unzip the pack I downloaded? For some reason system.img won't unzip. I keep getting an error that says "CRC failed in 'system.img". File is broken." I'm using 7zip to try to extract the files.
Shemlon said:
Do I need to unzip the pack I downloaded? For some reason system.img won't unzip. I keep getting an error that says "CRC failed in 'system.img". File is broken." I'm using 7zip to try to extract the files.
Click to expand...
Click to collapse
You should unzip the .zip, but you should not "unzip" the .img. The .img is a binary file that should stay as is (don't try to open it).
Alright I made a version of the update.zip without the patch checks
Edit: Unfortunately no luck as the patching cant be forced on the Motorola Image, as the places where they patch seem to be different than the other zip's system image
Will I need to reinstall TWRP and reroot my phone when I'm done? I apologize for the really basic questions guys.
Shemlon said:
Will I need to reinstall TWRP and reroot my phone when I'm done? I apologize for the really basic questions guys.
Click to expand...
Click to collapse
No problem, yes, you will need to re-install TWRP and re-root your phone if you are doing the full procedure
Thank you dude!
Looks like all problems cuz of missmatching hashes in prev firmware and OTA. I just flashed from your link following things and OTA installed fine:
mfastboot flash motoboot motoboot.img
mfastboot flash boot boot.img
mfastboot flash recovery recovery.img
mfastboot flash system system.img
Click to expand...
Click to collapse
Success!
Thanks! You saved me a bunch of time fixing my wife's phone that failed-to-update correctly like so many others.
FWIW:
1) Do NOT use the regular android sdk 'fastboot'; use the motorola-tweaked mfastboot version attached above. I've gotten away with using the regular fastboot util for most things, but the device failed to boot past the unlocked bootloader warning screen until I reflashed system using mfastboot instead.
2) I got an error updating the gpt partition (something about downgrading security versions), but it didn't seem to matter.
3) I didn't wipe the userdata partition either, and all was fine. Had a TWRP backup just in case, though.
5.1 -> 5.1.1 == done. Secure... for now. (according to this Stagefright Detector app)
Doubt this original MotoX will get Marshmallow 6.0, so I might be switching it to CyanogenMod 13 in a couple months.
I have a Moto G4 (XT1625) Unlocked with 32GB of storage. Bootloader Unlocked and TWRP Bootloader or Recovery, IDK how to word it, but I attempt to update from Android 6.0.1 to Android 7 and the update fails. When the device reboots it reboots into the TWRP Recovery Menu. How do I proceed. Please help.
Haven't used adb, drivers, or anything and cannot seem to remember the process. Any pointers in the right direction are appreciated. Thank you.
Update 1: I am able to boot into TWRP 3.0.2-0 and see files on my MicroSD. However I downloaded a .ZIP file that was suppose to be the Nougat factory image and when I went to flash it, it says "Installing zip file.... could not find 'META-INF/COM/GOOGLE/ANDROID/UPDATE-BINARY' in the zip file. Error installing zip file."
Update 2: Can someone confirm that I would need to first somehow remove TWRP in order to update? How do I remove TWRP and get phone back to FULL STOCK.
Okay, accepting OTA updates requires a stock recovery (as you've discovered), stock kernel and unmodified system. Furthermore, the stock Nougat zip that you've downloaded needs to be extracted on your computer and flashed via fastboot, it's not flashable in TWRP.
If you're wanting to update and update to the latest Nougat build (which for US devices - XT1625 and XT1644 - appears to be NPJ25.93-14.5, June 2017), the easiest way is to download the stock Nougat ROM from here: https://www.androidfilehost.com/?fid=673368273298984458 . Download to your computer and extract the files. This build is for retail US (non-Amazon devices), with a retus software channel as listed in Settings>About Phone.
Then follow the instructions here, but using the above NPJ25.93-14.5 stock ROM instead. https://forum.xda-developers.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138
Beware that this process may erase your data in the process, so back up as necessary. If you do not wish to erase your data, then you can use the following fastboot commands instead of the commands in the guide. Back up anyway and you may have to factory reset (thus losing your data) if your device is not stable. Also, either process will remove TWRP, root and any other modifications. Xposed is still not officially released for Nougat. It is up to you if you choose to re-lock your bootloader or not (of course, re-locking the bootloader will prevent you from flashing TWRP/root/any other modifications).
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 dsp adspso.bin
fastboot flash oem oem.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
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot reboot
pause
One word of warning, once you have formally updated to June 2017 (B1:06 bootloader), do not attempt to downgrade and accept OTA updates. You may wish to downgrade, but I don't recommend it - if you forget to not accept OTA updates, you may hard brick your device. If you think you'll forget, do not downgrade.
Hello to this amazing community,
I have recently tried for the first time to root my device.
Being unaware of the XDA community, I used this guy's guide - https://theunlockr.com/2016/11/29/root-motorola-moto-g4-moto-g4-plus/ .
As I went through the steps of unlocking, booting TWRP and installing superSU, I found out that the device won't start anymore, though the bootloader was still working at that point.
Unfortunately, that guide didn't emphasized the importance of first backing-up the system with TWRP.
Panicking, I even ended up wiping the entire device.
So I started my sisyphic journey of reviving the phone.
Being clueless of OEM stock versions etc. at this point, I thought that I should look for a fresh TWRP backup someone did after purchasing my exact Moto G4 Plus model - XT1644 so I ended up recovering the version that this dear guy has uploaded:
https://forum.xda-developers.com/moto-g4-plus/how-to/moto-g4-plus-xt1644-stock-unmodified-6-t3536448
Happy as I was that the machine would finally start, I found out I was running an old Marshmallow version - exactly as the title says.
Still, I assumed that new OTA versions will be available and my device will be upgraded to the most up-to-date version.
Surprisingly for a rookie as me, checking for software updates showed " Your device's software is up to date".
So I search for a more up-do-date OEM stock version, and I have found the following version - NPJS25.93-14-13 here:
https://forum.xda-developers.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138
I ran the bash file to flash the OEM while keeping the device unlocked.
The device has loaded finally with the familiar up-to-date version, and an available OTA update appeared.
I immediately ran the update.
That's when I first became familiar with the term "Brick". The device became completely dead.
Now, thanks to siddhesh9146 inceredible thread I managed to revive the device:
https://forum.xda-developers.com/moto-g4-plus/how-to/moto-g4-plus-hardbrick-solved-guide-t3657761
I went through his steps, installed BlankFlash, flashed the latest gpt and bootloader and flashed version NPJS25.93-14-10.
The device will finally work! I would realize then, that the latest version is actually ATHENE_NPJS25.93-14-13 ,
And again, the device won't show any updates available.
So, finally, here are my questions:
1. What could I have done wrong in first place? Was it a wrong superSU version that caused the problem? (In case my rooting aspirations will return)
2. What caused the device to turn brick? I realize it has to do with downgrading version, but after I wiped the device, I only upgraded versions.
3. In general, when OTA are available? Only the newest stock version would receive OTA? Will I have to manually upgrade versions from now on?
4. Could I upgrade now to NPJS25.93-14-13 using the version that siddhesh9146 presented without wiping my entire phone? What exactly should I flash to do so?
5. What are the precautions I have to take while doing so? Is there a risk my phone will tun brick again?
Thanks!
Good to hear your device is working again, seems like it's been through a journey.
1)When you originally rooted, were you on stock Nougat (7.0)? If so, those rooting guides will not work and are likely for Marshmallow 6.0 systems only. What they fail to mention is that attempting to root whilst still on the stock Motorola Nougat kernel likely causes your device to not boot. The Nougat 7.0 stock kernel for our devices seems to be much stricter than the Marshmallow kernel when it comes to anti-rooting protections. Thus, we generally need to flash a custom kernel onto our devices before rooting - either with SuperSU or magisk. An example of a working guide for rooting on stock Nougat Moto G4/Plus is here: https://forum.xda-developers.com/mo...de-root-moto-g4-plus-supersu-android-t3587918
2)Do you remember what the OTA you received was? I don't think there's an OTA for a build later than NPJS25.93-14-13 out yet. That suggests that the NPJS25.93-14-13 flash didn't work - did you check if the bash script reported [OKAY] after each command? By brick, do you mean the device had a blinking LED light, and there was no screen, and you were unable to boot to the bootloader and/or recovery? If the flash didn't work, then you may have taken a Marshmallow to Nougat OTA (NPJ25.93-14) which may have corrupted your device bootloader in the process.
3)OTAs are generally available for a particular build and for a particular software channel when they are released. For NPJS25.93-14-13, that's currently the latest build for EU/UK, Brazil and India devices, and there's word that there's a February 2018 OTA coming soon (no sign of it yet).
However, for your device (XT1644), if you are on the retUS - retail US - software channel, your device is on a different update path - NPJ25.93-14.7 would be the corresponding September 2017 patch for retUS software channel devices. NPJS25.93-14-10 is not one of the builds deployed to the retUS, and as such the Motorola servers may not issue you an OTA patch, regardless of whether the firmware would work. There have been reports of NPJS25.93-14-10 and NPJS25.93-14-13 working on US devices without issue, but you may not receive OTA updates.
You could manually update to NPJS25.93-14-13 using the OTA here, provided that you fully flashed the NPJS25.93-14-10 stock ROM (including GPT and bootloader, system, modem, boot, recovery, OEM, DSP, FSG). If you did not fully flash, you may be risking another hardbrick. https://forum.xda-developers.com/showpost.php?p=74973505&postcount=7
4)If you want to flash the NPJS25.93-14-13 stock ROM to be safe, or attempt to cross flash to the Sept 2017 NPJ25.93-14.7 firmware without wiping your data, you can use the following flashing commands. Be warned that you may have to factory reset if your device becomes unstable, so backup anyway. I would recommend manually flashing these commands:
a)copy and paste the first command to the ADB terminal
b)press enter, wait for [OKAY] to appear.
c) copy the next command, individually and in order, to the terminal, repeat b) and c) until you get to the end of the list.
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 dsp adspso.bin
fastboot flash oem oem.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
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot reboot
These commands omit the fastboot erase userdata, preserving your data, and omit the OEM locking commands, which would lock your bootloader and erase your data in the process as well. Bear in mind that cross flashing can be risky, however, you may have to flash the NPJ25.93-14.7 update if you wish to receive OTA updates for the retUS software channel, if you are on that software channel. Link for the NPJ25.93-14.7 stock firmware if you wish to try: https://androidfilehost.com/?fid=817906626617945295
5)Generally, the main source of hard bricks I've noted has been users have been on stock Nougat (particularly the March 2017-latest) builds. They downgrade their device to stock Marshmallow firmware, which goes okay. However, in most - if not all - cases, their bootloaders are not downgraded, so you have a system and bootloader mismatch, with a newer Nougat bootloader but an older system than their bootloader patch level. For example, a B1:06 June 2017 patch level bootloader but a July 2016 Marshmallow system patch level.
The OTA checks that are performed are mainly on the system side i.e is your device on the July 2016 system patch? Are your system, OEM, recovery, boot etc. partitions unmodified and match the expected checksums for this OTA patch? If so, then install. However, in the updater script, there is no such check for the bootloader - the OTA updates appear to assume your bootloader is of the same patch level as your system. Normally, for a locked bootloader or for a user that has only updated their device, that assumption holds.
The issue we have here is that the system was downgraded to Marshmallow, so that assumption no longer holds. As the OTA updates are signed by Motorola, they have authorisation to write to your bootloader. That means this OTA can overwrite your bootloader, and if it's applying older code, can corrupt your newer Nougat bootloader and thus hard brick your device, which necessitates a blankflash to repair.
In other words, if you downgrade your device firmware, do not use or install OTA updates. If you do downgrade, only update with stock firmware that is as new or newer than your bootloader patch level. If your device is on the same patch level , then you should be able to use OTA updates. However as mentioned above, you need to be on the correct build for your device software channel as well to receive OTA updates from Motorola.
I tried a bunch of things in an attempt to root AT&T's LG K20 (the LGM255), to no avail.
After unlocking bootloader (so says in the options, I don't think it actually did), I tried fiddling with Lekensteyn's LGLAF tool and various forks of it by steadfasterX and others. Tried pushing a TWRP image I made after being able to extract boot/recovery images using the aforementioned tool. LAF did not pushing that image but was fine with deleting partitions from the phone.
I took the risk of deleting the LAF partition in order to get access to fastboot. While it did, just my luck, the lk variant of fastboot on the phone is stripped of essentially all functionally except for get-var and devices. Meaning I cannot flash anything, or modify any variables.
Have no means to restore the LAF partition (well, there is one way I know of possibly, but want to save it as a last resort cause the probability it would work is low and risks bricking completely).
Now there is an lafbak partition, but cant do anything with it.
Theres some background, but here is my real question:
If I were to accept an FOTA update from AT&T, although it would update the firmware to a new version, would it restore or possibly flash a new LAF partition so that I could go into its LAF/Factory Reset mode again?