How to update rooted Xperia devices

Rooted Xperiia
Rooted Xperiia

Introduction

This guide demonstrates how to upgrade your rooted Xperia devices to a newer version of Android.

Prerequisites

  • Rooted Xperia device.

Step-by-step guide

WARNING: I am not responsible for any damage to your device. Backup your data, do this at your own risk.

  1. Download new firmware for your phone following the steps from this section: https://harrytang.xyz/blog/download-xperia-firmware-flashtool.

  2. Open the downloaded .ftf firmware using a zip application (7z, WinZip) and extract kernel.sin.

  3. Run Flashtool, open Tools -> SIN Editor, select extracted kernel.sin from step 2 then click Extract data, you will end up with kernel.elf.

  4. Go to the extracted rootkernel folder, create boot.img by running this command:

    rootkernel kernel.elf boot.img
    

    You will see the output like below:

    - Unpacking kernel
     Found elf boot image
     Kernel version: 3.10.84-perf-gda8446f
     Found appended DTB
    - Detected vendor: somc (Sony), device: ivy (Xperia Z3+/Z4), variant: dsds
    - Unpacking initramfs
    - Detected platform: 64-bit
    - Detected Android version: 7.0
    - dm-verity is enabled. Disable? (Say yes if you modify /system) [Y/n] Y
     Disabling dm-verity
    - Sony RIC is enabled. Disable? [Y/n] Y
     Disabling Sony RIC
    - Install TWRP recovery? [Y/n] Y
     Installing TWRP
     Compressing TWRP image
    - Found SuperSU-v2.79-201612051815.zip. Install? [Y/n] Y
     Adding service entry for SuperSU
    - Install DRM fix? [Y/n] Y
    - Install busybox? [Y/n] Y
    - Creating new initramfs
    - Creating boot image
    - Cleaning up
    Done
    
  5. Flash the download .ftf firmware using Flashtool, and ensure that no option in the “Wipe” pane is ticked

    Flash Firmware

  6. Enter fastboot mode (Poweroff, hold volume up and insert USB cable) to flash the boot.img from step 5:

    fastboot flash boot boot.img
    
  7. Reboot your phone and enjoy new software without losing root :)

Conclusion

You have now updated your rooted xperia to new Android version.