Update Android on bootloader unlocked, rooted, encrypted device

I currently run stock Android Marshmallow on a Nexus 5 (hammerhead). However, my device is bootloader unlocked, rooted, and encrypted, which makes updating Android difficult. Below are the steps I use to update minor versions of Android (e.g., 6.0.0 to 6.0.1) without losing any data.

Do this at your own risk, I’m not responsible for anything you break 🙂

Things you’ll need

  • Driver support (Windows only)
  • ADB and fastboot (I prefer this minimal version, not going to explain how to set this up)
  • Android factory image for the Nexus 5
  • Something to extract the image above (7-Zip on Windows, tar/gzip on Linux)
  • Kernel that allows rooting (I use ElementalX)
  • SuperSU zip (currently using 2.62, but you can find the latest beta here)
  • Custom recovery (I’m using TWRP)


  1. Download the factory image .tgz file (always check the hash), extract it, untar it, then extact the .zip file inside (to access the .img files).
  2. Move the kernel and SuperSU .zip files to your SD card
  3. Reboot into bootloader
    adb reboot bootloader
  4. Verify fastboot is working
    fastboot devices
  5. Flash bootloader
    fastboot flash bootloader /path/to/bootloader.img
  6. Reboot bootloader
    fastboot reboot-bootloader
  7. Flash radio
    fastboot flash radio /path/to/radio.img
  8. Reboot bootloader
    fastboot reboot-bootloader
  9. Flash boot
    fastboot flash boot /path/to/boot.img
  10. Flash cache
    fastboot flash cache /path/to/cache.img
  11. Flash system (this will take a minute or two)
    fastboot flash system /path/to/system.img
  12. Flash custom recovery (TWRP)
    fastboot flash recovery /path/to/twrp.img
  13. Reboot bootloader
    fastboot reboot-bootloader
  14. Boot into recovery (do not fully reboot)
  15. Enter your encryption password to unlock the device
  16. Flash SuperSU from SD card
  17. Flash kernel from SD card
  18. Wipe cache/dalvik cache
  19. Reboot (do NOT allow TWRP to install root)
  20. Once booted, reauthorize rooted apps (AdAway, Greenify, etc…)

Let me know if this process helped you out!



Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.