[Miscellaneous Android Development] marvinalnashi:
After a lot of struggles, we've finally managed to root the Sony Xperia E5.

If you own this device and would like to root it, this thread will guide you through the process.

Requirements:

-You must have the correct drivers installed!

You can't proceed without them as the adb interface won't recognize your device.

-The modified boot.img for 37.0.A.2.156 which you can download here

-The modified boot.img for 37.0.A.2.248 which you can download here

-Twrp recovery which you can download here

-The adb interface, google it.

-Your bootloader must be unlocked via the Sony official method. If you can't find the E5 in the list, you can use the code of the E4g.

-Supersu 2.79 zip which you can download here

-An equal kernel (boot.img) to your desired firmware version. 37.0.A.2.156+37.0.A.2.156 or 37.0.A.2.248+37.0.A.2.248.

-The no-verity encryption fix (optional): (link to be added)

-30 minutes of your time.

I'm not responsible for any possible damage caused to your phone, even though it most likely won't go wrong if you follow the instructions carefully.

I can, however, provide support if your device is stuck in a bootloop.

I won't reply to questions, of which the answers are already mentioned in this thread.

YOU MUST MAKE SURE YOU'VE DOWNLOADED THE KERNEL THAT IS MEANT FOR YOUR SPECIFIC FIRMWARE VERSION!

IF THE TWO AREN'T EQUAL, YOU'LL HARD BRICK YOUR DEVICE AND YOU'LL HAVE TO AGREE THAT I WON'T BE HELD RESPONSIBLE!

Instructions:

1. Unlock your bootloader, check out Sony's website to see how.

2. Check whether the boot unlock succeeded or not.

To do so, you can open your dialer and type *#*#7378423#*#* .

A screen will appear, tap on service info and go to configuration.

Check the rooting status:

*If it says 'bootloader unlock allowed=yes' it means your bootloader is still locked.

*If it says 'bootloader unlocked=yes' it means your bootloader is unlocked.

3. Install the correct drivers for your device, Sony adb+fastboot etc.

4. Go to the root directory of your adb folder, location depending of where you installed it.

Hold Shift and right click to show a menu.

In that menu there should be an option called 'open command prompt here', click on it and it should start adb.

5. Make sure to enable usb debugging on your device.

6. Connect your phone to your computer and type this command in adb:

adb devices

If your device shows up, it means adb recognized your device and you may proceed.

If it doesn't show up you have to double check your installed drivers in device manager.

7. Type

adb reboot bootloader

to reboot the device to fastboot.

8. Now you'll have to flash the kernel and recovery.

Put both of the files into the root directory of the adb folder and rename them to boot.img and recovery.img, type

fastboot flash boot boot.img

to flash the kernel and type

fastboot flash recovery recovery.img

to flash the recovery.

9. Unplug your device and boot into twrp by pressing the power+volume down buttons. Keep holding the volume down button and release the power button quickly.

10. When you're in twrp, head to 'wipe'->'advanced wipe'->'(user)data partition'.

This step is optional, but recommended to avoid problems with encryption.

Update: the forced encryption has proven to bring limitations and issues to the recovery and system.

The updated steps are now mandatory!

11. Now head to 'install', browse to the directory in which you saved the supersu zip file and flash/install it.

12. Flash the latest version of the encryption fixed no-verity-opt-encrypt zip file, which can be downloaded from here

At first I made my own fix zip file, but I lost it and lot's of other projects, so the above file is a workaround.

13. If the installation succeeds, you may reboot your device.

Please be patient, the first boot may take a while.

It will reboot during the initialization, so don't panic and think it's a bootloop, cause it simply isn't.

I hope this has helped people with rooting their Sony Xperia E5.

I'm here if you need support, unless it's something dumb and/or already mentioned.

UPDATE APRIL 2018

A new modified kernel is available for the latest firmware 37.0.A.2.248!

The rooting process is the same as written above, but instead of flashing the older kernel and firmware, you'll have to flash the new ones.

Be warned, you cannot flash any newer kernel on an older firmware version and the other way around!

The kernel and firmware versions always have to be equal, no exceptions.

An advantage of flashing the newer kernel is that it should support Magisk, while the previous one didn't.

If you want to root your device with Magisk, or install both Magisk and Supersu, the rooting instructions will differ.

You can find new instructions here: (Link to the thread to be added!)

~A special thanks to rrvuhpg and Tu_Angel