Official Moto X Stagefright Patched Libs!

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
I just got to the OTA. I flashed a stock recovery.img, unrooted and uninstall xposed but the OTA still errors during install. What process should I be performing in order to install the OTA?
I'm not sure what other files I'm supposed to flash, I also flashed the boot and system img files but OTA still errors.
Have you tried using the fastboot commands to erase everything, then flashing?

Here are the steps I had to perform...

1) Backed up my data then transferred it to my PC
2) Booted into the Bootloader
3) Used fastboot to wipe the userdata and cache partitions
  • fastboot erase cache
  • fastboot erase userdata
4) Downloaded the Stock 5.1 Image and used RSD-Lite to flash it*
*remember to remove the var max data line from the flashfile.xml
5) Booted the phone and didn't input my Google account
6) Downloaded the OTA and applied it
7) It finishes the update successfully and reboots and you should be good to go! :good:
 

Benoe

Senior Member
Dec 15, 2006
114
38
0
I get this message, when I try to sideload the OTA in factory recovery:
"/system/app/3c_main/3c_main.apk" has unexpected contents."

I have an XT1053 DE, and previously restored everything: system, boot, recovery, but haven't erased userdata yet.

Why do we need to remove the var max data line?
 

ohmimpotence

Senior Member
Feb 27, 2013
88
5
0
so you're saying there was no way for you to update without erasing user data? couldn't I just patch the libs or would that not remove the update notification?
 

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
I get this message, when I try to sideload the OTA in factory recovery:
"/system/app/3c_main/3c_main.apk" has unexpected contents."

I have an XT1053 DE, and previously restored everything: system, boot, recovery, but haven't erased userdata yet.

Why do we need to remove the var max data line?
This line prevents the system image from flashing correctly (as it's too big to flash with fastboot)

so you're saying there was no way for you to update without erasing user data? couldn't I just patch the libs or would that not remove the update notification?
That's why I said make a backup first... use TWRP and make a data backup, transfer it to your PC for safe keeping, then wipe out everything on your phone, then after you have the patch successfully applied, re-root and TWRP it and restore your data backup
 

ohmimpotence

Senior Member
Feb 27, 2013
88
5
0
I don't see a var max line in my copy of that file, GHOST_RETAIL_5.1_LPA23.12-15_cid9_CFC.xml.zip. The stock image I got from Motorola doesn't even have an xml file, TMO_Retail_XT1053_5.1_LPA23.12-15.222.21.15.ghost_row.Retail.en.US. Dunno if this is an issue?
 
Last edited:

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
Forgive me for asking but how extensive is TWRP backup? Will everything be back to normal or do I will I need to restore some app settings? I'm just surprised there needs to be a complete wipe for this OTA whereas the Nexus frequent OTAs lately haven't been as much of a hassle.
The reason why is because it seems like unlocking the bootloader modified the SP partition (or flashing TWRP did), once you do that, you could have headaches with OTA's
The data partition is all of your data from applications, so it should have everything, if not, make a complete backup, including system and everything else

To back up via TWRP, I have to back up to internal storage first and then copy that to my PC, yes?
Correct
 
Last edited:
  • Like
Reactions: ohmimpotence

ohmimpotence

Senior Member
Feb 27, 2013
88
5
0
Thanks, I thought rooted Lollipop was a pain with updating the Nexus, this makes that look like a breeze though. All this for the stupid stagefright fix, hopefully there's some decent bug fixes with it.

Now I'm just wondering about the var max data line..
I don't see a var max line in the stock image linked, GHOST_RETAIL_5.1_LPA23.12-15_cid9_CFC.xml.zip. The stock image I got from Motorola doesn't even have an xml file, TMO_Retail_XT1053_5.1_LPA23.12-15.222.21.15.ghost_row.Retail.en.US. Dunno if this is an issue or what the difference is between these two files.
 

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
Thanks, I thought rooted Lollipop was a pain with updating the Nexus, this makes that look like a breeze though. All this for the stupid stagefright fix, hopefully there's some decent bug fixes with it.

Now I'm just wondering about the var max data line..
I don't see a var max line in the stock image linked, GHOST_RETAIL_5.1_LPA23.12-15_cid9_CFC.xml.zip. The stock image I got from Motorola doesn't even have an xml file, TMO_Retail_XT1053_5.1_LPA23.12-15.222.21.15.ghost_row.Retail.en.US. Dunno if this is an issue or what the difference is between these two files.
You have to extract the zip to see the flashfile.xml inside, this is the file you use with RSD-Lite
Inside the xml is the line <step operation="getvar" var="max-download-size"/> delete it and then use that xml file in RSD-Lite

I didn't use Motorola's stock Recovery image, as I think there is something wrong with it, but I never got to verify that seeing how the other zip file solved my problem
 

klav29

Member
Nov 15, 2011
8
0
0
I'm confused, is it posible to upgrade my Moto X using the libs or not?

This is my OS 222.21.15.ghost_row.Retail.en.US XT1053

I tried OTA but it failed as others have commented, it would go to recovery.
Solution was to rename upgrade file so it would not find it. After that everything was ok and back to normal.

So, how can I upgrade?
 

aysiu

Senior Member
Feb 26, 2011
58
9
0
I tried backing up my data and doing a total factory reset (with the instructions below from Motorola). Didn't sign into my Gmail account or do anything else except check for an update. The update downloaded, and then it error'ed out again when installing.

Is there absolutely no way to get this update installed if you are unrooted with stock recovery but also have an unlocked bootloader?

After downloading the image for your device:

Make sure you have a Moto Pure Edition or a Developer Edition device.
Make sure you download the corresponding recovery image from the above portal.
To flash, put the phone in fastboot mode: 1. Power OFF your device
2. Then Power ON + Volume Down Alternatively, you can reboot into fastboot mode if you have adb...adb reboot bootloader.
Next flash the images using fastboot: $ fastboot flash partition gpt.bin
$ fastboot flash motoboot motoboot.img
$ fastboot reboot-bootloader
$ fastboot flash logo logo.bin
$ fastboot flash boot boot.img
$ fastboot flash recovery recovery.img
$ fastboot flash system system.img
$ fastboot flash modem NON-HLOS.bin
$ fastboot erase modemst1
$ fastboot erase modemst2
$ fastboot flash fsg fsg.mbn
$ fastboot reboot You also have the option to erase all the data on your device with $ fastboot erase userdata
$ fastboot erase cache
After performing this sequence, you can relock your device with $ fastboot oem lock
 

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
I'm confused, is it posible to upgrade my Moto X using the libs or not?

This is my OS 222.21.15.ghost_row.Retail.en.US XT1053

I tried OTA but it failed as others have commented, it would go to recovery.
Solution was to rename upgrade file so it would not find it. After that everything was ok and back to normal.

So, how can I upgrade?
Yes, you can use the libs to patch Stagefright if you really wanted to

However, if you have the XT1053 (like you have), it's better to flash the 222.27.5 OTA update, as it fixes the issue along with other problems

Read the previous posts to understand how to fix the problem if the OTA will not flash
 

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
I tried backing up my data and doing a total factory reset (with the instructions below from Motorola). Didn't sign into my Gmail account or do anything else except check for an update. The update downloaded, and then it error'ed out again when installing.

Is there absolutely no way to get this update installed if you are unrooted but also have an unlocked bootloader?

After downloading the image for your device:

Make sure you have a Moto Pure Edition or a Developer Edition device.
Make sure you download the corresponding recovery image from the above portal.
To flash, put the phone in fastboot mode: 1. Power OFF your device
2. Then Power ON + Volume Down Alternatively, you can reboot into fastboot mode if you have adb...adb reboot bootloader.
Next flash the images using fastboot: $ fastboot flash partition gpt.bin
$ fastboot flash motoboot motoboot.img
$ fastboot reboot-bootloader
$ fastboot flash logo logo.bin
$ fastboot flash boot boot.img
$ fastboot flash recovery recovery.img
$ fastboot flash system system.img
$ fastboot flash modem NON-HLOS.bin
$ fastboot erase modemst1
$ fastboot erase modemst2
$ fastboot flash fsg fsg.mbn
$ fastboot reboot You also have the option to erase all the data on your device with $ fastboot erase userdata
$ fastboot erase cache
After performing this sequence, you can relock your device with $ fastboot oem lock
If you have an unlocked bootloader, you will have to follow the procedure listed in the post I linked you

Did you not use RSD-Lite?
  • Use RSD-Lite to do your fastboot commands
  • Use the zip file that was uploaded, don't use Motorola's Recovery Image zip

If you follow the instructions listed completely, and it doesn't work, let me know, then I can do more troubleshooting
 

aysiu

Senior Member
Feb 26, 2011
58
9
0
Did you not use RSD-Lite?

Use RSD-Lite to do your fastboot commands
Use the zip file that was uploaded, don't use Motorola's Recovery Image zip


If you follow the instructions listed completely, and it doesn't work, let me know, then I can do more troubleshooting
I didn't see a Mac version for RSD Lite. What does it do that the Motorola instructions for flashing don't? Is there particular command I can run?
 

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
I didn't see a Mac version for RSD Lite. What does it do that the Motorola instructions for flashing don't? Is there particular command I can run?
You can try to use a version of mfastboot that supports larger files, but I wasn't successful with that method

However, I didn't try using mfastboot with the uploaded zip, only with the Motorola Recovery Image zip
 

aysiu

Senior Member
Feb 26, 2011
58
9
0
You can try to use a version of mfastboot that supports larger files, but I wasn't successful with that method

However, I didn't try using mfastboot with the uploaded zip, only with the Motorola Recovery Image zip
I did use the moto-fastboot, because the regular fastboot can't flash the system.img. It was "successful" in terms of running all the commands successfully and booting to a working Android OS. The only unsuccessful part has been installing the OTA update afterwards.
 

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
I did use the moto-fastboot, because the regular fastboot can't flash the system.img. It was "successful" in terms of running all the commands successfully and booting to a working Android OS. The only unsuccessful part has been installing the OTA update afterwards.
Which is why I have stated that I have only tested the instructions that I have put here, and it works on my end

You would have to test the instructions with using fastboot commands to see if it works, if it doesn't, then you know you might have to use a windows based computer to be able to use RSD-Lite in order to apply the OTA

You did try using the uploaded zip files right for 5.1? Not the Motorola Recovery Image files, as I seriously think that there may be something wrong with the system.img file in the Motorola 5.1 Recovery Image zip
 
Last edited:

aysiu

Senior Member
Feb 26, 2011
58
9
0
Which is why I have stated that I have only tested the instructions that I have put here, and it works on my end
No, I totally get that. Because it worked for you or for other people doesn't guarantee it will work for me.

You would have to test the instructions with using fastboot commands to see if it works, if it doesn't, then you know you might have to use a windows based computer to be able to use RSD-Lite in order to apply the OTA
Well, that may not be an option any time soon, but I'll keep it in mind.

You did try using the uploaded zip files right for 5.1? Not the Motorola Recovery Image files, as I seriously think that there may be something wrong with the system.img file in the Motorola 5.1 Recovery Image zip
No, I was using the factory image straight from Motorola. What upload is this and where do I get it?
 

needleyepoke

Senior Member
May 3, 2010
111
12
0
Loveland,Co
For some reason I have not been able to get rsd lite to recognize any of my motorola phones... I have 2 moto x xt1053 and a atrix HD using Windows 10 but it wasn't working with Windows 8.1 either. So the only way I've been able to flash any of my phones were manually.. And not sure if that's why I can't get the new update to take
 

mastarifla

Senior Member
Oct 3, 2010
485
293
0
Dallas, TX
No, I was using the factory image straight from Motorola. What upload is this and where do I get it?
I had it in post 41, here is the link again

http://motofirmware.center/files/file/274-ghost_retail_51_lpa2312-15_cid9_cfcxmlzip/

For some reason I have not been able to get rsd lite to recognize any of my motorola phones... I have 2 moto x xt1053 and a atrix HD using Windows 10 but it wasn't working with Windows 8.1 either. So the only way I've been able to flash any of my phones were manually.. And not sure if that's why I can't get the new update to take
I think it has to do with the the Recovery Image Motorola posted, I had to use another zip file (basically another system.img) and flash it with RSD-Lite in order for the OTA to flash successfully
 

aysiu

Senior Member
Feb 26, 2011
58
9
0