27 May 2016

How to Install an Android OTA Update Without Losing Root Access




Over-the-air updates have long been the bane of many rooted Android users’ existences. It’s an endless battle: installing the update breaks root or won’t flash at all, but everyone wants the latest version of their mobile OS. Thanks to a new tool called FlashFire, the struggle may be over.


Why OTA Updates Don’t Play Nicely with Rooted Phones



Android is based on Linux, so Android devices come with a “root” user that functions like the Administrator user account on Windows. By default, Android doesn’t give you access to the root account. Rooting is the process of enabling access to the root account, installing the su binary. Applications can call su to gain elevated privileges, so they can break free from Android’s security sandbox and do more powerful things. Android doesn’t come pre-rooted because of the security problems this could lead to, especially for less technically inclined users.

The root process also installs an application like SuperSU, which controls access to the su binary, so you can choose which applications are allowed to have root access.

You’ll usually lose your root access when you install an operating system update. On Lollipop and earlier versions of Android, the over-the-air (OTA) update sets your Android system partition back to its factory state, removing the su binary. On newer devices with systemless root, it overwrites the boot image. And if you have a custom recovery, the OTA update may not be able to install itself at all.

Once upon a time, SuperSU had an “Survival Mode” that would let you flash updates, but that’s no longer around. Enter FlashFire.
What Is FlashFire?


FlashFire is powerful tool from Chainfire, the maker of SuperSU, that allows rooted users to perform a variety of actions, like flashing OTA updates and full zip files, create and restore backups, wipe data, and much more. It effectively eliminates the need to use recovery to manually backup or restore, and automatically handles un-rooting and re-rooting when flashing update files.

So far, it has been tested extensively on Nexus and Samsung devices, though theoretically it should work on most Android 4.2+ handsets. However, if you’re running a rooted device that’s getting a full version update—from Lollipop to Marshmallow, for example—things may get a little murky. Since there’s no way to root Marshmallow without an unlocked bootloader, you’ll completely lose root access if your device’s bootloader is locked. That’s unavoidable. If you’ve unlocked the bootloader, however, FlashFire should be able to preserve (or at least reinstate) root access once the update is finished.

So: while FlashFire isn’t guaranteed to work on every device, if you’ve gone the “official” route to root your phone, it will probably work.

It’s worth noting that FlashFire is in beta at the time of writing. That means features may not yet work as intended, and certain devices may experience more bugs than others. If you’re not scared away by such things, you’ll have to first join the beta program before you can download the app. I also encourage anyone interested to check this thread on XDA, too, before getting started.
How to Use FlashFire to Flash an OTA Update, Without Losing Root


When you get notified that there’s an update available for your device, the first thing you’ll want to do is go ahead and download it—but don’t install it. If you tell the update to go ahead and install, it will likely fail since you’re running a rooted device.



Instead, fire up FlashFire once the OTA has finished downloading. (If you don’t have it yet, join the beta program and thendownload the app.) It should automatically detect the update file and ask if you want to generate the actions to flash it. Go ahead and tap “OK.”



This will generate a screen that may seem a little overwhelming to novice users, but it’s essentially just a breakdown of what FlashFire intends to do with the OTA file. Each option is customizable if you tap on it—for example, if you don’t want to wipe the cache partition, simply de-select that option. You can also add various actions, but I wouldn’t necessarily recommend doing that right now.

If you have a custom recovery like TWRP installed, FlashFire will back it up before starting the process, and restore it afterwards.


Once you’ve finalized the set of instructions, hit the “Flash” button. It will give a warning that it can take a bit of time for FlashFire to load, and a couple of black screens may appear. Go ahead and tap “OK” again.



After that, FlashFire will reboot and you’ll see a myriad of scrolling text on the display. Leave the device alone to do its thing—that’s just FlashFire running the needed commands. When it’s finished, it’ll reboot with the update flashed and root restored. Boom. So simple.



What to Do if Flashing the OTA Doesn’t Work

If you’ve modified your device in a way that prevents FlashFire from applying the update—maybe you’re running a custom kernel, or the /system partition has been modified by the Xposed Framework, for example—then the update will “fail.” There’s currently no notification that the update wasn’t applied, so you’ll have to jump into the Settings > About phone menu and see if the build number has changed. If not, then you know the update wasn’t applied (there’s also a good chance Android will notify you that the update still needs to be installed).

When this happens, the best thing to do is to download the factory image for your device if it’s available. In this example, I’ll be flashing the newest update (April 2016 security patches) onto my Nexus 7.

Once downloaded, copy the factory image’s .tgz file to your phone’s internal storage or SD card.

Open up FlashFire and tap the floating action button (the red button with the plus) in the bottom right corner. Select “Flash firmware package.”



This will open up a file manager of sorts, which should default to the root internal storage folder. Scroll down until you find the file you just moved to the device.



Once you select the image file, FlashFire will scan the archive to verify its contents, then present a list of what can (and will) be flashed. You’re free to select what you want here—if you have a custom recovery and want to keep it that way, simply de-select the “recovery” option, for example.



Once you’re ready to flash, just tap the checkmark in the upper right corner. You’ll once again be presented with the list of actions before it proceeds, so if you want or need to change anything, now’s the time.


After you’ve confirmed all the steps, hit the “Flash” button. You’ll see the same warning about FlashFire taking some time to load and that a couple of black screens may appear. Just hit “OK.”

FlashFire will reboot and do its thing. Since it’s flashing a full image file and not just a simple update, it could take a little while for it to finish. Once it does, however, it’ll reboot and you’ll be good to go.

Labels:

0 Comments:

Post a Comment

Note: only a member of this blog may post a comment.

Subscribe to Post Comments [Atom]

<< Home