yashsingh1/xdaforums huggingface dataset:
[X 2014 Android Development] mikeoswego:
You don't need to do a full wipe unless you want to, the instructions I'm posting below will upgrade your phone while keeping your current config and apps. You'll want to download all the files I'll mention and have them on your phone where TWRP can find them (the Download directory is fine and in TWRP they'll be in /sdcard/Download.)

Reboot your phone into TWRP and don't reboot until all the following steps are completed.

Select backup from the TWRP main menu, make sure data, system, and boot are selected.

After the backup is complete, select Advanced Wipe from the TWRP main menu and select data, system, and cache then wipe.

Flash the following files in this order:

1) xt1096-23.32-25-5.modem.zip

2) xt1096-5.1-23.32-25-5_4.zip

3) xt1096-5.1-Rem-Xposed.zip

4) tk_gapps-stock-5.1.1-20151004-signed.zip

#1 will update your firmware files (modem, etc.)

#2 will install the Stagefright patched kernel and system image (including all the Moto/Verizon apps that you now have.)

#3 will remove Xposed (skip this step if I've misunderstood and you are using Xposed.)

#4 will install the full package of Google apps (these will be the other apps in the stock rom plus a few more.)

The file listed in #4 is usually updated once a week or so, the link may become invalid if you don't dl it soon.

After flashing everything, select Restore from the main menu. Chose the backup you just made, deselect boot and system; only data should be selected. Restore data. If you do want a clean install without restoring your setup, skip this restore of data.

Now you can reboot. It may take 4-5 minutes for your phone to start the first time after the upgrade.

Following these steps should result in your being updated without losing any of your setup. You'll have all the apps you have now plus some of the current Google apps that weren't included by Motorola. An advanced topic would be creating a .gapps-config file to not install everything in the stock TK GApps package but there are only a few things that weren't included in the Motorola rom and the phone has the capacity to easily handle everything.

If something goes wrong, you can use TWRP to restore data, system, and boot from the backup to get back to where you were before starting the upgrade process.
[X 2014 Android Development] GatorsUF:
You are awesome Mike, best dev on this forum! Thanks for the simple instructions.

I will do that as soon as I can, unfortunately I just tried and it said I need 12000kbs? and I only have 4000 available. Gotta figure out that situation first :)
[X 2014 Android Development] mikeoswego:
Do you have an OTG/USB drive? If so, put all the zip files on there and do your TWRP backup to the drive as well. Then you aren't limited by the storage in the phone. Or, move some pictures, music or other data off the phone to your computer temporarily.
[X 2014 Android Development] mulletcutter:
Fresh rom, pico tk, debloated, google play service just errors, almost impossible to setup. i had this rom running great before but was having problems so i wipped and cant get it back working again.
[X 2014 Android Development] mikeoswego:
This is the webview problem. Just to verify, the rom you are trying to install is xt1096-5.1-23.32-25-5_4.zip?

If so, please try flashing the TK Gapps webview addon which is available here (until the next update): tk_gapps_googlewebview-addon-5.x-20150920-signed.zip

It would be helpful if you could send me your tk_gapps_debug_logs.tar.gz before flashing the webview addon. It will be in the same directory as your TK GApps .zip file.
[X 2014 Android Development] mulletcutter:
i tried to install 23.32-25-5_4 but i couldnt get service on setup so couldnt log into my gaccount. ive even tried CM12.1 but still pretty much getting same google errors. If i install the 20150820 rom which gapps do i use? im using the ones from 20150920 tk, do i also flash the webview addon right after i flash gapps?
[X 2014 Android Development] mikeoswego:
Ok, just to make sure we are on the same page. Previously, whatever version you installed would fail on setup by force closing before you could complete the setup. Now, the setup is working but you don't have any data service to authenticate your login to Google. The first problem is the webview problem which I think is fixed in the _4 version of the rom. The lack of data service is different problem.

The 20150820 version does not contain the Stagefright patch (I don't remember if it had the webview problem with TK GApps.) You would use the same TK GApps with any of the TWRP flashable versions.

But lets back up. Did you do the Stagefright update? There are updates to the modem files in the update. I know you can update the modem files and still use the old rom but don't know if you can use the current rom without updating the modem files.

The TWRP zip to update the modem files and instructions are in post 781. If you haven't done that update, that could explain the problem your currently having with both this rom and CM 12.1.
[X 2014 Android Development] justinjbaron:
Hi all

Firstly Mike thank you for your dedication to this platform.

I was able to successfully install the latest ROM and TK Gapps via TWRP and am running great on 5.1.

But I received an error when trying to flash the modem firmware from post 781 in TWRP before flashing the ROM and Gapps. I don't recall specifically what the error was but TWRP quickly voiced the error in red text after tried to flash. Should I have manually mounted anything special in TWRP prior to flashing? Anyone have any ideas? Can I flash it now, after I've already got up and running on the ROM?

Also, my phone is now asking me to take the OTA. I didn't run the optional debloat package after flashing. is that the only way to disable OTAs or is there a manual method? I've manually debloated some things since the install but not sure how to stop the OTA checks.

Thanks for any advice!

JB
[X 2014 Android Development] mulletcutter:
I flashed the modem before and the stagefright update before but made my phone laggy, so i just nandroid' back. My baseband is MSM8974BP_4235210.110.09.13R, do i flash the modem still?

I factory reset + wipe system - flash xt1096-5.1-23.32-25-5_4.zip / tk gapps 20150920 ( or the 20150927 version?) / tk_gapps_googlewebview-addon-5.x-20150920-signed.zip then reboot?
[X 2014 Android Development] drewski_1:
That's the baseband I have w/ Stagefright patches and such so i think you're good. [emoji317]

Sent from my Moto X
[X 2014 Android Development] mikeoswego:
The modem.zip file contains a couple complete files but the rest is patch files. Those patches must be applied to the correct original file or else mayhem will result. The fist thing the modems.zip script does is check each of the files it is going to patch and if any of them aren't correct, there will be an "unexpected contents error." This part of the script comes directly from the Motorola update OTA.

If you get that error when trying to flash it with TWRP, then one of the following is true:

1) At some point you already ran the modems updater for the Stagefright patch (or updated via some other means.)

2) You are still running the 5.0 modem files and upgraded to the current rom without following the 5.1 upgrade process.

3) You are still running 4.4.4 modem files and managed to get to the current rom.

Unfortunately, the baseband version is the same for the 5.1 and 5.1 Stagefright patched rom (MSM8974BP_4235210.110.09.13R). The baseband version is different for the 5.0 (or 4.4.4) files. Whatever you have for your baseband under Settings->About phone might answer which of these things might have happened. It also won't hurt anything to flash the modem.zip file again to see what the error is. Nothing special needs to be set in TWRP to flash it.

As for the OTA question, try using Advanced Wipe in TWRP and select Cache and wipe that, reboot. Using the full debloat will remove the MotoOTA app and many people say that handles the software OTA in addition to it being required for Motorola Connect to work. I usually have that removed and have never been offered an update. Of course if you are up to date, it shouldn't offer you one anyway. If the update was already dl'd, then it might see that and not bother checking versions. If dl'd already, it is in /cache and that is why it needs to be wiped.
[X 2014 Android Development] mikeoswego:
See previous post about the baseband versions being the same for both the original 5.1 version and current Stagefright patched version. Only some of the files in the the modem partition where patched, most of them looked to be DRM related stuff and not related to how the radios actually transmit to the network which is the baseband. The modem flash is permanent and is not undone by factory reset, or any kind of wipe in TWRP.

When I want to start a clean system:

In TWRP->Advanced Wipe Select Boot, Data, System, Cache (this is a factory reset without wiping sdcard)

Then flash xt1096-5.1-23.32-25-5_4.zip, then either of the tk gapps you list above. It won't hurt to flash the webview addon but you really shouldn't have to. Reboot.

In testing, I have done exactly this on my phone with the xt1096-5.1-23.32-25-5_4.zip, using the mini tk gapps (those should be identical in function to the pico or micro gapps as far as the install/setup) and no webview addon and everything worked fine.

If you don't flash the webview addon and things malfunction, start over with the wipes, and include the webview as the last flash. If it does work then, it will be helpful information.
[X 2014 Android Development] RyanBRZ:
I was running a 5.1 build from shortly after you posted it for the first time (maybe late June?). I just flashed the stagefright patched ROM and I keep getting force closes of google apps. I'm guessing I need to re-flash google apps? How would I go about flashing updated google apps? I did not instal TWRP, I flash strictly with mofo at the moment.

If it will make life easier going forward then I'll install TWRP. I used nothing but TWRP when I had a Galaxy S3. Can I follow the instructions here to get TWRP installed, then flash a TK Gapps package and be done with it?

Thanks!

---------- Post added at 08:56 AM ---------- Previous post was at 08:29 AM ----------

I was following instructions in the first post under. "Installing sunshine, twrp, etc". Now I didn't install sunshine, but thought I could follow steps for TWRP. Can I flash TWRP in fastboot? I tried and am geting 'Mismatched partition size (recovery)" message. Did I brick my phone? I'm afraid to attempt a reboot, I'll keep it in fastboot until I hear back :(

Ok so I was impatient and I tried a boot and was able to reboot into Android. I think the TWRP install failed though.
[X 2014 Android Development] mikeoswego:
Did you wipe /cache and the folders in /data/dalvik-cache with your root file explorer? If not, give that a try. If there is still a problem, try going into Settings->Apps, look for and select the Google App and use the wipe cache and wipe data buttons.

Unless you have blocked updates in the Playstore, you should have the latest (or at least a recent) version of the Google App it just isn't installed to /system like if you had used a GApps package. Keep in mind that with Android 5.0, within a couple weeks there will be an update to apps like the Google app and even flashing a new GApps package will not remove/replace the version of the app in /data put there by the Playstore.

To flash TWRP your bootloader must be unlocked with Sunshine or the flash will fail (as you found.) Unlocking with Sunshine is probably becoming a better idea for those that haven't now that Motorola has announced that there will be no upgrade to 6.0/Marshmallow for our phones (while CM is actively putting together their 6.0/CM13 version for our phones.) That announcement doesn't mean there won't be more security updates for 5.1 from Moto and some people may decided not to get 6.0; but unlocking keeps all the options open.

I'll also mention that some of the security things I've been reading about 6.0 imply that even if Motorola did release 6.0 for our phones it might only work in an unmodified form on a locked bootloader device; not stating this as fact, just a concern. If this is the case, then those who didn't unlock would be able to take a 6.0 ota but would lose root, etc. in the process.
[X 2014 Android Development] mulletcutter:
So far so good. Had a few google play service stopped during setup, but none since its up and running. Did not flash webview.

edit: For no reason google play started to non stop failing. going to try again and flash webreview.

edit: setup wizard keeps starting over, ill get to Restoring then it will start over with setup wizard. After about 4th setup wizard its gone through.
[X 2014 Android Development] mikeoswego:
That is bizarre that you are having this problem. I've posted your pm here so that others can benefit from the answer. I don't think you need to go back to stock but here is what I'd do if I was unsure of where my phone was at as far as various firmwares, etc.

First, get this file: 5.1bins.7z.

Extract the files in the archive and run these commands:

fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn

Don't flash the recovery.img file in the archive because you have TWRP installed. At this point, you will have all the original 5.1 stock files installed except the system image and bootloader.

In TWRP Wipe Boot, Data, System, Cache

Then TWRP flash:

xt1096-23.32-25-5.modem.zip

xt1096-5.1-23.32-25-5_4.zip

Your GApps zip

Use the wipe Cache button in TWRP

Reboot

If you really want to go completely stock, do the above steps with the 5.1 bins file but add the command "fastboot flash recovery recovery.img" to restore the stock recovery.

Get this file: xt1096-5.1-bins-23.32-25-5.zip

Extract the files and run these commands:

fastboot flash boot boot.img
fastboot flash fsg fsg.mbn
fastboot flash modem modem.img
fastboot erase modemst1
fastboot erase modemst2
fastboot erase DDR

# Note the capitalization of DDR in the last command

Get this file: xt1096-full-stock-23.32-25-5.img.7z

Extract the .img file and flash it using fastboot or mfastboot: "fastboot flash system xt1096-full-stock-23.32-25-5.img" or use mofo to flash it if you have that.

These steps should get you to the current stock stagefright patch system, no root, tether, exactly like stock.
[X 2014 Android Development] mikeoswego:
Alternate Boot Logo and Boot Animation

[MENTION=5359696]Tenigima[/MENTION] posted an M Boot Logo and Boot Animation in another thread. I updated the animation a bit to work correctly on the xt1096 and they are here:

M_BootLogo_Flash.zip

M_BootAnimation_Flash.zip
[X 2014 Android Development] mikeoswego:
I made a patch that only removes Xposed. Here it is: xt1096-23.32-25-5-mofo--mofo-noxp.patch.zip
[X 2014 Android Development] BoulderGeek:
I'm running rooted stock KitKat 4.4.4. Locked VZW bootloader on XT1096.

How can I get into the goodness of these ROMs? Is there a path to flashing up from 4.4.4 via adb? I have working mofo. Just not sure of how to get off of rooted KitKat into rooted Lollipop.
[X 2014 Android Development] donslade:
If you're on rooted 4.4.4 (or even 5.0) and have mofo already working I suggest that you use Sunshine to unlock your bootloader. After that you will have the most options available for current and future ROMs.

If you to back up to the first post you will find the required instructions and links.

That is what I used to take my new (to me!) XT1096 running stock (unrooted, locked BL) through rooting with MOFO then to unlocking BL with Sunshine and finally loading the latest 5.1 from mikeoswego.
[X 2014 Android Development] BoulderGeek:
OK, thanks, Don. I bit the bullet and paid for SunShine, and TWRP is working fine. Dropping cash on this project. :)

I am going to do a full wipe flash of the 5.1 package here from TWRP, plus TK GApps.
[X 2014 Android Development] donslade:
From the first post you can go to post #781:

http://xdaforums.com/showpost.php?p=62785699&postcount=781

Please read everything because a Google apps package will be required and there are options for what you can install.

For me the Sunshine BL unlock was well worth it for the flexibility it gives for the future.
[X 2014 Android Development] AlienZombieEater:
I updated to the latest mofo version to remove xposed so I could get Sunshine to work. Sunshine unlocked me successfully but now I'm stuck trying to get the image with twrp flashed. I downloaded the provided image but it falls when I try to flash it. I got the twrp manager installed, selected 2.8.7.0, but it falls if I try to install recovery. Any help would be appreciated.
[X 2014 Android Development] mikeoswego:
The TWRP manager app doesn't work. Download TWRP 2.8.7.1 from here: TWRP for victara

Then use fastboot to flash it:

fastboot flash recovery twrp-2.8.7.1-victara.img
fastboot reboot

You will see an error about mismatched partition sizes, just ignore that. Now, when you go to recovery either from the bootloader menu, from an Xposed/Gravity Box custom power menu, or by using "reboot recovery" from terminal or adb shell, TWRP will run and you'll be set.
[X 2014 Android Development] rumi409:
Anyone getting an error when trying to flash the modem file (xt1096-23.32-25-5.modem.zip) via TWRP 2.8.7.1? It says something about "E: Error Executing updater binary in zip '/sdcard/...xt1096-23.32-25-5.modem.zip'".
[X 2014 Android Development] mikeoswego:
That script replaces a couple things but also patches some things (as based on the original stagefright update OTA.) It uses MD5 to check that the correct version of the files are in place before trying to modify them. If the correct version(s) aren't found, the script will error out. The most likely cause for this is that you have already updated your files to the stagefright patched versions. Less likely is that you are trying to patch something older than the original 5.1 rom (like 5.0, 4.4.4, etc.)

You can use fastboot to flash what that zip does if you think that some of the files aren't updated:

Get this file: xt1096-5.1-bins-23.32-25-5.zip

Extract the files and run these commands:

fastboot flash boot boot.img
fastboot flash fsg fsg.mbn
fastboot flash modem modem.img
fastboot erase modemst1
fastboot erase modemst2
fastboot erase DDR

# Note the capitalization of DDR in the last command
[X 2014 Android Development] mulletcutter:
this link doesnt work anymore. https://www.androidfilehost.com/?fid=24052804347775637. this link too https://www.androidfilehost.com/?fid=24052804347823927
[X 2014 Android Development] mikeoswego:
I just checked these and they are still valid. There was this error at the top of the page:

Perhaps that is what you saw, thanks for letting me know about this potential problem.
[X 2014 Android Development] rumi409:
Thanks. :good: That did the trick. I was updating from 4.4.4 and only flashed the ROM file from the OP's First post.
[X 2014 Android Development] AlienZombieEater:
Thanks, Mike! Got my phone TWRPin' now.
[X 2014 Android Development] mulletcutter:
ya, they work on my computer. my friends comp, they didnt want to for some reason.
[X 2014 Android Development] Haxxa:
The Rom [6.0.0][UNOFFICIAL][victara] CyanogenMod 13 works a treat on the XT1096 and is now my daily driver. Thanks for all the work, mikeoswego had a great experience from all your work and efforts on this handset :)
[X 2014 Android Development] mikeoswego:
Thanks for the nice comments! I haven't tried one of the unofficial CM13 builds yet, maybe later today.
[X 2014 Android Development] RyanBRZ:
I just successfully unlocked my bootloader with sunshine, but I now cannot boot into download mode to do fastboot commands. When I try to, I get the bootloader unlocked warning screen and then the phone proceeds to boot normally.
[X 2014 Android Development] donslade:
Did you try this?

Step 1 – Turn OFF your Moto X.

Step 2 – Now press and hold the Volume Down button for 2-5 seconds. While holding the Volume Down button, press the Power Button for 1-2 seconds and release.

Step 3 – The phone should be in bootloader mode where you can use fastboot.
[X 2014 Android Development] RyanBRZ:
Yes, about 15 times now. My phone is low on battery at this point (12% ish). I'm hoping it is refusing to go to fastboot because of that.
[X 2014 Android Development] mikeoswego:
Basically, your not holding the vol-down/power button combo down for long enough. If you can't get it, continue holding the vol-down/power button combo while that logo screen is on and the phone will reboot, continue holding for a full 5 seconds (or more if needed) until it goes into bootloader/fastboot mode when you release them.

If you have ADB working on your computer, you can use "adb reboot bootloader" from a command window; or use Terminal or ADB shell and issue the command "reboot bootloader" from there. If you are using Xposed and GravityBox, you can turn on the advanced power menu and reboot to bootloader becomes an option.
[X 2014 Android Development] RyanBRZ:
The power button + volume down combo is not working. I was able to get in with adb. Thank you!
[X 2014 Android Development] RyanBRZ:
False alarm guys. It turns out my volume down button is not working at all. I replaced my screen not too long ago and I guess something is not sitting correctly. Time to take it apart again.
[X 2014 Android Development] jrbmed08:
Hi guys, I had to move on from my beloved XT1096 as I switched carriers and wanted a phone with Band 17. I'm getting ready to sell the phone but may have screwed things up a bit. I went into TWRP and tried to do a full wipe by tapping "advanced wipe" and checking everything, then rebooting. It seems that I accidentally removed the entire Android system from my phone, as it wouldn't move past the boot logo (but could still get back into TWRP). I think I fixed things by re-flashing the TWRP image with the Stagefright patch, and now it boots, but I just want to confirm that I don't need to re-flash the modems, even after screwing it all up. Post #781 states that the modems only need to be flashed once. Does that still hold given that I messed everything up via TWRP and rebuilt it? I would hate to sell someone a phone with modems that don't work, and I can't verify it because I no longer have an active Verizon SIM.
[X 2014 Android Development] mikeoswego:
I'm getting ready to replace the screen on mine in just a few minutes.. Hopefully it goes better than my attempt to replace the screen on my xt1060!
[X 2014 Android Development] mikeoswego:
You'll be fine with just flashing that image, the new modems image and everything else needed will still be in place.
[X 2014 Android Development] jrbmed08:
Thanks again, Mike! I really appreciate all the help you've given me along the way.
[X 2014 Android Development] mikeoswego:
Ooops, wrong part (my fault) will have to try another day..
[X 2014 Android Development] RyanBRZ:
Make sure you have a T3 torx bit as well. I used a guide that said to use a T4, which I did, stripping 3 screws in the process, one of which I had to drill out. The metal color pieces by the ear piece and mic are also a little annoying to put onto the new screen. Overall not that bad of a process, a lot more annoying than replacing a galaxy s3 screen though.
[X 2014 Android Development] mikeoswego:
Thanks, I think I encountered that on the xt1060 as well. I've got 2 different sets of torx drivers including the ones in this: iFixit Toolkit The correct screen is on the way so I'll make the attempt in a few more days.
[X 2014 Android Development] RyanBRZ:
I recently sunshined and flashed cm13 using twrp and I ended up with no mobile data so I went back to your rom that luckily I backed up and now I'm only getting 3g. Any ideas how to get 4g back? Have you tried a cm 13 build yet?