[RECOVERY] TWRP 2.4.3 for all your {legacy}Xperias. (downloads + DIY howto)

Search This thread

Djocker

Senior Member
Feb 4, 2013
237
22
Banjarnegara
TWRP For Xperia J.

I want to mention right away, I own Xperia X10, Xperia S and Xperia V, releases of all other phones are not personally tested by me. But since the kernel is the same in FXP/KXP ROMs I presume they would not harm your device in any way

I want to thank Dees_Troy, bigbiff and all concerned TeamWin members who made this recovery and I want to thank FXP, Kali- Bin4ry, codeworkx and all other CyanogenMod devs who have maintained the device sources for all Xperias. I have just brought these two bodies of work together, I have not "developed" anything here.

Ok first things first. This recovery is embedded into the ramdisk of a normal AOKP bootimage. The kernels are same as the latest AOKP released by KXP team. These kernels should work with FXP's CM10, and other ROM's based of it (KXP ROM, Pac-man, officialCM10 etc). These kernels are not meant to work on stock/cm7/cm9/blah/blah/any other ROM than AOKP or CM10.


INSTRUCTIONS :
1. Download kernel for your device (twrp2.4-boot-youdevicename.img)
2. Download modules (for WiFi) twrp2.4-module-yourdevicename.zip and save to sdcard
3. Fastboot the kernel using the terminal command
Code:
fastboot flash boot twrp2.4-boot-xxxx.img
4. To enter recovery, when LED is pink press {vol up for 2012 models} or {vol down for 2011 models}
5. Flash the module zip that you kept in sdcard from recovery.
6. Enjoy

DOWNLOADS:
Mirror1 |or| Mirror2
download according to your device name in this list
Code:
[LIST]
[*]anzu       Arc/ArcS
[*]aoba          ION
[*]coconut     Live with WALKMAN
[*]haida      Neo V
[*]hallon      Neo
[*]hayabusa   TX
[*]hikari     Acro S
[*]iyokan     Pro
[*]mango    MiniPro
[*]mint       T
[*]nozomi    S/SL
[*]satsuma   Active
[*]smultron   Mini
[*]tsubasa    V
[*]urushi      Ray
[*]zeus      Play
[*]zeusc     Play CDMA
[/LIST]
=======================================================================================
for advanced users/devs/modders/porters
=======================================================================================

SOURCES:
The kernels present inside the bootimages are compiled from these sources
https://github.com/KangXperiaProject/android_kernel_sony_msm8x60 (for all 2012 model phones)
https://github.com/KangXperiaProject/android_kernel_semc_msm7x30(for all 2011 model phones)
The device configs are found on
https://github.com/KangXperiaProject/android_device_semc_<yourdevicename> (for all 2011 model phones)
https://github.com/KangXperiaProject/android_device_sony_<yourdevicename> (for all 2012 model phones)

you can also see our merged commits to see the precise patch we applied on each repository to be able to build TWRP
http://smartdev.com.pl:8080/#/q/status:merged,n,z

BUILD FROM SOURCE
To build TWRP for your Xperia,
1. merge the patch to enable TWRP on your own device tree (for eg. http://smartdev.com.pl:8080/#/c/239/ for Xperia T)
2. replace /bootable/recovery folder with TWRP (as mentioned here http://forum.xda-developers.com/showthread.php?t=2069242)
3. If your build folder is not from CM, switch to CM's build folder (i.e the android_build repo)
4. lunch ; mka bootimage;

PORT TO STOCK/ICS/YOU-FAVOURITE-KERNEL
A boot.img consists of the kernel image and the ramdisk (additionally and optionally RPM.bin and commandline). If you want to use TWRP for some other kernel, you have to do this
1. decompile this boot.img (for 2011 models it's a true boot.img, for 2012 models, it's actually a kernel.elf file renamed to boot.img, so you have to decompile accourdingly. you can use my kernel kitchen to do the same)
2. replace the kernel zImage with the one from the kernel you want to port to
3. replace /sbin/ramdisk.cpio with the "UNCOMPRESSED" ramdisk of the kernel you want to port this to. (usually ramdisk is compressed with gzip i.e. ramdisk.cpio.gz. you need to uncompressed ramdisk image i.e. ramdisk.cpio)
4. do not touch anyother thing
5. pack it up into a boot.img (for 2011) or kernel.elf (for 2012) and fastboot it

============================================================================================
BUGS AND SUPPORT
If you have any problem with this please please please post only on this thread, not on any other thread or not on PM.
Please send me the recovery log wherever possible, and also kmsg/dmesg if you can.
If you need assistance porting TWRP to your kernel, or building from source[only for Xperia phones that I have provided builds for], then also you can post here.

I need TWRP for my Xperia J, cant you help me..... PLEASE................:crying::crying::crying::crying::crying::crying::crying:
 

puppet13th

Senior Member
Bugs on TWRP 2.4.1.0

i found bugs on TWRP 2.4.1.0

- Permission,uid and gid was not stored properly
backup using compression

Restore from backup (created using TWRP 2.4.1.0) --> some files or folder got root UID and GID
Restore from backup (created using TWRP 2.3.3.0) --> OK

attached recovery.log when creating backup
 

Attachments

  • recovery.log.txt
    259.2 KB · Views: 10

Djocker

Senior Member
Feb 4, 2013
237
22
Banjarnegara
Re: [RECOVERY] TWRP 2.4 for all your Xperias. (downloads + DIY howto)

This is work on xperia J?

Sent from my ST26i using xda premium
 

c1ph4

Senior Member
Oct 24, 2012
209
63
aethyx.eu
I really like this.

No issues so far, except: Reboot into recovery isn't working.

Using this feature sometimes in AOKP. The phone just reboots normally, so it could also be ROM related.

Anyway, thanks for this release!

BTW: Some more governors would be appreciated. :p
 

bigbiff

Senior Recognized Developer
Jun 8, 2010
6,939
7,186
i found bugs on TWRP 2.4.1.0

- Permission,uid and gid was not stored properly
backup using compression

Restore from backup (created using TWRP 2.4.1.0) --> some files or folder got root UID and GID
Restore from backup (created using TWRP 2.3.3.0) --> OK

attached recovery.log when creating backup

Thanks for the report. We have debug on in restore. Can you post your restore recovery.log as well?
 

neerajrk37

Senior Member
Jul 5, 2012
117
7
mumbai
first of all thanks of this kernal man.
i m already using twrp 2.3 for my xperia neo v with jb pac man 19.3.0. i wanted to ask if i should format and wipe all the dat before flashing. or because this is an update for my kernel should i just update with the flashtool.
thank you.
and wat do u mean by fastboot in terminal command(is it using terminal emmulator).
pls reply asap
 
Last edited:

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
first of all thanks of this kernal man.
i m already using twrp 2.3 for my xperia neo v with jb pac man 19.3.0. i wanted to ask if i should format and wipe all the dat before flashing. or because this is an update for my kernel should i just update with the flashtool.
thank you.
and wat do u mean by fastboot in terminal command(is it using terminal emmulator).
pls reply asap
using flashtool is cool

wiping not needed
 

M66B

Recognized Developer
Aug 1, 2010
26,031
56,114
the VPS has taken a hit (DDOS) and hence the VPS provider has stalled it for sometime

we expect it to be up in a day or so
That's bad. Happened one time to me too. There is not much you can do.
Your VPS provider should have DDOS protection, it is worth to pay a few dollars extra for that (or switch provider).

Is there any other way to get the patches for building from source for Xperia 2011 devices?
 

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
https://github.com/KangXperiaProject/android_device_semc_mango/commits/jb


the commit "device config for TWRP" should do it for you

other things to keep in mind
use CM10's build folder (i have not checked on anything else)
you should have the recovery ramdisk split patch already enabled. (if you are using the older combined ramdisk this wont work)

********
YOU"LL NEED THIS PATCH TOO
https://github.com/KangXperiaProjec...mmit/f769dc26f6dc867fbb8fd236ccf4a654a53e79c4

(and if not using latest TWRP source then this patch should be present http://review.teamw.in/#/c/466/)
it is already merged in latest TWRP by dees_troy though
 
Last edited:
  • Like
Reactions: M66B

M66B

Recognized Developer
Aug 1, 2010
26,031
56,114
https://github.com/KangXperiaProject/android_device_semc_mango/commits/jb


the commit "device config for TWRP" should do it for you

other things to keep in mind
use CM10's build folder (i have not checked on anything else)
you should have the recovery ramdisk split patch already enabled. (if you are using the older combined ramdisk this wont work)
Unfortunately this is not enough to build a working TWRP for FXP releases. I had to patch a lot more for 2.3, for example all system calls, pthread_cancel, miniadb and reboot to recovery. I was hoping this was already fixed in 2.4, but it appears not to be. I don't want to reinvent the wheel, so I was looking if I could find an already patched 2.4.

See here for the my 2.3 patches.

Edit: just discovered 2.4 is on a new branch ...

Edit #2: TW_FLASH_FROM_STORAGE := true is default now
 
Last edited:

CosmicDan

Senior Member
Jun 19, 2009
5,902
7,741
35
Sydney
Xiaomi Poco X3 Pro
Unfortunately this is not enough to build a working TWRP for FXP releases. I had to patch a lot more for 2.3, for example all system calls, pthread_cancel, miniadb and reboot to recovery. I was hoping this was already fixed in 2.4, but it appears not to be. I don't want to reinvent the wheel, so I was looking if I could find an already patched 2.4.

See here for the my 2.3 patches.

Edit: just discovered 2.4 is on a new branch ...

Edit #2: TW_FLASH_FROM_STORAGE := true is default now

Odd, I never had such an issue. Just dropped in the bootable/recovery folder, removed the private recovery resources in my device tree, and all was good.
 
  • Like
Reactions: M66B

M66B

Recognized Developer
Aug 1, 2010
26,031
56,114
Odd, I never had such an issue. Just dropped in the bootable/recovery folder, removed the private recovery resources in my device tree, and all was good.

Maybe you are using other (kernel/recovery) sources.

In any case I still have to patch pigz/yarn.c and replace

Code:
if ((ret = pthread_cancel(off_course->id)) != 0)

by

Code:
if ((ret = pthread_kill(off_course->id, SIGUSR2)) != 0)

I am not sure about reboot to recovery, I am still building ...

Does backup .androidsecure work for you?

---------- Post added at 02:04 PM ---------- Previous post was at 01:44 PM ----------

My best guess you are using another bionic version.
 

CosmicDan

Senior Member
Jun 19, 2009
5,902
7,741
35
Sydney
Xiaomi Poco X3 Pro
Maybe you are using other (kernel/recovery) sources.

In any case I still have to patch pigz/yarn.c and replace

Code:
if ((ret = pthread_cancel(off_course->id)) != 0)
by

Code:
if ((ret = pthread_kill(off_course->id, SIGUSR2)) != 0)
I am not sure about reboot to recovery, I am still building ...

Does backup .androidsecure work for you?

---------- Post added at 02:04 PM ---------- Previous post was at 01:44 PM ----------

My best guess you are using another bionic version.

Yeah .android_secure backup works fine. I actually build from AOSP 4.1.2 source, but my /build folder is entirely from FXP and some other patches here and there too. I don't think I ever modified anything in bionic from 4.1.2_r1/jb-mr0-release tag (a.k.a JZO54K). Also, my device is Xperia 2011.
 
  • Like
Reactions: M66B

M66B

Recognized Developer
Aug 1, 2010
26,031
56,114
Yeah .android_secure backup works fine. I actually build from AOSP 4.1.2 source, but my /build folder is entirely from FXP and some other patches here and there too. I don't think I ever modified anything in bionic from 4.1.2_r1/jb-mr0-release tag (a.k.a JZO54K). Also, my device is Xperia 2011.
I don't understand why you can compile without changes. I have unresolved references for pthread_cancel and pthread_setcancelstate. Futhermore the source transport_local.c is missing and reboot to recovery needs a fix. See here for my patches so far (I got TWRP 2.4 running now, but it still needs testing).
 

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
I don't understand why you can compile without changes. I have unresolved references for pthread_cancel and pthread_setcancelstate. Futhermore the source transport_local.c is missing and reboot to recovery needs a fix. See here for my patches so far (I got TWRP 2.4 running now, but it still needs testing).
you are use the twrp2.4 branch right ??
 

CosmicDan

Senior Member
Jun 19, 2009
5,902
7,741
35
Sydney
Xiaomi Poco X3 Pro
It was even working for the jb-wip branch, i.e. 2.3.x.x.

All my AOSP sources are on GitHub, maybe there were more changes required but I changed them in my AOSP build for another reason before building TWRP.

Are you using the toolchain included in AOSP 4.1.2 repo or some other prebuilt one? Because I don't recommend that. It probably doesn't make a difference but I build on Ubuntu 12.10 x64.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 61
    DISCLAIMER: I own Xperia X10, Xperia J, Xperia Tipo, Xperia S and Xperia V, releases of all other phones are not personally tested by me. But since the kernel is the same in FXP/KXP ROMs I presume they would not harm your device in any way

    Huge props go to all TeamWIn people like Dees_Troy and bigbiff and everyone else for developing this awesome recovery and lots of thanks to FreeXperia Team (FXP, Kali-, codeworkx, bin4ry,) for maintaining device configs for Xperias

    This recovery is embedded into the ramdisk of a normal AOKP 4.1.2 bootimage. The kernels are same as the latest AOKP released by KXP team. These kernels should work with FXP's CM10, and other ROM's based of it (KXP ROM, Pac-man, officialCM10 etc). These kernels will not work on stock/cm7/cm9/blah/blah/any other ROM.


    INSTRUCTIONS :
    1. Download the zip file for your device (twrp2.4.3-xxxxx.zip)
    2. Extract the boot.img from zip on your PC, and copy the whole zip file on device's SDcard.
    3. Fastboot the kernel using the terminal command
    Code:
    fastboot flash boot boot.img
    4. To enter recovery, when LED is pink press {vol up for 2012 models} or {vol down for 2011 models}
    5. Flash zip that you kept in sdcard from recovery (wifi/OTG/etc will not work without proper modules flashed).
    6. Enjoy

    DOWNLOADS:
    Mirror1 |or| Mirror2
    download according to your device name in this list
    Code:
    [LIST]
    [*]anzu       Arc/ArcS
    [*]aoba          ION
    [*]coconut     Live with WALKMAN
    [*]haida      Neo V
    [*]hallon      Neo
    [*]hayabusa   TX
    [*]hikari     Acro S
    [*]jlo         J
    [*]iyokan     Pro
    [*]mango    MiniPro
    [*]mesona       Miro
    [*]mint       T
    [*]nozomi    S/SL
    [*]satsuma   Active
    [*]smultron   Mini
    [*]tapioca    Tipo
    [*]tsubasa    V
    [*]urushi      Ray
    [*]zeus      Play
    [*]zeusc     Play CDMA
    [/LIST]
    CHANGELOG :
    All official changes to TWRP is found on http://teamw.in

    Code:
    =============twrp 2.4.3
    code updated to oficial twrp 2.4.3.0
    new device J, Tipo, Miro supported
    
    =============twrp2.4
    code updated to official twrp 2.4.1.0
    fixed "/boot not found" error on 2011 phones
    
    =============twrp 2.3
    official twrp 2.3 sources
    first release
    =======================================================================================
    for advanced users/devs/modders/porters
    =======================================================================================

    SOURCES:
    The kernels present inside the bootimages are compiled from these sources
    https://github.com/KangXperiaProject/android_kernel_sony_msm7x27a (for Tipo, J, Miro)
    https://github.com/KangXperiaProject/android_kernel_sony_msm8x60 (for S,Ion,AcroS, T, V, TX)
    https://github.com/KangXperiaProject/android_kernel_semc_msm7x30 (for all 2011 model phones)
    The device configs are found on
    https://github.com/KangXperiaProject/android_device_semc_<yourdevicename> (for all 2011 model phones)
    https://github.com/KangXperiaProject/android_device_sony_<yourdevicename> (for all 2012 model phones)

    you can also see our merged commits to see the precise patch we applied on each repository to be able to build TWRP
    http://smartdev.com.pl:8080/#/q/status:merged,n,z

    BUILD FROM SOURCE
    To build TWRP for your Xperia,
    1. merge the patch to enable TWRP on your own device tree (for eg. http://smartdev.com.pl:8080/#/c/239/ for Xperia T)
    2. replace /bootable/recovery folder with TWRP (as mentioned here http://forum.xda-developers.com/showthread.php?t=2069242)
    3. If your build folder is not from CM, switch to CM's build folder (i.e the android_build repo)
    4. lunch ; mka bootimage;

    PORT TO STOCK/ICS/YOU-FAVOURITE-KERNEL
    A boot.img consists of the kernel image and the ramdisk (additionally and optionally RPM.bin and commandline). If you want to use TWRP for some other kernel, you have to do this
    1. decompile this boot.img (for 2011 models it's a true boot.img, for 2012 models, it's actually a kernel.elf file renamed to boot.img, so you have to decompile accourdingly. you can use my kernel kitchen to do the same)
    2. replace the kernel zImage with the one from the kernel you want to port to
    3. replace /sbin/ramdisk.cpio with the "UNCOMPRESSED" ramdisk of the kernel you want to port this to. (usually ramdisk is compressed with gzip i.e. ramdisk.cpio.gz. you need to uncompressed ramdisk image i.e. ramdisk.cpio)
    4. do not touch anyother thing
    5. pack it up into a boot.img (for 2011) or kernel.elf (for 2012) and fastboot it

    ============================================================================================
    BUGS AND SUPPORT
    If you have any problem with this please please please post only on this thread, not on any other thread or not on PM.
    Please send me the recovery log wherever possible, and also kmsg/dmesg if you can.
    If you need assistance porting TWRP to your kernel, or building from source[only for Xperia phones that I have provided builds for], then also you can post here.
    6
    Re: [RECOVERY] TWRP 2.3 for all your Xperias. (downloads + DIY howto)

    @leo_nidas

    http://forum.xda-developers.com/showthread.php?p=36575186

    With text editor edit the /sdcard/TWRP/.twrps Changing "tw_backup_boot 1" to "tw_backup_boot 0" fixes the "Unable to locate boot partition" error...
    (edit with notepad++ on pc or build in text editor on phone)

    Sent from my Xperia Ray using xda premium
    6
    I pushed up the following changes to the CM repos for the Xperia T (mint) and they have been accepted. Similar changes will be pushed for CM10 as well as for fuji-common and Xperia S (nozomi):
    http://review.cyanogenmod.org/#/c/30309/
    http://review.cyanogenmod.org/#/c/30311/

    The short version is that these changes will allow users to flash whatever recovery they want to the FOTAKernel partition that effectively isn't used for anything on an unlocked device. If you choose to boot recovery then the boot image will extract the ramdisk from the FOTAKernel partition and use that ramdisk for recovery if the ramdisk in the FOTAKernel partition isn't a stock Sony ramdisk. If you don't have a custom recovery flashed to the FOTAKernel partition then the boot image will boot the recovery that's included in the boot image.

    Unfortunately this method doesn't provide safety against flashing a bad boot image as you're still using the kernel from the boot image, but this setup does make it easier for users to choose to run an alternative recovery than what a developer might choose to include in his boot image. However, for this method to work, the developer does have to include the ramdisk extraction tools and methods.

    Eventually I hope to see Sony move to a normal recovery that can be booted directly with a key combo so that we don't have to depend on things in the boot image. A proper recovery setup provides a measure of safety for users by allowing them to have a fallback for an unbootable device that doesn't require a computer to fix so that you can safely flash on the go.

    I hope that all kernel and ROM developers will adopt a method like this so that we can allow users to choose what recovery they would like to run while not expecting devs to produce multiple versions of boot images for each release.
    4
    Same here .Will TWRP be updated to the 2.4 version ?
    yes will be updated to 2.4 and the kernel backup bug on 2011 shall also be fixed

    had been busy with life for the past few days

    also Przemek mentioned to me that more than 20PLN has been already received out of the needed 50PLN, so thanks guys :)
    4
    Lets hope that will see it inserted in stock kernels too alongside with the cwm recovery . It would be awesome to have 2 recoveries in one kernel.

    i am working on my own recovery... once thats ready i can merge other recoveries into a common ramdisk and give users access to multiple recoveries through a menu... i had done something similar for the X10, ARC, etc...


    OK this is how I fixed adb in Xperia 2011 TWRP ramdisk:

    Code:
    --- init.rc    Tue Jan 20 09:26:08 1970
    +++ init.rc    Tue Jan 20 09:26:08 1970
    @@ -1,3 +1,6 @@
    +
    +import /init.semc.usb.rc
    +
     on early-init
         start ueventd
     
    @@ -26,10 +29,11 @@
         write /sys/class/android_usb/android0/enable 0
         write /sys/class/android_usb/android0/idVendor 0fce
         write /sys/class/android_usb/android0/idProduct 615d
    -    write /sys/class/android_usb/android0/functions adb
    +    write /sys/class/android_usb/android0/functions mass_storage,adb
         write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
         write /sys/class/android_usb/android0/iProduct ${ro.product.model}
         write /sys/class/android_usb/android0/iSerial ${ro.serialno}
    +    write /sys/class/android_usb/android0/enable 1
     
     
     on boot
    @@ -47,13 +51,18 @@
     
     service recovery /sbin/recovery
     
    +service console /sbin/busybox sh
    +    console
    +    disabled
    +
     service adbd /sbin/adbd recovery
         disabled
     
     # Always start adbd on userdebug and eng builds
     on property:ro.debuggable=1
         #write /sys/class/android_usb/android0/enable 1
    -    #start adbd
    +    start adbd
    +    start console
         setprop service.adb.root 1
     
     # Restart adbd so it can run as root

    the 2012 ramdisk is different... and the idProduct code is slightly different...


    P.S.: if adbd is not given shell use a different adbd in the ramdisk...