Aug 6, 2025
I spent the day today trying to root my Xperia E5. Since this is an older model, the XDA forums which contain the definite walkthrough for rooting the device doesn't seem to contain the essential files required for the rooting process. Nevertheless, I tried my best from the limited information I had.
Here's what I understand about rooting (might be wrong in making this assumptions, which might get updated in the future anyway).
- Rooting is simply another term for getting privileged access as an android user (similar to sudo in Linux)
- Brand manufacturers usually hide away the privileged access to normal users and the fastest way to bypass it is to flash the bootloader with an image that is already in a privileged/rooted state (it's like you are always logged in as the root user in Linux).
The first step is to thus unlock the bootloader i.e. enable the feature that will allow us to flash custom ROM images in the boot sector of android. Sony devices make it very easy to do so as detailed in their website how-to.
- Enable USB Debugging on your phone through the Developer Options. See the official tutorial on doing the android developer portal here.
-
Boot device into
fastboot
mode. Use the commandadb reboot bootloader
(did I mention you need to install android sdk tools?). Sony claims that you can enter fastboot mode through volume up (+ power button?) combination, but I couldn't do that with my phone so I usedadb
instead. -
You need to get an unlock code for your device (use model and IMEI number here) and run the command
./fastboot oem unlock 0x<your_code>
, where you replace<your_code>
with the unlock code you got from the official Sony developer portal.
Now comes the hard part that I am currently pausing this process on. Here's the things we need to do.
- Download official Sony firmware (not considering alternatives such as LineageOS for now) using XperiFirm. Be sure to check the firmware version on your phone and see if it matches the available options. This part is straightforward.
-
Now we create a
boot.img
file from the extracted firmware directory. Now there are a lot of.sin
files in the extracted directory and apparently we have to create my boot image throughboot_xxx.sin
file. Once the image is created, we use Magisk to create a rooted boot image.
Here's where I'm stuck currently - I used Unsin to create a boot.img file, however, this isn't recognized by Magisk as a valid boot image. Maybe the way to do it is to create a 'super' boot image as the Unsin XDA forum says and then unpack it into individual partition images (using lpunpack?). I'm going to try and use a vanilla android (AOSP) ROM next (see here), but this work is postponed for now.