yashsingh1/xdaforums huggingface dataset:
[Sony Xperia M] :
Hey archi,

Some devices can't be unlocked due to carrier contract or user's preference to retain warranty. This is where a recovery that runs on locked devices comes in handy.

Whilst I agree with your point on lazy umount , I would like to point out that if you look at code, all the binaries and files namely recovery.tar, busybox and scripts were busybox cp to /sbin. The script e2fsck runs and copies everything required to /sbin beforehand, thus negating any chances of mount lock.

Having said that, it's still a good idea to run a fuser -m /system to look for locking PID's. Imperatively, fuser -km /system can be used to kill relating processes.

A small tip to op,

Look for these services in init.target.rc

service xyz /system/abc/file

user root

oneshot

You can patch this easily to run a custom script which can be used to tar xf a recovery tarball. Put it in chroot jail and exec init.
[Sony Xperia M] Kir3:
Nice, Finally! :) When you guys make the recovery in proper condition, make a Windows/Linux Installer for it over adb :D
[Sony Xperia M] JustArchi:
I'm still wondering what will happen if you flash custom boot.img for your locked bootloader device using root in ROM itself through dd.
[Sony Xperia M] gamer649:
If I'm right it won't flash due to it being modified and unsigned and locked bootloaders only accepting signed boot.img's.
[Sony Xperia M] JustArchi:
You're right but I'm talking about root and flashing from ROM itself and not bootloader. You can always use dd on /dev/block then.
[Sony Xperia M] :
Custom kernels that aren't signed with Sony's private key will not boot if the bootloader is flagged as locked by trim area (TA). So in this case, a soft brick will happen.
[Sony Xperia M] JustArchi:
This is the answer that I expected, thanks.
[Sony Xperia M] paper13579:
So does this mean that we will never get cwm? Please say no
[Sony Xperia M] :
After a quick peek in your kernel source, I think you should be able to get recovery to boot on stock kernel. However you may need to align fb to correct 4096 byte boundary otherwise recovery graphics will be jittery.
[Sony Xperia M] paper13579:
Man even though this is your third post on xda, i hope you can make this work for us on a locked bootloader. Good luck
[Sony Xperia M] ndrancs:
HI E.T.N

Please respond to my pm...
[Sony Xperia M] :
actually it was I :p Had trouble logging in with my original account so made a temporary account.

I'll look into this if I get time. Again no guarantee.
[Sony Xperia M] paper13579:
Come on guys, dont let the development on this fade away!!
[Sony Xperia M] ndrancs:
Sure I watches this thread anyway, ;)
[Sony Xperia M] :
try this : http://d-h.st/QsQ

:fingers-crossed:
[Sony Xperia M] gamer649:
[MENTION=4736004]rachitrawat[/MENTION]

Just tried to install and then boot into CWM, it shows a pink LED at the Sony logo. Pressing either of the volume buttons makes the phone hang and then reboot. I will report with philZ recovery once my phone rebooots.

EDIT: philZ recovery produces the same result.

EDIT 2: All recoveries produce the same result on my device.
[Sony Xperia M] ndrancs:
Thanks buddy..

I have test it.

Power off the phone, then boot to cwm, it's vibrate once after the vol button pressed. And stuck in Sony logo, about a minute. Just wait it, then phone reboot and boot system normally.

Try with 3 recovery and same results.

Btw.

Is selinux enforce in jelly bean 4.3? It's that the issue ?
[Sony Xperia M] :
Can anyone try with 4.2? If it works, it'll reaffirm my suspicion.
[Sony Xperia M] ndrancs:
I'm xperia m single, don't get 4.2 update.. Please any dual user to help test it recovery...
[Sony Xperia M] gamer649:
When I get my new phone I'll test it on the stock 4.1.2 firmware and then test it on the 4.2 firmware by crossflashing. I should have results up by 8PM GMT 1/8/2014.
[Sony Xperia M] ndrancs:
I can't cross flashing, this's my main phone, ;)

Will waiting for the results.
[Sony Xperia M] gamer649:
Just backing up my XM now, after I have done that I will start the testing on lower firmwares. Been a busy day and I've only been able to start doing stuff for the recoveries.

EDIT 1: Well, got some good news to report, on the 4.1.2 firmware for the Xperia M SS all 3 recoveries boot as expected (I haven't tested them). I will test on the 4.2.2 Xperia M DS firmware tomorrow morning.

EDIT 2: Some more good news, on the 4.2.2 firmware for the Xperia M DS only thw CWM and philZ recoveries boot as expected, I can't seem to install TWRP as I keep getting protocol errors in the installer. Again, I haven't tested them.

[MENTION=4736004]rachitrawat[/MENTION] Results are now up for you to look at :)
[Sony Xperia M] ndrancs:
Wow :thumbup: nice.. I'm glad to hear that the recovery is worked In 4.1 firmware..
[Sony Xperia M] endy stand row:
Nice post master
[Sony Xperia M] ndrancs:
Thanks bro, hehe :good:
[Sony Xperia M] pedroj666:
Confirmed working on my XM. :good:

I just installed "recoverie Philz" on my XM with android 4.2.2 and it works 100%.:laugh:

Many thanks for the most excellent work.

Translated by google translator. sorry
[Sony Xperia M] SPatrik97:
Why it works on 4.1.2 or 4.2.2?

Why not work on 4.3? I flashed 4.1.2 (or someone 4.2.2) and it worked.

Because this is for Xperia L (C2105), which has android 4.2.2 and not 4.3 like Xperia M (C190x). So you can't flash C190x things (like ROMs, because with locked bootloader you can't flash kernels, but you can flash custom rom)

This is for 4.2.2 and under this version.
[Sony Xperia M] paper13579:
Wait, so now we can flash cyanogenmod on our device even if it has a locked bootloader?
[Sony Xperia M] ananthtcr:
Hey, can you give some simple procedure...

So that anyone can give a try...
[Sony Xperia M] ndrancs:
I even try the recovery from this ROM http://xdaforums.com/showthread.php?t=2584956 which is for XM 4.3 basis ROM/firmware. but you must unpack the boot.img and take out the recovery from the boot.img

But in 4.3 same result its not booting to the recovery.

Just for you to note, this purpose of recovery is not to flash/install custom kernel, its only can flash custom ROM and or apk/jar MOD.
[Sony Xperia M] SPatrik97:
:) With locked bootloader you can't flash kernels (with flashtool), but you can flash ROMs (with recovery). I didn't say that,,you can install kernels with recovery".

So, it don't work on 4.3? And on 4.1 and 4.2?
[Sony Xperia M] ndrancs:
no we can't flash cm, only custom rom that based on stock ROM, like zxnt ROM.

why cm can't be flash, because cm need a custom kernel.
[Sony Xperia M] ndrancs:
hmm, i mean i can install kernel with recovery, example: my xperia e single has been unlocked bootloader, so i can flash my custom kernel to it. but with locked bootloader of course we can't flash the custom kernel, with recovery or flashtool.

for now yes, it don't work on 4.3, but confirmed to work only in 4.1 - 4.2
[Sony Xperia M] SPatrik97:
Try to grab another recovery which based on C190x stock kernel and combare it with Xperia L's recovery (which has cwm with locked bootloader)
[Sony Xperia M] adj1017:
how to boot on cwm what are the button combinations?when i try power & volume down the phone boots into safemode im on 4.1.2
[Sony Xperia M] gamer649:
Whilst the phone is showing the Sony logo there will be a pink LED, simply press and hold either the volume up or down key when the LED is shown and it will boot into CWM.
[Sony Xperia M] adj1017:
when i use the installer it say's finish but when i try what you said no pink light showing up on sony logo,is it the recovery was not installed properly?
[Sony Xperia M] ndrancs:
I have updated the OP, please see the first page.
[Sony Xperia M] itsnie:
Now is just how to make it work on 4.3 ..xd
[Sony Xperia M] ananthtcr:
Fantastic job bro...

Can you pls give it for 4.3 JB XMD????
[Sony Xperia M] oorvashe:
Great Job and good results for your hardwork. We are waiting for 4.3 XMS and XMD.
[Sony Xperia M] adj1017:
when i check system/xbin no busybox there but there is a busy box installed on system/bin not on xbin,what is the best way to move busybox to xbin without conflict?i already have full root
[Sony Xperia M] :
hey all.

this should work on all firmwares. http://www.androidfilehost.com/?fid=23578570567723726

you may see pink led glowing when reboot option is selected in recovery.. ignore it.

note: rename /system/bin/sh.bin to /system/bin/sh to deactivate recovery and vice versa to activate recovery.

If you see anything weird happening with adb shell, deactivate recovery and retry.

Edit : to install, download recovery.zip from op, replace all things in files folder from newer zip, replace all occurrences of e2fsck in install.bat with sh
[Sony Xperia M] itsnie:
[MENTION=4736004]rachitrawat[/MENTION]

Eto, how to install it?

No install.bat in your file???
[Sony Xperia M] deeps.singh46:
is it for 4.3
[Sony Xperia M] pincheraro:
how to install?

Sent from hall9000 using a human interface
[Sony Xperia M] ndrancs:
Thanks buddy,

Try it right now, btw for other user I will make installer for it later.
[Sony Xperia M] pedroj666:
I made the change from "e2fsck" to "sh" in the install.bat file also deleted and changed all the files in the "files" folder. After I copied the new zip files to the folder and this error happens!

I have full root on my XM.
[Sony Xperia M] :
Reboot device and see for pink led..
[Sony Xperia M] pedroj666:
Did factory reset to my XM then installed SU, busybox and root fixer. After that installed your "recovery" and restart the XM.

Not appear pink LED and can not get in "recovery" when I press the V key.

Furthermore, after restarting my XM lose root! More specifically the binary files "Towel Root.apk"!

Translated by google translator!
[Sony Xperia M] ndrancs:
I'm sorry bro, I got accident this day, my motor cycle was hit by a car, that hit me in the back...
[Sony Xperia M] itsnie:
[MENTION=4736004]rachitrawat[/MENTION]

It's save if i move manually recovery.tar, recovery.sh and sh to system/bin or not?
[Sony Xperia M] manfredo16:
Dont work for me :(
[Sony Xperia M] daemonarch21:
not working to 4.3

Not working for 4.3 :( any way to make it work?

Recovery install ok but doesnt load.Pink led appears,i press volume up and stuck for sony logo for 1min.Phone reboots and boot into android normaly.
[Sony Xperia M] Prantik Sarkar:
4.3

this is cool but we need cwm,philz for locked bootloader for xperia m 4.3 jelly bean 15.4.A1.9 PLZZZ :/
[Sony Xperia M] ndrancs:
Try this new recovery and same result as before (e2fsck method), just stuck in sony logo, then reboot itself after a few minutes and boot normal to system/home.

Bugs: if you don't rename back the sh file, you will have battery drain so fast. very fast. your phone will always awake while the screen is off.
[Sony Xperia M] ndrancs:
for now the recovery is not working in JB 4.3 xms/xmd
[Sony Xperia M] rizla2:
Did anyone tried this out? http://xdaforums.com/showpost.php?p=53785006&postcount=4
[Sony Xperia M] gamer649:
It is a .img file and thus can only be flashed on unlocked bootloaders.
[Sony Xperia M] Mysteryagr:
What about rebooting to recovery from rom? Or using adb?
[Sony Xperia M] Remorcer:
You could "flash" recovery through adb, but you need a working one for locked BL.
[Sony Xperia M] mbc07:
No, you can't. Xperia devices doesn't have a recovery partition, so , any custom recovery must be packed with the kernel. Locked bootloader = official kernels (without recoveries) only, no way around that...
[Sony Xperia M] Remorcer:
I put flash in quotes because it's not technically flashing through ADB, it's just copying recovery.tar and the other important files to /system. Just to clarify.
[Sony Xperia M] rizla2:
Ok, so for those who managed to install recovery and it works: have you tried any custom roms? Do they work?
[Sony Xperia M] bubimir13:
Please, can we expect 4.3 version of one? Even tho Bootloader is locked one can perform various modifications to interface and performance, but a great problem is lacking of Nandroid backup and restore function, Titanium backup is possible but its not the real deal. Please continue your work mate, i hope youll find a solution
[Sony Xperia M] ndrancs:
Hmm, I think the ROM must be based on android 4.1 - 4.2, and it's compatible with LBL conditions. ROM like CM need custom kernel and of course we can't flash this kernel, because it's for ubl.
[Sony Xperia M] ndrancs:
Thanks for a such good reply. It's project work in progress, but I need more Dev to contribute to make this recovery work on jb 4.3
[Sony Xperia M] gamer649:
I might give it a shot and see if I can get it working using the bases provided already, once I get a new phone however. Can't risk bricking my M now that it has a broken power button and it is my main phone.
[Sony Xperia M] ndrancs:
Hmm, I see cyanogen mod release nightly version for Nicki, I think we can extract the recovery from boot.img that's in rom zip.
[Sony Xperia M] Remorcer:
"I volunteer as tribute."
[Sony Xperia M] Kir3:
That's why I don't mess up with my phone that much because of not having nandroid backup. Flash Gordon is buggy and you can't replace some files with it.

I only have camera and SystemUI changes and Xposed installed. I'm afraid to modify other components because I can end up with bootloop. :rolleyes:
[Sony Xperia M] bubimir13:
Thats why we LB users need CWM for, i for one like to try out various things, at least i liked on my old phone, when i dicovered i cannot unlock that sh*t of bootloader, well i didnt want to try my luck.
[Sony Xperia M] himu_joy:
may i give try??

XMD (c2005)

4.3 (15.5.A.1.5)

full rooted (nicki root).

thanks in advance.
[Sony Xperia M] bubimir13:
Since 4.4 is out of the window officially, now would be the great time to get CWM for locked bootloader 4.3 devices. Any devs capable doing it, please :)
[Sony Xperia M] ndrancs:
Any good news from Dev? :)
[Sony Xperia M] pacific_nicki:
Attention !

Attention for this threat !

Actually this is good installer but NOT FOR XPERIA M/MD this is for "TAOSHAN" aka Xperia L.

Would you please fix it and make it become usable on our xperia M.

Thanks....
[Sony Xperia M] AndyPhoenix9879:
It does work, only on 4.1.2.
[Sony Xperia M] aayamz:
Great work Brother...

You really did a great job man actually i was not able to unlock my bootloader...so i found your thread...but now its unlocked and now using cwm for unlocked ones...btw you work really great...
[Sony Xperia M] gamer649:
I have managed to fix the root loss problem. However, I have now lost the haptic feedback and pink LED whilst rebooting and thus you cannot attempt to access recovery. I will attach the file I have changed to keep root access, it may be of use to somebody else.
[Sony Xperia M] kirev:
So, if I want CM11, I have to downgrade to 4.1.2 first and then I can install CM11?
[Sony Xperia M] Mysteryagr:
Then you will end up with no signal.

-

If you want cm11 unlock bootloader and flash boot.img via flashtool or fastboot command
[Sony Xperia M] kirev:
So no CM11 with CWM? And my boot loader is not unlockable...
[Sony Xperia M] AndyPhoenix9879:
Well not possible for now.. cuz some devices are running CM11 in locked bootloader, well those are the devices with rich development like Xperia SP :C

[MENTION=5113927]gamer649[/MENTION]

Well I got the pink LED and the haptic feedback.. but after I press the volume down button I'm stuck in the Sony Logo, just like the e2fsck.sh :C

EDIT: Wait nvm, the e2fsck.sh wasn't removed when I applied the new one... Sorry...
[Sony Xperia M] gamer649:
So exactly the same result as me? Now that I think I've removed the loss of root problem we might be able to get somewhere.
[Sony Xperia M] AndyPhoenix9879:
Yep, great work on fixing the "losing root access" :D but now I'm kind of losing Xposed lol.. But no biggies :p

Well i went through the files and they(the stuff inside the file) were barely changed (except the name of e2fsck into sh)

Hopefully we'll get the cwm working :highfive::fingers-crossed:
[Sony Xperia M] gamer649:
A bit more good news. I have managed to fix the loss of root problem and I have now also been able to get the pink LED and vibrations at the Sony logo screen. However, I still cannot boot into recovery and attempting to uninstall the files via the installer produces errors (but since we have root access we can simply delete recovery.sh, recovery.tar and rename sh.bin to sh which produces the same effect).

I will upload the entirety of my working along with a screenshot of the error I am getting. Hopefully somebody else can help me fix it. I am thinking I am going to have to compile recovery on a Linux machine and modify it on there.

Side note: the errors I am getting may be from unplugging the phone during a software flash earlier. Or that I have flashed 15.4.A.1.9 system over the 15.4.A.0.23 kernel. I don't know.
[Sony Xperia M] bubimir13:
Dude, sorry to hear you have problems, but you ROCK even for trying to do something that would be usefull for manny of us who cannot unlock their bootloader. Keep it up!
[Sony Xperia M] gamer649:
I think I might have made some progress towards building a working recovery today. I have started to install Ubuntu to dual boot with windows 8.1, while I haven't been able to access the desktop to Ubuntu I have been able to install it. I believe it is a graphics card problem, something I will look into tomorrow. If I am able to access the desktop and fix the problem with the dual boot I will be able to set up a build environment and start to compile the recoveries. Wish me luck, I'm gonna need it.
[Sony Xperia M] rizla2:
Best of luck, you can do it :)
[Sony Xperia M] gamer649:
Turns out the reason I can't boot into Ubuntu is a graphics driver problem, I can't work out how to fix it however. I have posted the full issue on here and the ask Ubuntu forums, no replies on how to fix it yet. If anybody wishes to take a look at my issue and suggest a fix if they know then you can look here.
[Sony Xperia M] Remorcer:
Can't you install Ubuntu in a VM?

If you don't want to, I suggest trying with older versions of Ubuntu, and if that doesn't work, there are many other distros that you can try.
[Sony Xperia M] gamer649:
I tried installing it to a VM but it didn't work as I hoped it would. I could only allocate one core and 1.5GB of RAM to the VM so it didn't run very smooth.

The reason I am trying 13.10 is because I am following a guide on here on how to set Ubuntu up for a build environment and they are using 13.10.
[Sony Xperia M] PurplePikolo:
I salute your effort mate! But will we be able to flash custom rom if our bootloader stays locked?
[Sony Xperia M] gamer649:
If I or other devs manage to make a working recovery the only custom ROM's available to locked bootloader users would be stock based ROM's with stock kernel.
[Sony Xperia M] ndrancs:
So you cant boot to live cd mode? Try add this boot param: blacklist=radeon combine with nomodeset or without nomodeset.
[Sony Xperia M] gamer649:
How have I not come across that possible solution before? I might try to dual boot again soon, I removed the Ubuntu partitions from my laptop last night. That being said I am now trying to get Ubuntu on my old laptop (I successfully managed that before, I'm upgrading it to 14.04 LTS now due to a broken pipe error). I will try various distributions on my old laptop to see what works.

And no, no live CD mode.
[Sony Xperia M] ndrancs:
Hmm, ok, try bbqlinux instead, it build for android dev.
[Sony Xperia M] gamer649:
Can anyone adapt the installation.bat to a Linux/Ubuntu script please? I don't have a windows laptop to test my changes (long story short, the hard drive failed and I've lost all files on there).
[Sony Xperia M] ndrancs:
Can you attach it?
[Sony Xperia M] gamer649:
So far I've only made slight changes to the CWM recovery, I still need to edit the default.prop properly. I might attach it once I get home.
[Sony Xperia M] Kir3:
OK, I have lost a track here, does it work on 4.3 or still on 4.1? :)

And OP, update the first post so we know and we don't ask again about this :D
[Sony Xperia M] gamer649:
Still only 4.1.x and 4.2.x. I'm trying to get it working on 4.3.
[Sony Xperia M] gamer649:
Good news (sort of). I have managed to adapt the install.bat into a script what can be run on Linux and Ubuntu (probably Mac too as that is a Unix based system). The script is still ONLY for 4.2.2 and lower (I haven't managed to get any recovery to boot on 4.3 as of yet).

To use the script;

1) Download the attachment on this post.

2) Extract the zip to anywhere (preferably the desktop or the directory where the install.bat file is located).

2a) If you extracted the file to your desktop you will have to move it to where the install.bat is located.

3) Right click install.sh and then click properties.

4) Click permissions.

5) Set all the permissions to read and write and tick the box next to allow executing file as program. Click close.

6) Open terminal.

7) Navigate to the directory where install.sh is.

8) Type

./install.sh

and then click enter.

9) Install recovery on 4.2.2 and lower.
[Sony Xperia M] ScouserCL:
Waiting for a version for JB 4.3 :)
[Sony Xperia M] PurplePikolo:
Me too! Thanks for your effort
[Sony Xperia M] Piravinthb:
Hats Off To You Good Sir For Working On This Low End Device
[Sony Xperia M] paper13579:
Wow guys. Well done to everyone who has taken part in this project. It's nice to see that the xperia M isn't dead after all!!
[Sony Xperia M] bubimir13:
I downgraded to 4.1.2 because recovery is only possible on that one for XMS. I hope in near future devs will introduce one for 4.3 as well, as there are more then enough people who will find it usefull, since then i think i will stay on 4.1, even tho 4.3 is visually more attractive and simpler to use...
[Sony Xperia M] Remorcer:
The best option for people who cant unlock their bootloaders is to fry their motherboard. It is not effecient, you need to have warranty, you will be without a phone for a while, and there is no guarantee that the service centre will get you a motherboard that can be unlocked. I just got my phone back after sending it to service 3 times, and got lucky.Yaaaay.
[Sony Xperia M] kirev:
How?
[Sony Xperia M] Remorcer:
Dunno, but I do not suggest it.
[Sony Xperia M] ScouserCL:
What do you need to know to get this working on JB 4.3?
[Sony Xperia M] Piravinthb:
So dude you have XMS 4.1.2 with LB and you installed CWM?

EDIT: FOUND THE ANSWER MYSELF

---------- Post added at 08:25 PM ---------- Previous post was at 07:58 PM ----------

Omg [MENTION=5359154]ndrancs[/MENTION] love you man :D. Awesome work.
[Sony Xperia M] bubimir13:
Yes, it appears fully functional. Only trick is it is pain to install it, so quick restoring after youve donw something wrong is kinda out of option...
[Sony Xperia M] Piravinthb:
Dude do you if we can install ROM? or if we do would it brick the device? And dude BTW the OP says press Volume UP when you see pink LED but when I press it just get stuck on Sony boot screen and I had to press Volume down, have you had the problem?
[Sony Xperia M] bubimir13:
Do not install the ROM because of Locked Bootloader, it might totally brick your device. And i did not encounter that issues at all, all was going smoot.
[Sony Xperia M] Piravinthb:
All right thanks dude
[Sony Xperia M] gamer649:
I have some bad news. My Xperia M is now starting to fail (I can't execute ANY busybox commands) and thus I can't test anything out on my device. I believe it is a failing EMMC chip/NAND memory failing due to unplugging the phone during a software flash.

Due to not being able to do much on the device I am dropping the project I'm afraid, I will upload my work in the next few days so hopefully somebody else can carry it on.
[Sony Xperia M] danield27:
rom with bootloader locked

is rehash install a rom with bootloader locked????????????
[Sony Xperia M] gamer649:
I will upload the files I was working with sometime on Sunday (GMT time), I haven't had a great deal of time to myself this week with work but thankfully Sunday is my day off :P
[Sony Xperia M] gamer649:
As promised, the files I was working with. I hope someone can make use of these. http://d-h.st/TH1U