yashsingh1/xdaforums huggingface dataset:
[Sony Xperia M] KadirDvl:
Custom Recovery .IMG

Can anyone please tell me can i flash cm official recovery via rashr on stock rom ( 4.3 15.4.A.1.9 )
[Sony Xperia M] shubhamgupta1024:
Urgent Query

Can we also use this for the Sony Xperia M Dual C2004

---------- Post added at 10:53 PM ---------- Previous post was at 10:48 PM ----------

Can we use this also for the Sony Xperia M Dual C2004??
[Sony Xperia M] kh34d:
Yes you can.
[Sony Xperia M] KProject:
Sir [MENTION=5917809]cucumber09[/MENTION]

I think this change was really not handy. We can turn on 'use rm -rf instead of formatting' in TWRP setting...

Force use rm -rf is not good! Normal formating and file system change (ex: change to F2FS) feature was gone after use force rm -rf.

https://github.com/TeamWin/android_device_sony_nicki/commit/06b9b2b85165adc2649dc8c1217f4a20c2753712

Sorry my bad English :D
[Sony Xperia M] ataraxist:
does anyone know if this recovery also work with Xperia M5?
[Sony Xperia M] shhnedo:
Have you tried asking in the M5 section first? You're currently asking if a recovery compiled for device X works on the completely different device Y. If you think about it, you'll understand that there's no way this is going ot work. Search your device's section of the forum.
[Sony Xperia M] Agu_Ra:
Благодаря ви за верен отговор, макар че не всичкото е вярно (моят книжовен български не е силно хубав, не съм говорил на него няколко години)

Actually you're right, but sometimes it's possible to port already compiled version by repacking like I did with L's earlier if hardware is similar. Some guys on another forum are using my recovery for E2 or E3, don't remember for sure. Yet M5 has a quite different hardware, it has aarch64 MTK instead of ARMv7 Qualcomm Snapdragon, so it is the most likely to be impossible to port existing image for M to M5. Another thing is screen resolution, our screen is low-res and M5 has HD or even FullHD.
[Sony Xperia M] Antrikos48:
Can you please explain how you would repack the image? (I'm trying to change twrp.fstab in order to enable decryption of internal storage)
[Sony Xperia M] Agu_Ra:
Using Android Image Kitchen. All changes are made depending on device you are porting TWRP to. Yet I strongly recommend you building it from source rather than dirty porting.
[Sony Xperia M] Antrikos48:
I'm not porting, just changing one file and flashing it on my Xperia M
[Sony Xperia M] Agu_Ra:
Decryption should work without changes.
[Sony Xperia M] Antrikos48:
Adopted storage yes, encrypted internal doesn't. Complains about missing footers.
[Sony Xperia M] Agu_Ra:
Hm, I'd look for this but I no longer have Xperia M and neither I have time. So most likely Xperia M users will need new maintainer for TWRP.

BTW, you should check something regarding footer in BoardConfig.mk in device tree in TWRP section and maybe change data partition length in fstab to the negative value like it was before, I've removed data length as it caused some issues (check TeamWin Gerrit if you are curious about that).
[Sony Xperia M] belal elrawy:
remote:command not allowed

my phone c2005 all apps isn't responding after reboot and restarts automatically

my system was cm11 and removed some system apps

my custom recovery changed from twrp to cwm and doesn't accept installing new rom and give error 7 and doesn't remove system or wipe data or make factory reset :confused:

when i flash twrp by flashtool gives ok and no thing changes and when flash by fast boot gives remote:command not allowed

so i am stuck in this useless recovery and i dont know what to do :crying:

tried to flash new ftf but gives error :rolleyes:

any help please :crying:
[Sony Xperia M] PecanCM:
nicki footer is stored inside persist, that partition must be mounted.
[Sony Xperia M] Agu_Ra:
Thanks a lot. I will add persist to fstab ASAP. And I'll need testers as well.
[Sony Xperia M] Antrikos48:
Tried it yesterday, didn't work
[Sony Xperia M] Agu_Ra:
Was persist successfully mounted?
[Sony Xperia M] Antrikos48:
I think so, the log reported a 3 MB ext4 partition but with 0 MB used. I didn't save it but I can retry later if you want and upload it.

EDIT: Here is the relevant section of the log with this twrp.fstab.
[Sony Xperia M] Agu_Ra:
It reports no footer. BTW, I don't know if footer is static or changes after encryption. If static, you can try flashing stock persist partition.
[Sony Xperia M] Antrikos48:
But the footer opens alright when booted into Android and the magic checks out in the recovery (which you can see from the source code and the messages printed on the log). Btw /persist is mounted rw IIRC and it probably contains the encryption key and hashes as well, so it's most probably not static. Anyway I'll take another look at the source code tomorrow when I have more time, unless you have another idea.
[Sony Xperia M] Agu_Ra:
BTW, [MENTION=5493341]Antrikos48[/MENTION], do you have a time and desire to maintain TWRP for nicki? I'll be barely able to carry this burden further.
[Sony Xperia M] Antrikos48:
Yeah sure, I can do that.
[Sony Xperia M] Agu_Ra:
Meet new maintainer!

I thereby declare you as a new maintainer of TWRP for our beloved Xperia M. Now thou art empowered to reign this thread.

Yeah, now you're able to edit this project on XDA (please, don't edit OP by mere editing the post, do it only by editing the project, otherwise you may lose changes done by post editing when you update the project). To change the maintainer on TeamWin site ask devs on their IRC channel, also ask bigbiff to give you Gerrit permissions if you are planning to make changes often (you can also ping me if you need to merge some changes ASAP). Let me know if you have any questions.
[Sony Xperia M] SdtBarbarossa:
that kinda porting with AIK you can do on most xperias with FOTAKernel recovery because they only use the ramdisk.... the M5 uses a real recovery so you will need to compile a M5 kernel for it otherwise it will get you a softbricked device ( like on samsung devices ) .... and if you compile the kernel you can also compile twrp rather then porting ^^
[Sony Xperia M] Agu_Ra:
But you can repack it with stock recovery zImage. :^)
[Sony Xperia M] Antrikos48:
Update time!

Yeah, just got data decryption working

Turns out that TWRP only mounts some hard-coded partitions, even if it processes other entries in the twrp.fstab. So I also had to patch TWRP's partition.cpp file in addition to our twrp.fstab and thus I won't be pushing the changes yet.

If you want to test you can download the image I built from here.
[Sony Xperia M] holamundo216:
I have some trouble updating twrp. When i put this line--->su dd if=/sdcard/fotakernel.img of=/dev/block/mmcblk0p11<--- it says no space left on device, but in root explorer i followed dev/block/platforms/msm_cc.1/by name/ and FOTAKernel is on mmcblk023 (maybe its a dumb question but..) should i select p23 partition in that dd line?
[Sony Xperia M] Nicklas Van Dam:
no bro, try this command

su

dd if=/sdcard/twrp.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel

change twrp.img to fotakernel.img, if you wrong with partition then it wouldn't flash or you will brick your device if that complete to flash too.
[Sony Xperia M] holamundo216:
I tried it too thats the one from the official TWRP page but I get the same error:(, but look aside FOTAKernel it says the route i guess so....the real route is on p23 for my phone not on p11. But in case I mess it up can I just restore all rom? https://drive.google.com/file/d/0B1aLmp-47t8KaEQxWk5VZkJIVms/view?usp=sharing
[Sony Xperia M] Nicklas Van Dam:
You're using xperia m right? How can your fota partition is different from stock partition from xperia m, yah try to flash your stock FTF firmware using flashtool and choose full wipe, then you can try your fota again.
[Sony Xperia M] Antrikos48:
I'm curious, how did you come up with p11? IIRC p23 is FOTA as you've said, but I'm out of town so I can't check with my device.
[Sony Xperia M] holamundo216:
I realize my mistake was searching on a wrong threat in here (it was for an xperia s) wich Fota partition is p11, but I thought it was general (had good luck not messing up my device). Finally i put the command [MENTION=5608002]Nicklas Van Dam[/MENTION] told me again with no apparent success, then after installing RR rom the recovery version was updated
[Sony Xperia M] Godlydevils:
you need to fix the links to your home build and latest build,
[Sony Xperia M] kh34d:
Here it's,

https://dl.twrp.me/nicki/
[Sony Xperia M] Godlydevils:
[IMG="SS twrp"]https://i.imgsafe.org/304404feaf.png[/IMG]

Can someone explain what wrong am I doing here? coz I ain't getting no twrp recovery, using cm 14.1 beta 1
[Sony Xperia M] Antrikos48:
You've got the command incorrectly. You don't need the first of=...

Sent from my OnePlus 3 using carrier pigeons
[Sony Xperia M] PanzerVolr:
I have got a bootloop after unlocking bootloader, I read somewhere on forums that installing custom rom will fix this?

Anyone guide me on installing this twrp and aosp nougat beta 4?
[Sony Xperia M] Bonoboo:
1. Just flash stock via Flashtool.

2. Root > TWRP Manager app > nicki C1905 > install > ignore error

Btw there is CM14.1 on Nougat.
[Sony Xperia M] PanzerVolr:
My phone is dual C2005, where can I find the stock 4.3 rom?

and root using oneclick solutions like kingroot?

Thank you so much for kind replies
[Sony Xperia M] Bonoboo:
1. Model not matter for TWRP.

2. 15.5.A.1.5 FTF

3. On AOSP need to flash SuperSU. On CM enable Developer settings and there root.

Also TWRP not works on stock, only custom rom's.

There available CWM, here kernel with it for that 15.5.A.1.5
[Sony Xperia M] PanzerVolr:
I am gonna follow your instructions but there is one idea in my mind but don't know if it would work

I had a oneplus one before and I booted twrp using fastboot boot twrp.img instead of flashing the recovery using fastboot flash recovery twrp.img so it ran off my computer using the USB cable and didn't actually write any partition. If that works, I can wipe and flash this AOSP Beta 4 Rom which comes with twrp.
[Sony Xperia M] Bonoboo:
CWM built-in kernel for stock.

Try with direct boot, seems works.

But nothing wrong if you write it, boot.img will be overwritten by rom.
[Sony Xperia M] :
How am I supposed to install TWRP if I don't have any sdcard, and I'm not supposed to do it through fastboot (which works perfectly fine though)?

I don't even understand the installation instructions, because when I run adb.exe on my computer, there are no su and dd commands as far as I can tell.
[Sony Xperia M] Bonoboo:
1. Install this app

2. Select there nicki C1905 / C2005

3. Confirm

4. Ignore error

5. Reboot to recovery
[Sony Xperia M] :
But I don't have installed on the phone yet. I need to install TWRP first.

---------- Post added at 17:07 ---------- Previous post was at 16:50 ----------

I figured it out.

I had to change /sdcard to /storage/sdcard1

edit:

Ok I don't know what's going on.

I did what it says on TWRP site and after I restart the phone, it still runs the CM recovery.
[Sony Xperia M] petjacz:
Hello, is it possible to download somewhere old version of TWRP working on XM without FOTA partition architecture? Thank you.
[Sony Xperia M] Bonoboo:
TWRP can be added into any kernel.

What actually you want? Upload your boot.img and I will add it.

Note: on stock kernel screen will be "jumping".
[Sony Xperia M] petjacz:
I have stock rom 15.5.A.1.5 and are preparing to CM rom so before it I want to do some more backups in philz and twrp recovery which I need coz I have C2005 and must apply dual-sim patch. Here is my boot.img (https://uloz.to/!0rCbIFtrKXRU/stock-jb43-15-5-a-1-5-boot-img-zip).

I can't imagine what does it mean "jumping screen" but want to give it a try ;)

Big thank you!
[Sony Xperia M] Bonoboo:
Here you are two versions with latest and oldest TWRP in case if some of them won't work: download
[Sony Xperia M] petjacz:
OMG you are the furious fast developer I know! :)

EDIT:

Good and bad news. Both images flashed via Rashr - Kernel from Storage - but recovery not working. After reboot into recovery, there was/is cyan led for 2-4 seconds and after this time SONY logo flashed for 10 miliseconds and then disapear, phone reboots and then boots up normally.

If I flashed another boot.img with CWM and it is working well.

EDIT2:

Before twrp injection I had philz touch recovery. Question: could this be the reason of failing twrp?
[Sony Xperia M] petjacz:
Hello, I have CWM recovery with this boot.img-ramdisk structure:

\boot\boot.gz

\boot\recovery.gz

\sbin\busybox

\init

\logo.rle

How looks TWRP recovery? Coz I can't setup my current ramdisk to boot into twrp recovery

with the current structure if I only replace recovery.gz with twrp version.

EDIT:

I reached the success! :) ...used TWRP (2.8.3.0) ramdisk-recovery.cpio from zip downloaded here https://xdaforums.com/xperia-m/development/recovery-cwm-twrp-recoveries-custom-rom-t3009361 but the jumping screen is really crazy.

Now I will try to search for newer ramdisk-recovery.cpio versions...

EDIT2:

Successfull insertion of TWRP 3.0.2.0 recovery.gz (source: https://dl.twrp.me/nicki/twrp-3.0.2-0-nicki.img.html) but the problem with jumping screen persist (the main problem at backup password protection).
[Sony Xperia M] Agu_Ra:
Screen jumping needs to be fixed on the kernel side. I know potential solution, yet I'm not sure about it. Search my threads, there is one about TWRP for stock, I've described there how can it possibly be fixed.
[Sony Xperia M] Agu_Ra:
BTW guys, is OTA working for you on Nougat with TWRP? AFAIK, it needs fix in fstab. If it doesn't, I'll push a fix. If I'll build it successfully, you'll get even fixed build, lol. Well, I'll need to resync a ton of code as my build environment is already covered with 2 inches of dust due to not using it.
[Sony Xperia M] emc02:
That would be great!

There is no new nightly and no comments that someone fixed it till now. Also no changelog entry on LineageOS, so I think it's not fixed!

Hope build works well, good luck and thank you!
[Sony Xperia M] Agu_Ra:
I wonder if OTA worked on CM with TWRP. If you are talking about TWRP not working from FOTA partition, that's not what I mean. That's LineageOS bug and I'm not going to fix it as I don't have Xperia M anymore. It is up to Lineage guys to solve this issue.
[Sony Xperia M] petjacz:
OK, will try searching. Thx

EDIT:

@ cucumber09: I found the link you posted about the shaking screen.

Can you tell me what must be changed and where?
[Sony Xperia M] Agu_Ra:
Git commit, I suppose, is ultimately descriptive. You need to change drivers/video/msm/msm_fb.c file in stock kernel source according to commit by link, compile the kernel (google about kernel building) and repack stock boot image with freshly baked zImage.
[Sony Xperia M] petjacz:
So first I must learn how\where to get XM stock kernel source, then how to use android studio and finally how to compile the kernel :]

EDIT:

If I boot into recovery and his UI is jumping, why is it problem of stock kernel if stock kernel is out (not started-up / not in use)?
[Sony Xperia M] Agu_Ra:
Stock kernel can be pulled from Sony's GitHub. Well, you'll need to pick a correct branch. Also you can find source somewhere on Sony developer portal. Android Studio is not needed here at all. But… you'll need a Linux machine.

Kernel IS loaded when recovery boots. On most devices there is a separate recovery partition which technically contains alternative boot image: Linux kernel and ramdisk containing all recovery image files. Since we don't have a separate recovery partition, we start recovery from boot image: there is a keycheck on init and if volume button is pressed, recovery environment is unpacked and loaded. Starting recovery from FOTA partition is also a hack in init (which is packed in boot image ramdisk). There is more info in OP.
[Sony Xperia M] kkyuvaraj:
Sony Xperia M Dual not switch on after Recovery flash

Hi,

I tried to flash Recovery.img using Rashr in my Sony Xperia M Dual (C2004). After flash my phone is not switching on. Even if i press/hold Volume & Power Key it continuously vibrate but not switching on.

Solutions pls.
[Sony Xperia M] Bonoboo:
Fastboot / Flashtool and flash correct boot.img for current rom.
[Sony Xperia M] rexroni:
I would like to have lineageOS on my xperia m (c2004).

Forgive me for being dumb, but after reading 12-15 pages here, and the lineageOS nicki instructions, and the TWRP nicki instructions, I don't know what step to do first...

I need TWRP to install Lineage

I need a non-stock kernel with extract_elf_ramdisk to install TWRP (or root permissions, but I don't know how to root this phone either)

Where do I get such a kernel? How do I install it? Do I have to build my own? Is it just me or should that be on the LineageOS/TWRP instructions?
[Sony Xperia M] eboelens:
First step : unlock bootloader (see official sony website) if done come back here
[Sony Xperia M] rexroni:
Yes, that has been done. It gets stuck in the boot animation after being unlocked. I'm not sure if that is relevant, but I can get it into flash mode and fastboot mode still.
[Sony Xperia M] rexroni:
Nevermind the stuck in booting thing... apparently that was because I kept trying to flash the recovery like it said on the LineageOS instructions. Now it is unlocked and booting fine.
[Sony Xperia M] rexroni:
I did get TWRP to install, which let me follow the remaining LineageOS official instructions. LineageOS is running well on my device (now that I installed the dual sim patch).

The steps I took to get TWRP to work on my stock device:

1) unlock bootloader (using Sony website as per LineageOS instructions)

2) use the "root device" button in Flashtool to start the rooting process, which I finished using the towelroot application on the phone (towelroot.com, click on the lambda image to download)

3) install TWRP application (from TWRP nicki page) and use that application to flash TWRP recovery to the phone. I understand that now TWRP is ready to run in what was previously the FOTAKernel partition, but the stock kernel will never try to run the Recovery from that partition.

4) use ADB to put the lineage build (a zip file downloaded from Lineage website) on my device's internal storage (since I do not have an sdcard for it)

5) reboot into fastboot mode

6) on host computer, unzip the same lineage build (in a directory by itself)

7) on host computer, locate the "boot.img" file from the unzipped lineage build, and flash it with `sudo fastboot flash boot boot.img`. Now the ROM on the phone is broken (since there is a mismatch between the stock ROM and the Lineage kernel) but the lineage kernel will know to call the recovery from the previously-FOTAKernel location.

8) reboot phone. If the LED indicator turns pink, that means that the Lineage kernel is looking in the right place for the TWRP recovery. Press volume up when the LED is pink to start the recovery.

9) Follow the remaining official LineageOS instructions to install Lineage ROM. You should already have the Lineage build (a zip file) on the phone's storage from step 4, making the installation a tad bit easier.

10) when you are done installing the Lineage build, do not press the "reboot" button in TWRP recovery. Pull the battery instead. TWRP does something to try to root the phone when you press that button, and that will make you get stuck in the bootup animation. Or at least, it happened to me and to this guy on reddit who told me about it.

These instructions are meant to fill in the gap between having a stock phone and having TWRP working. It took me a week to figure that much out so I thought I would share my steps.
[Sony Xperia M] srisan:
thanks
[Sony Xperia M] H4NNE5:
Installation troubles

Hi,

I just read a little into the TWRP instructions but I don't get it.

First I followd the instructions in this video, but that doesn't work as I previously mentioned in this post.

So after reading I flashed the boot.img from the "lineage-14.1-20170406-nightly-nicki-signed" folder(I could get into the Lineage Recovery), but after flashing TWRP again I don't get into the recovery and the blue LED stays on when removing the USB cable.

My available tools here are the "Flashtool" and "Minimal ADB and Fastboot".

What am I doing wrong?
[Sony Xperia M] chrikru:
I tried to install LineageOS on a Xperia M too and after wasting about a day trying to flash TWRP directly (as stated in the wrong installation instrucation at Lineage Wiki), I finally came to similar conclusions. I did not work on the first try but after flashing back some ftf with Flashtool, I finally could boot into TWRP and install LineageOS.

Just wanted to confirm that the quoted post shows the correct way to get TWRP running and install anything like LineageOS.

I am trying to contact the guys at Lineage, so that they can correct the wiki....
[Sony Xperia M] Ali Kemal:
download link is dead :(
[Sony Xperia M] Bonoboo:
Huh?
[Sony Xperia M] Ali Kemal:
I thought that download link is in the second paragraph of first post. Sorry but I'm totally lost. All I want is to replace CWM recovery with TWRP 3.0 on my Xperia M with latest stock ROM. Official TWRP app says Flash failed :(
[Sony Xperia M] Bonoboo:
TWRP not compatible with stock for two reasons:

1. Stock boot not support recovery in fota partition, so it need to be bundled into kernel, like CWM.

2. Even if do so due bug in kernel, UI of recovery will be flickering and splitted - barely usable.
[Sony Xperia M] Ali Kemal:
So I need to install custom ROM and then flash TWRP?
[Sony Xperia M] Ali Kemal:
And if in instructions is written "Flash ROM using latest TWRP 3.x Recovery", will it work also via CWM recovery?
[Sony Xperia M] Bonoboo:
Probably, if it's not Nougat-based (7.*).
[Sony Xperia M] Ali Kemal:
Yes it is :D so i try to install custom ROM via CWM based on lower version than Nougat, install latest TWRP and then custom ROM based on 7.1.2. Thank you!
[Sony Xperia M] krouma:
Or you can try this:

1. flash TWRP to boot via fastboot

2. reboot (now you can boot only TWRP!)

3. install any version of custom ROM

4. flash custom ROM's boot to boot

5. flash TWRP to recovery

6. reboot
[Sony Xperia M] Ali Kemal:
I already did it on my own and it is also working. But thank you for easier solution! I will use it in the future :)
[Sony Xperia M] hhjadeja007:
I installed lineage os and I noticed that if I install any zip through twrp after my 1st boot, then I would get stuck into bootloop. Is this just me or this is a known issue?
[Sony Xperia M] hhjadeja007:
Anybody interested in updating twrp with latest sources? I want to use superSU eith SUhide which requires 3.0.2 as min requirement.
[Sony Xperia M] DibyenduMaji:
3.0.2 is available on twrp official Page... LINK
[Sony Xperia M] magicio:
can we have update of latest twrp in nicki? btw updating latest update didn't worked to me form twrp official site.
[Sony Xperia M] Nicklas Van Dam:
Sorry for off topic, I'm already ported TWRP v 3.1.1-0 to our device (nicki). And almost all feature work without problem, if anyone want to try it. Maybe i'll upload it whenever everyone want to update it ;)

Download Link :

Androidfilehost Link
[Sony Xperia M] mayanxoni:
Are you sure that it's a totally working recovery?
[Sony Xperia M] petjacz:
I will be happy if there will be good experience with this recovery and adopted storage restoration ;)
[Sony Xperia M] Nicklas Van Dam:
Yes, boot of them is working. i'm already try it for adopted storage or normal storage recovery.

for totally working, just test it by yourself buddy. at least i'm already test some core function and it work.

both backup and restore with adoptable is working, i'm already try it :D
[Sony Xperia M] petjacz:
2 Nicklas Van Dam: thx for your info I will give it try in the near future
[Sony Xperia M] petjacz:
Successfully flashed using RASHR v.2-3-14 (Recovery from Storage / loaded IMG file from FOTA-TWRP-3.1.1-0.zip) + taked backup using CRAB v.2-0 (restore test maybe later :)

btw. how to take screenshots inside TWRP?
[Sony Xperia M] Nicklas Van Dam:
Simple, just like normal screenshot method. Power + vol down hold it for a second. And screen will get flash in a second and then image will save auto in your storage :)
[Sony Xperia M] KProject:
Power + Volume Down sir.