yashsingh1/xdaforums huggingface dataset:
[Moto X General] mastarifla:
Ahh my bad, I forgot that I also used some of the AT&T libraries that may have had some fixes as well

So I went ahead and uploaded all of the stagefright libraries that were in my system/lib folder :)
[Moto X General] Kiristiba:
Ok, that did it, stagefright is fixed but there is something wrong now.

I cannot watch videos on YouTube or TED. I have a xt1053 running the Brazilian soak release flashed via twrp.
[Moto X General] Njrani6:
Im pass
[Moto X General] mastarifla:
Ahh interesting, it seems I am running into the same issue...

I'm downloading the 5.1 Brazilian stock 5.1 image and am going to try using those libs and the 6 patched libs to see if it fixes stagefright and allows you to watch youtube

EDIT: Success! I replaced the commonly used encoder/decoder libraries with their stock versions and I can watch Youtube, TED, and am not vulnerable to Stagefright :)

EDIT2: The OP zip has been updated!
[Moto X General] Kiristiba:
Yaeh, your are right, stagefright is fixed and videos are working, big thx ?
[Moto X General] _litz:
Worth noting ... the new VZW 5.1 release already includes patched libs ... so you don't need to do this if you have a XT-1060 and the VZW upgrade.
[Moto X General] mastarifla:
Correct

This is mainly for the Developer Edition & US Retail (XT1053) and GSM XT1058 Users, who are still waiting for a full patch for Stagefright, this will fix them until that OTA arrives :)
[Moto X General] ufukcoskun:
My XT1053 got these updated libs too.
[Moto X General] sisterchick:
WARNING!

Be careful! Took this patch on XT1053 and got stuck at boot. Ended up having to flash stock 5.1 ROM to get the phone working again.
[Moto X General] mastarifla:
Did you have a stock system directory? You would need to revert the libraries to the stock 5.1 version in order to successfully take the OTA
[Moto X General] sisterchick:
Yes, I did. Only change was TWRP recovery, but I restored to stock before taking the OTA.
[Moto X General] mastarifla:
Ahh then I am not sure why you phone would refuse to boot, you could attempt to re-flash the stock image and delete your user data then try the OTA and see if it sticks, otherwise we may have to wait for another release :/
[Moto X General] kicker22004:
So this won't work on 4.4.4, will cause phone to not boot past bootloader. Even after returning using a system backup I had weird issues with Google services. But got it back to normal. This is on a Republic Wireless version. Thanks for the patch tho.
[Moto X General] mastarifla:
Ok, thanks for the clarification, I'll add it to the OP that this wont work for KitKat
[Moto X General] Emiliano55:
Weird, I have an unlocked XT1053 dev edition with (i think) the AT&T rom (222.21.15.ghost_row.Retail.en.US) and I still didn't get the update.
[Moto X General] Zaphodbblx:
Same here!

I'm running the 5.1 stock "debloated" XT1053 flashable rom available here on XDA(222.21.15 ghost_row.retail.en.us). On a unlocked gsm developer edition. So I won't be taking any ota updates.

Anyhow....

When I switched out the stage fright files and checked it came back as immune but the first time the phone rebooted It hung at the boot loader.I Had to dirty flash the rom to get it working again.
[Moto X General] mastarifla:
You made sure that the permissions were set correctly right (rw-r-r)? You may also have to clear your cache, because if it has the old libraries cached then it would try to load those cached libraries instead of making a new cache with the new libraries, causing it to freak out when trying to boot up

I didn't see this because I always tend to clear the cache when I make any system changes, plus I also used GravityBox's Soft Reboot a few times too, I think Xposed has a Soft Reboot option as well in the Installer APK
[Moto X General] Zaphodbblx:
AHHHH!

no I didn't clear the cache & yes I did reset all the permissions to rw-r-r I don't know why I didn't clear the caches first, it seems like good idea though that's likely why it never crossed my mind. Did you do this from recovery or should I use a cleaner app to do it prior to reboot?

Feeling a little skittish now though because I couldn't even get recovery to boot until I tried it 5 or 6 times! (arrrgh)

I don't have a soft reboot option though is that important?

thanks for the imput
[Moto X General] mastarifla:
I did it from Recovery, no need to do any pre-cleaning if you are going to wipe the cache in Recovery :)

If you are concerned, I would just wait for the patch (if you have an XT1053), as it is in the wild just nobody has captured the OTA for it yet

Soft reboot isn't required, it basically reboots the phone quickly without having to re-compile ART, making a reboot take 30 seconds rather than 15 minutes, which I think is pretty cool
[Moto X General] Zaphodbblx:
Thanks

Yeah I think I'll wait till the op of the flashable rom catches the OTA. Anyhow I can't seem to change permissions now although rootchecker pro says I have full root. I changed them in the system folder last time but tried to do it "downloads" so that might be the issue. I've disabled prefetching of mms content so I should be okey dokey for now.

Thanks for all your help.
[Moto X General] mastarifla:
Yea it seems like you cant change/edit permissions for files on the "SD card," I'm not really sure why this is... but I always had to move files to the system directory before I was able to edit the permissions
[Moto X General] Kiristiba:
After I had switched the lib files i didn't clear the cache and had no reboot problem.

Are you sure you didn't change something else too since the last reboot?

I think you can not change permissions on the sdcard because it normally uses the fat32 Filesystem which has no support for file permissions.

The permissions you see depend on the way the filesystem gets mounted by the system.
[Moto X General] Threenot7:
I am using xt1052 , stock lollipop, i too can flash it ryt, or i need brazilian rom?
[Moto X General] whgp:
i'm receive this update its 5 mb not 2mb

anyway after download it its restart my device to wtrp i find upgrade file on /cache folder

but after choosen failed upgrade !

my device rooted with xposed installed

any help :confused:
[Moto X General] mastarifla:
Did you capture the OTA? Could you possibly upload it here?

It failed because you are on TWRP and are rooted/Xposed, you have to go back to complete stock if you want to use the OTA
[Moto X General] Zaphodbblx:
No changes

Nope I checked that the patch showed as not vulnerable (with zimperion stage fright

Checker) then rebooted right away. Although it may be that that's what did it.

I had to reboot into recovery about 5 times before it actually loaded and then reflashed the ROM and factory reset. Haven't tried it again I've pushed my luck enough for this week!
[Moto X General] whgp:
I'm Back to stock v5.1 but no Stagefright Patch :( show me your device updated .

how received update again??

thanks
[Moto X General] mastarifla:
Did you not make a backup after you got the OTA? Is it not still in the cache? :(

You have to wait for them to re-send the patch
[Moto X General] whgp:
Unfortunately no

try update it quickly,and wiped Cache inadvertently :crying:
[Moto X General] Emiliano55:
Finally, the new update arrived via OTA to my XT1053 dev edition a few minutes ago. Build is 222.27.5.

When I get home i will install it and lets hope the part of "bug fixes and stability improvements" is true.
[Moto X General] tuto3324:
I need som help from you, guys.

The update prompted today, i downloaded the patch and accepted to install the update. The problem is that i forgot that i currently have twrp recovery installed and now the phone reboots into recovery after a while everytime i turn it on.

Is there a way to stop it from rebooting into recovery everytime?

---------- Post added at 12:41 PM ---------- Previous post was at 12:03 PM ----------

Nvm, i solved it by cleaning cache and dalvik, just in case someone have the same problem.
[Moto X General] danny.sunju:
I am on stock rooted with TWRP and xposed installed. Should I go back to stock recovery before installing this update or can I just install it right away?
[Moto X General] Emiliano55:
The new OTA udpate is just 9MB!!! I can't believe it. I thought it was going to really fix issues and improve battery/etc but being just 9MB I think it's only about the stagefright vulnerability issue :(
[Moto X General] whgp:
I am received just 5MB :rolleyes:
[Moto X General] Emiliano55:
I guess it depends on the build and the Moto X release. I'm running a retail-en-us version and the build I received is 222.27.5.

I know that the BR version received the 222.26.something....
[Moto X General] ohmimpotence:
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.
[Moto X General] mastarifla:
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:
[Moto X General] Benoe:
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?
[Moto X General] ohmimpotence:
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?
[Moto X General] mastarifla:
This line prevents the system image from flashing correctly (as it's too big to flash with fastboot)

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
[Moto X General] ohmimpotence:
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?
[Moto X General] mastarifla:
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

Correct
[Moto X General] ohmimpotence:
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.
[Moto X General] mastarifla:
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
[Moto X General] klav29:
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?
[Moto X General] aysiu:
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
[Moto X General] mastarifla:
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
[Moto X General] mastarifla:
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
[Moto X General] aysiu:
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?
[Moto X General] mastarifla:
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
[Moto X General] aysiu:
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.
[Moto X General] mastarifla:
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
[Moto X General] aysiu:
No, I totally get that. Because it worked for you or for other people doesn't guarantee it will work for me.

Well, that may not be an option any time soon, but I'll keep it in mind.

No, I was using the factory image straight from Motorola. What upload is this and where do I get it?
[Moto X General] needleyepoke:
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
[Moto X General] mastarifla:
I had it in post 41, here is the link again

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

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
[Moto X General] aysiu:
So the system.img in this .zip file should be better?

I'll give that a shot later. Thanks.
[Moto X General] needleyepoke:
Downloading now
[Moto X General] Benoe:
I have no succes installing this OTA, neither with "official" recovery, nor with the recovery linked in post 41. I made my phone totally stock beforehand, cleared userdata, but it doesn't help.
[Moto X General] mastarifla:
Even with using RSD-Lite instead of fastboot commands? If so, then there is something bigger going on, and I think it has to do with the SP partition
[Moto X General] needleyepoke:
That worked.. But I had to use a different computer of mine with Windows 7
[Moto X General] mastarifla:
So then I take it you used RSD-Lite and the uploaded zip file? Or did you use the uploaded zip and fastboot commands?
[Moto X General] aysiu:
mastarifla, thanks for your patience on this. Sometimes it can be a bit frustrating to try about four or five different things to have it all fail, so I may have appeared to be a flailing, clueless novice.

I finally got it working with a modification of your instructions. Mac users don't have RSD Lite, but manual commands can work. Based on the XML file in the download you linked to, I was able to get these commands out (which are similar to the commands for the build from the Motorola website that doesn't work—P.S. I did an md5 check on both system.img files, and they're definitely different).

I also tried various combinations of just wiping cache and user data, just wiping those and then flashing recovery and system. Nope. In order to get it to work, I had to download the build you linked to, put the phone into fastboot mode (hold down the Down volume key while powering on and then USB-connect to the computer) and then run all these commands in this order (I had the moto-fastboot-osx64 from a separate download, which I put into the same folder as the extracted .zip file... the md5 on it is ddafff4d9050a3ec8dfa8e592f3a34cc):

./moto-fastboot-osx64 erase cache
./moto-fastboot-osx64 erase userdata
./moto-fastboot-osx64 flash partition gpt.bin
./moto-fastboot-osx64 flash motoboot motoboot.img
./moto-fastboot-osx64 flash logo logo.bin
./moto-fastboot-osx64 flash motoboot motoboot.img
./moto-fastboot-osx64 flash logo logo.bin
./moto-fastboot-osx64 flash boot boot.img
./moto-fastboot-osx64 flash recovery recovery.img
./moto-fastboot-osx64 flash system system.img
./moto-fastboot-osx64 flash modem NON-HLOS.bin
./moto-fastboot-osx64 erase modemst1
./moto-fastboot-osx64 erase modemst2
./moto-fastboot-osx64 flash fsg fsg.mbn
./moto-fastboot-osx64 erase customize
./moto-fastboot-osx64 erase clogo
./moto-fastboot-osx64 oem fb_mode_clear

The OTA update seems now to have taken.

Thanks again for your patience. It may have seemed like a lot of handholding to you, but I'm grateful for your help.
[Moto X General] mastarifla:
I'm just glad that you were able to flash the update successfully :)

Enjoy the new patch!
[Moto X General] bigpoppa75:
Socratic Bliss it worked with using GHOST_RETAIL_5.1_LPA23.12-15_cid9_CFC.xml.zip instead of Motorola official firmware. I guest there issues with there software. Thank You Very much :D :good:
[Moto X General] klav29:
Thank you for the tip, but I have a question, is there a way to apply the upgrade without having to delete user data?
[Moto X General] jjohns63:
The only think I didn't do was erase /userdata; and I don't understand why that would have any effect. The update script is only hashing files in /system and /modem. Shouldn't flashing the stock system image be enough? Why are all my hashes different from the OTA immediately after flashing the stock system image?

I don't know what RSD-Lite is. I just used mfastboot to do the flashing of system.img extracted from the stock image.

EDIT: I was using the "stock" image downloaded from Motorola. I will try using the stock image you linked as it appears they are different somehow, despite identical build numbers.
[Moto X General] mastarifla:
The stock system image has a different hash, the zip that I linked to has the hash that the OTA is looking for, that's the difference
[Moto X General] jjohns63:
TBH, I'm leery of downloading a ROM from any source that isn't Motorola. Especially since the entire point of this patch is to fix a major security hole.
[Moto X General] mastarifla:
Then don't download it, and wait for Motorola to patch it, I'll be sitting pretty with the patch though :)
[Moto X General] mastarifla:
You can try the steps listed above by aysiu, otherwise you can make a backup of the data partition and restore it after you have applied the patch
[Moto X General] needleyepoke:
Yes I used rsd lite and the uploaded file... Then I used the update I caught earlier
[Moto X General] Benoe:
At first this method didn't worked for me, the OTA install hasn't succeeded. Then I realized I mistyped two commands:

./moto-fastboot-osx64 erase customize

./moto-fastboot-osx64 erase clogo

After I went back to bootloader, I entered those command correctly, and the OTA was taken!

So the key is somewhere here, we definately need to erase "customize" and "clogo" whatever those are.

At my previous attempts with the "official" firmware from motorola, I haven't used these commands, so I'm curious, If that would be the only thing that made the ota upgrade unsuccesful with that firmware
[Moto X General] Benoe:
I just tried, the process only works with the "external" firmware and with these commands (for me):

./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
[Moto X General] crpeck:
Is your Moto X unlocked or locked?

---------- Post added at 07:35 AM ---------- Previous post was at 06:54 AM ----------

YES!!! This process (using the Firmware mentioned above) worked on my unlocked Dev Edition. It took the update! Thanks folks!!! BTW - I did it using Linux, I don't have a Mac and I definitely don't do Windows ;)
[Moto X General] UncleMike:
I've been flashing the 5.1 images (L-5.1-LPA23.12-15 (Retail) LMR1) from Motorola's Re-lock your bootloader page and not only failing to re-lock the bootloader, but the OTA fails as well. I know that the linked download above contains different images that those available on Motorola's site, but my question is: should flashing the images you linked via fastboot yield the same results as flashing via RSD-Lite? I'm using a Linux machine and as far as I know there's no RSD-Lite for Linux.

Thanks for the link to this thread from that other place, and for the info.
[Moto X General] Benoe:
I'm on linux as well, and the fastboot method worked for me. See post #77
[Moto X General] mastarifla:
I'm glad you guys have been able to flash the update :)

I'll try to compile all the necessary steps and post in a new thread to help more people out, as this thread was mainly for the Stagefright libraries etc.