check first by this code use phone dialler
*#*#7378423#*#* , if bootloader unlocked = yes , so you can root it
must download it first
1. flashtool -0.9.18.4-windows > https://mega.nz/#!ThcRmQwD!x_X-U6g8b...zrkVbBqfIubhdI
2. adb > https://mega.nz/#!ywUwFLpK!LmlAnwl8A...5pGer-XHOIVF6o
3. twrp > https://mega.nz/#!r8EWGQDD!nYOAC4HuQ...lEKaCP4uHuAXVg
4. supersu > https://mega.nz/#!C89nzC4L!F6yFyCqex...IS4-sBdULURJ7g
1. go to http://developer.sonymobile.com/unlo...urboot-loader/
2. chose type "M" and finish this until get key
3. save key code in file "txt" and rename it "ulcode.txt"
4. install flashtool -0.9.18.4-windows
5. activation USB debug in mobile first
6. connect mobile to PC via USB (DON'T UNPLUG te USB before DONE)
7. run flashtool wait until finish, chose option on top "devices>check drivers"
copy the devices code , my code is "YT911335HE"
1. go to C:/flashtool/custom/mydevices/(here), create a new folder and rename with your device code
2. copy ulcode.txt and paste in your device code folder
3. close flashtool
4. create a new folder in C:/(here) rename it "adb" then extract file "adb tool fastboot xperia m4 aqua.zip" and copy file "recovery.img" in C:/adb/(here)
5. run flashtool and chose flash icon, click "fastbood mode" > OK , click "mode>reboot into flashtool mode (via ADB)".wait until finish
6. chose BLU icon wait until finish, unplug the mobile usb from PC and plug with hold Vol- , now chose unlock
7. go to folder "adb", typed cmd at addres bar (to open CMD)
8. paste this code "fastboot flash recovery recovery.img" in CMD, and ENTER, wait until finish
(unplug mobile and plug again with hold vol+ button if ADB tell waiting device)
This if finish intalling TWRP
DONE, TWRP installed but not ROOTED
1. run TWRP by press " power and Vol- ", after you see logo sony, release "power" and press " vol- " twice, wait until finish
2. in TWRP mode connect it via USB to PC and send file "UPDATE-SuperSU-v2.46.zip"
3. install "UPDATE-SuperSU-v2.46.zip" by TWRP, wait until finish
DONE, TWRP installed and ROOTed