DISCONTINUED [Recovery][Root] TWRP (Command line only for now)

husam666

Senior Member
Feb 6, 2010
21,405
1,071
113
Planet Omicron Persei 8
Discontinued, please use this instead


TWRP Recovery for M4 Aqua (No gui, command line only)
This is for E2303 I didn't test on other models, feel free to do so but I take no responsibility whatsoever if anything happens
This will disable OTA updates, if you want them back you can flash the FOTA kernel with FlashTool

Confrmed to be working on those variants:
E2303, E2306, E2333, E2353, E2363


Ok here it is thanks to @jeffreyvh kernel we can finally flash zips however we have 3 catches:
1. No GUI (Sony's fault until they provide full sources for our phones, we're stuck here)
2. You have to mount /system, /data and /cache manually (Working on it)
3. No external SD card support (working on it)

No problem? Cool..

Ok here's how to do it:
0. You need unlocked bootloader <-- Click here to see how
1. Download the recovery.img
2. Flash the recovery file with fastboot
Code:
fastboot flash recovery recovery.img
3. Pull the cable turning off your phone.
4. Press the power button + volume down, when the phone vibrates, press the volume down button repetedly.
5. The Sony logo will disappear and you'll get a black screen (It's okay, congrats you've now booted twrp)

Now for the magic:
Connect your cable, make sure you have ADB and drivers installed.
In your terminal or dos window type:
Code:
adb shell
you'll get a prompt like ~ #

type these three commands:
Code:
mount -w /dev/block/platform/7824900.sdhci/by-name/system  /system
mount -w /dev/block/platform/7824900.sdhci/by-name/userdata /data
mount -w /dev/block/platform/7824900.sdhci/by-name/cache /cache
Now that you have the partition mounted you can flash your zip files:
We don't have external SD card support so for now we're going to stick with sideload
type:
Code:
twrp sideload
adb shell will exit, it's okay now we can install the zip file like this:
Code:
adb sideload <path_to_zip>
path to zip on your computer without the < >
so if you downloaded superSU on C:DownloadsSuperSU.zip
you type
Code:
adb sideload C:DownloadsSuperSU.zip
when you're done type:
Code:
adb reboot
and pull the cable

For Rooting:
Download SuperSU flashable zip from here https://download.chainfire.eu/696/SuperSU
and flash it like explained before

good luck :)

Special Thanks:
@jeffreyvh
@alby_var
@Hnk1
@zw3n
@S7relok
@dexter93
@babydolll
@Sam205
The TWRP team and everyone who made this possible

Download Links:
http://d-h.st/wuGD

XDA:DevDB Information
M4 Aqua TWRP, Tool/Utility for the Sony Xperia M4 Aqua

Contributors
husam666

Version Information
Status: Testing

Created 2015-09-11
Last Updated 2015-11-24
 

husam666

Senior Member
Feb 6, 2010
21,405
1,071
113
Planet Omicron Persei 8
Help & Troubleshooting

If you get errors with sideload, try copying su.zip to your internal storage, then instead of twrp sideload type:
Code:
twrp install /data/media/0/su.zip
__________________________________________________


If you get ADB out of date error, use this tool to fix it http://visualgdb.com/adbfix/

__________________________________________________

At first, I should thank "husam666" for this great guide.

Secondly, I want to mention some points to help anyone who wants to do this procedure:

1. If you're on windows 8 or 8.1, please make sure that you've disabled "Driver Signature Verification". After doing this, install "Flashmode Drivers" and "Fastboot Drivers" by clicking on "Flashtool Drivers" from "drivers" folder of "FlashTool". (As default, you can find "Flashtool" folder on your "C" drive, after installing it on your computer)

*At the end of installation process, pay attention to the displayed result of it. If it won't go well, you will encounter so many errors later.

2. Download and keep "Universal ADB Drivers" and "Google USB Drivers for MTP/PC etc". Maybe you won't need them but I advise you to have them just in case. You can find them here on the third post of this great guide:
http://forum.xda-developers.com/m4-aqua/general/guide-t3130092

3. If you're stuck in "Flahmode" process, e.g. can't see your "Device Code", it's probably because of drivers. When your phone is in "Flahmode", open your "Device Manager" and look for your android device. If you see a warning sign behind it, then reinstall "Flashmode Drivers". For me, the problem was due to "Driver Signature Verification" of Windows 8.1. In that case, the drivers couldn't be installed properly.

4. If you have problems with "Fastboot", e.g. "Device "null" not found" or "adb server is out of date. killing...", it might be because of two main reasons:

A) Improper Driver Installation: When your phone is in "Fastboot Mode", check your "Device Manager". If you see a warning sign, you can reinstall the driver using "Flashtool Drivers" or"Universal ADB Drivers". If these two won't work, try install the driver manually by updating it in "Device Manager" and addressing it to the folder where you kept "Google USB Drivers for MTP/PC etc" in it.

B) Fastboot Bugs: It happens, so don't freak out. If you check everything and find no problem, just power off your phone, and close "cmd" in windows. Then restart your phone and put it in "Fastboot Mode", then run "cmd" again as administrator. This worked for me.

------------------------------------------------------------------------------------------------

I hope my points will be beneficial for you.
Good luck with your root.
 
Last edited:

zw3n

Member
Aug 31, 2015
25
25
0
www.zw3n.se
Code:
mount -w /system /dev/block/platform/7824900.sdhci/by-name/system
mount -w /data /dev/block/platform/7824900.sdhci/by-name/userdata
mount -w /cache /dev/block/platform/7824900.sdhci/by-name/cache
Change order of device and folder to mount:
Code:
mount -w /dev/block/platform/7824900.sdhci/by-name/system  /system
mount -w /dev/block/platform/7824900.sdhci/by-name/userdata /data
mount -w /dev/block/platform/7824900.sdhci/by-name/cache /cache
Thanks!
 
  • Like
Reactions: husam666

kpbs92

Senior Member
Sep 22, 2014
80
10
0
so it means if there is a newer software update i cannot install it ???????? is that it ?? even with sony pc companion ??
 
Last edited:

husam666

Senior Member
Feb 6, 2010
21,405
1,071
113
Planet Omicron Persei 8
Change order of device and folder to mount:
Code:
mount -w /dev/block/platform/7824900.sdhci/by-name/system  /system
mount -w /dev/block/platform/7824900.sdhci/by-name/userdata /data
mount -w /dev/block/platform/7824900.sdhci/by-name/cache /cache
Thanks!
Done, thanks for pointing that out

so it means if there is a newer software update i cannot install it ???????? is that it ?? even with sony pc companion ??
I think it can work with the PC companion, you can also reflash the FOTA kernel with FlashTool, and you also can flash the whole new firmware with FlashTool
 
  • Like
Reactions: kpbs92

kpbs92

Senior Member
Sep 22, 2014
80
10
0
Done, thanks for pointing that out



I think it can work with the PC companion, you can also reflash the FOTA kernel with FlashTool, and you also can flash the whole new firmware with FlashTool
So this can be applied with any firmware 2.99 and before.. ?? And also should my phone bootloader unlocked before doing this ??
 

Flamenawer

Senior Member
Apr 12, 2009
102
36
0
In the recovery.zip, is there a kernel compilated for you? or is only a recovery.
Because if is only a recovery that work with any kernel, maybe we can make a prerooted firm.
 

husam666

Senior Member
Feb 6, 2010
21,405
1,071
113
Planet Omicron Persei 8
In the recovery.zip, is there a kernel compilated for you? or is only a recovery.
Because if is only a recovery that work with any kernel, maybe we can make a prerooted firm.
There is a kernel, that's not fully complete, that's why we don't have screen support, I tried it with stock kernel but didn't work, you can make a prerooted firmware I believe I just don't have time to try it