Upgrade Android on a Rooted Device
When Android says “System update available”, we all gleefully run it. Those of us with rooted phones get a way through it and come to an android lying on its back, and a sinking feeling in the pit of our stomach. “Did I just brick my phone?” No, but we did break some of the assumptions the Android updater makes. It presumes we’re running the stock bootloader, which we aren’t. Here’s instructions for getting the bootloader back to stock, getting Android updated using the normal means, and getting re-rooted. This guide assumes your phone is unlocked. (Unlocking your phone will wipe it. Backup before unlocking. Yes, really.)
I. Get ready
- Charge the phone. If the phone dies while you’re flashing, you’ve bricked the phone. It’s not permanent, but it’s harder.
- Install android sdk. I downloaded “adb-tools_treiber.zip” some time ago from a source I don’t remember. Minimal ADB and fastboot is sufficient. The goal is that you have
adb
andfastboot
command-line commands available. - Get phone drivers. You need drivers both for the regular boot mode and for the recovery console. Universal ADB Driver worked nicely for me.
- Turn on developer mode: Go to Settings > About phone and hit the build number 7 times.
- Turn on USB Debugging on the phone: Go to Settings > Developer Options > USB Debugging
- Ensure you have drivers installed. With your phone plugged into the PC via USB, open a command prompt, and run these commands:
adb devices
: make sure your device is listed asdevice
(notoffline
). Click “yes allow USB debugging” on the phone, and run it again until it saysdevice
. If it doesn’t, check Device Manager, try a different driver, or check the USB connection.adb reboot bootloader
: reboot the phone into bootloader so you can check the fastboot driver.fastboot devices
: ensure your phone is listed asfastboot
.
- Backup everything. Double-check everything. What if your phone never booted again? What would you lose? It’s your foot…
II. Put bootloader back to stock
- Download factory image for current version of Android: https://developers.google.com/android/nexus/images?hl=en. Settings > About Phone shows you your phone’s current version.
- Unzip
recovery.img
,boot.img
, andsystem.img
. - Run these commands from a console / terminal in the directory with the unzipped content and adb/fasboot commands. (Run the lines that start with
>
without actually typing the>
): Run these:
# Make sure the device is recognized > adb devices # Boot into bootloader mode > adb reboot bootloader # In bootloader mode, make again sure the device is recognized > fastboot devices # Flash stock LRX21O recovery image > fastboot flash recovery recovery.img # Flash stock LRX21O system image > fastboot flash system system.img # Flash stock LRX21O boot image > fastboot flash boot boot.img
- (4?) Reboot your phone, and you’re back to the stock bootloader. A few things of note: You’ve lost root. All the things that depend on root are now going haywire. That’s ok. We’re not done.
III. Run Android Update
- Incessantly check for updates until Android notices. Settings > About Phone > System updates. Sadly, it caches the answer for a good long time, so this may be a “go to bed, try again tomorrow” kinda thing. Especially if you just tried to update and got the android lying on its back.
- Run the update. Reboot.
- Reboot a few times. Run a few apps. Check for more Android updates (Settings > About Phone > System updates). Run these updates too. Make sure the new Android version settled in.
IV. Root it again
- Download and unzip CF Auto Root from https://autoroot.chainfire.eu/
- Re-enable USB Debugging if it got turned off during the update.
- Get into fastboot mode:
adb reboot bootloader
- Run
root-windows.bat
(or the appropriate root for your OS). That gets you root again. - Reboot. It will take a long time to boot. No, it didn’t freeze (unless it’s been hours). Feel free to panic, but don’t hard-boot it. If you do brick the phone, start over with
II: Put bootloader back to stock
above. No, you didn’t break it. - Once your phone is booted again, update and run SuperSU, Titanium Backup, Android Firewall, BusyBox, and all your other rooted tools. You’re done. Welcome to the next version of Android.