[Sony Xperia M4 Aqua] G15C:
Root the M4 Aqua E2303 Locked Bootloader/Install TWRP on 2.167/3.92

Before we begin:

Make sure you have the following:

•A Windows PC

•Flashtool (https://drive.google.com/file/d/0B_d8uWGbkaetTnhWX0J5UG5hN28/view?pref=2&pli=1)

•The .128 firmware (https://drive.google.com/file/d/0BzVQf67OZ9NtMFotOXRycTZoSlk/view?pli=1)

•Patience

•A good internet connection

•15 to 20 minutes

• The M4 Aqua Root Toolkit (https://www.dropbox.com/s/edse0h6b02odzn1/rootkitXperia_E23xx.zip?dl=0)

•ADB Drivers (https://drive.google.com/file/d/0B0MKgCbUM0itNVB1elljU2NPR0k/view?pref=2&pli=1)

•TWRP Toolkit (https://www.dropbox.com/s/yomdwq3p2le9hvi/M4Aqua-lockedTWRP-0.1-installer.zip?dl=0)

How are we going to do it:

The procedure is pretty straight forward, as the M4 Aqua is only on Android™ 5.0 we can take the kernel of the older versions of firmwares so we could root the device, while keeping the firmware version to the newest release (2.167/3.92). The method has been only tried on the E2303, there may be chances of it working for the E2306.

Let's begin! Part 1, Changing the Kernel:

First, we need to install the latest Flashtool version (link above), after you proceed with the installation of Flashtool, you need to install the Flashtool drivers, which can be found in C:/Flashtool/drivers or the path you selected flashtool to be installed. Once you open Flashtool drivers you want to select FLASHMODE DRIVERS, this is only so that the M4 will be recognised while in flashmode. After the drivers have been installed, you want to move the downloaded .128 firmware to C:/Users/*YourName*/.flashtool/firmwares or you can use the other method I will show later. Once you have done that you want to open Flashtool and wait for the Sync to finish. After that has finished, you will see a lighting icon in the top-left corner, you want to press the icon and select flashmode, now the second method, at the top you will see a path leading to the generic .tft folder in which Flashtool belives the .ftf files are located by default. You can change that by pressing the button on the right and lead the program to the path of the .128 ftf file. After you have selected your .tft file you will see on the right a lot of options *everything that the .ftf file contains*, if you want to keep the data on your device you can tick the first two options, a bit down on the right you will see a lot of options, including system.bin, you want to tick everything EXCEPT for the kernel.sin, this is the most crucial part. After that is done you want to let the program prepare the files, mean while you want to power off your M4 Aqua, after the process on Flashtool is done you want to press the VOLUME DOWN button while connecting the phone to the PC, once you see the green led light you can leave the button, if everything was done right the process of flashing should begin. If everything went well the kernel should be flashed and the phone should safely power on. Now we can proceed to the second part. Rooting the phone.

2ND METHOD

You can downgrade to .128 firmware and download the .167 or .92 firmware and update everything except for the kernel. You can do this by going into Flashtool, and doing the steps above but TICKING the kernel.sin. Try this if the first method doesn't work.

Part 2, Rooting the phone:

Now that we have changed the kernel we can use the root toolkit to root the device. Download the root toolkit from the link above, but before you do anything you want to go to Settings>About Phone, scroll down to Build number and press it 7 times, after that is done you want to go back to Developer options, and you want to tick USB Debugging, after you have done that you need to install the ADB Drivers from the link above, after that is done you can connect the phone to the computer, now you want to extract the toolkit and run install.bat *No administrator rights needed*, and then you should see a screen on your phone asking if you want to trust the computer, you want to tick the box saying always and you want to press yes, now the rooting process should begin and your phone to be rooted. After this is done we can proceed to the part 3, installing TWRP

Part 3,Installing TWRP:

Now, that we have root we can install TWRP using another toolkit. This part is optional but if you want any custom ROM's you need this. This part is the easiest, you need to download the toolkit from the link above and just run the script. We don't need any additional steps as we did them in Part 2.

If everything went well you should now be rooted and have TWRP with a locked bootloader and on the newest firmware.

In case of bricking you can use the Sony PC Companion tool and repair my phone/ tablet option. YOU WILL LOSE ANY DATA SAVED ON YOUR PHONE.