[RECOVERY][Android 10/11][Stock/SODP][XZ2/C/P/3] TWRP 3.4.0-0 [UNofficial]

Should I continue this project?

  • Yes, for the XZ2.

    Votes: 160 35.6%
  • Yes, for the XZ2C.

    Votes: 146 32.5%
  • Yes, for the XZ2P.

    Votes: 37 8.2%
  • Yes, for the XZ3.

    Votes: 106 23.6%
  • No.

    Votes: 0 0.0%

  • Total voters
Search This thread


Apr 9, 2019
Redmi K20 / Xiaomi Mi 9T
NVM: doing this for my dad and he told me the wrong model number :(

Hi Martin. I'm on XZ2P Dual and I tried installing twrp with no luck. I am stuck on blank black screen after booting to twrp. I am able to see the device with adb with the black screen. Also I am unable to boot to system. Wondering if there's a kernel I can flash for twrp to work?
Last edited:
May 3, 2013
it does not work with the latest firwmare (52.1.A.3.137) i follow the guide but when i flash the twrp,and click reboot,it reboots again on twrp and not into the system.can you update the twrp?? or is because i have the dual sim model h9436 and that in the twrp folder is for the 1 sim ?(h8416) @MartinX3 i follow instructions of

toto4c19 but nothing...​

Last edited:


Senior Member
Jan 8, 2021
Sony Xperia Z5 Compact
Xperia XZ2
it does not work with the latest firwmare (52.1.A.3.137) i follow the guide but when i flash the twrp,and click reboot,it reboots again on twrp and not into the system.can you update the twrp?? or is because i have the dual sim model h9436 and that in the twrp folder is for the 1 sim ?(h8416) @MartinX3 i follow instructions of

toto4c19 but nothing...​

oh! easy, go to "Advanced" then "Fix Recovery Bootloop"
  • Like
Reactions: alexisnik199111


Senior Member
Jan 8, 2021
Sony Xperia Z5 Compact
Xperia XZ2
don't have the knowledge to do this.also its too difficult,for the developer who made the root app,to updated to the latest firmware of the device. seriously now....
here you go :)
run the fastboot flash boot boot_X-FLASH-ALL-B6B5.img command. or..you know how to flash it


  • boot_X-FLASH-ALL-B6B5.img
    64 MB · Views: 16
Last edited:
  • Like
Reactions: alexisnik199111

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    The Sony Open Devices Project is always happy about volunteers (coding, testing, etc) :)
    Also mainlining your favorite snapdragon powered xperia device into the mainline kernel is possible and we will be glad to help you!

    #include <std_disclaimer.h>
     * We are not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns about features included in this ROM
     * before flashing it! YOU are choosing to make these modifications, and if
     * you point the finger at us for messing up your device, we will laugh at you.

    Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.

    • Just wiping your phone in TWRP lead into an encrypted & not readable userdata in the stock system.
      You need to open advanced wiping and check the entries data and internal storage.
      Of course clear the dalvik, too.
    • If you backed up system and/or vendor partitions and you want to restore them, make sure that TWRP setting "Use rm -rf instead of formatting" is set!.
    • If after the usage of NewFlasher or the OTA Updater or something else, which installs stock firmware parts you get stuck into the TWRP or SONY Logo, you need again to disable the verification with the vbmeta.img file and its parameters in fastboot.
    • fastboot & adb
    • Weird problems not easily to reproduce by other users require that you make sure, that you
      • Use the newest platform tools (adb & fastboot)
      • Downloaded the newest firmware via Xperifirm from XDA and installed the newest firmware via Newflasher from XDA
    • Newflasher from XDA
    • Xperifirm from XDA
    • Removing the stock bloat apps via titanium backup may result in a boot loop. Use a file explorer to remove them, disable them or try to use my unfinished bloat removal script at github.
    • Your phone reboots into recovery, instead of system? Maybe it crashed too often due to a wrong installation or whatever?
      In TWRP:
      • Code:
        cat /dev/block/bootdevice/by-name/misc
        shows you the reason.
      • TWRP -> [WIPE] -> [Advanced Wipe] -> Tick only the misc -> [Swipe to Wipe]

    Known Bugs:
    • The "fastboot boot twrp.img" doesn't work, if you use the hardware buttons to open the blue fastboot bootloader mode. Only use adb, twrp or the android system to reboot into blue fastboot bootloader mode or flash the twrp.img, boot the device, reboot into bootloader and flash the original boot.img back, before booting into twrp.
      You can also "fastboot reboot bootloader" in the blue fastboot mode.
      This is a bootloader bug, maybe it gets fixed with the stock Q bootloader.
    • If "fastboot boot twrp.img" results into a blackscreen and reboot of the phone, take a look if you modified the DTBO partition.
      It requires a special TWRP for every modified kernel/dtbo until I find some way to unify the twrp kernel with the DTBO (if the bootloader supports it).


    • A bugreport needs your device name, dmesg, the /tmp/recovery.log and a way to reproduce the issue.
      If possible use
      logcat -b all
      instead of just a dmesg.
      • If ADB is not working to provide logs
        • VOLUP+POWER for 1 Seconds -> Forced crash to create a pstore
        • Boot the normal system.
        • Give me the files in
    • If the TWRP is stuck at the TWRP logo, the chances are high, that the decryption didn't succeed.
    • To rescue a not responding phone:
      • VOLUP+POWER for 3 Seconds -> RESTART with one Vibration.
      • VOLUP+POWER for 20 Seconds -> SHUTDOWN with 3 Vibrations.
      • VOLUP+POWER+CAMERA for 30 Seconds -> HARDWARE SHUTDOWN by discharging a capacitor.

    Thank you very much for your help, code contribution & testing! (Random order):
    • @dees_troy and his team of volunteers for the TWRP code
    • @dhacke thank your for providing a download server
    • Shame on me if I forgot someone after searching through the thread and my PM's!
    • And many thanks to the few donators! :)

    A telegram group for technical SODP stuff:

    XDA:DevDB Information
    TWRP, ROM for the Xperia XZ2

    MartinX3, Sony
    Source Code: https://github.com/MartinX3-AndroidDevelopment

    ROM OS Version: Android 10
    ROM Kernel: Linux 4.x
    ROM Firmware Required: Newest recommended
    Based On: AOSP

    Version Information
    Status: Stable
    Current Stable Version: 3.4.0-0
    Stable Release Date: 2020-06-13

    Created 2020-03-29
    Last Updated 2020-06-20
    Download & Installation


    1. Update to newest stock firmware before unlocking!!!
    2. Unzip the *.gz files with https://7-zip.org/ or Linux.
    3. Enter fastboot via software, not hardware buttons. See "Known Bugs".
    4. fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
    5. fastboot boot twrp.img
    6. Advanced menu -> "Install recovery ramdisk" -> Choose twrp.img
    7. Reboot into installed TWRP
    8. Want Root? -> Magisk
    9. (Only if your phone doesn't boot to system anymore) Advanced menu -> "Fix recovery bootloop"
    10. (Optional; Security degradation; Only if you know what you're doing) Switch SELinux to permissive (with my permissive.zip)
    This means TWRP for 52.1.A.2.1?
    I'm working on it this week plus a refactoring of the twrp device tree
    The refactoring for the SODP twrp is now completed.
    It'll work without a flashed ROM (vendor/system/oem partition)
    Here runs now a nice 3.4.0 TWRP (new version since today)

    Now what's left
    - the STOCK TWRP touch driver refactoring, since the touch drivers aren't in the stock kernel, but external kernel modules which get started by bash scripts in stock.....
    - stock twrp without decryption to always work
    - sodp twrp without decryption to always work


    Reuploaded the SODP TWRP with a workaround for Android 11 compatibility.

    reuploaded the stock twrp for the xz2 premium with a completely fixed touch.

    reuploaded the stock twrp with a later touch kernel modules initialization.
    Hopefully fixing the randomly happening not working touch.

    thanks to the fixes in 3.4.0 we got now a twrp with the following enhancements for stock and sodp:

    - this twrp will work with future 10.0 roms, you don't need a new build matching the security patch level of your rom.
    - you can install this twrp again with the buildin ramdisk patcher. Please follow the installation instructions.

    switch to twrp 3.4.0
    sodp twrp 2020-06 security patch level
    stock twrp 2020-05 security patch level for firmware 52.1.a.2.1

    now both twrp should work without a rom being installed (empty system/vendor/oem partitions) and still be able to decrypt your userdata.
    Also the stock twrp touch should now always work instead of playing russian roulette.

    reuploaded sodp twrp for 2020-05 security patch level.
    It didn't boot with the newest aosp.

    sodp twrp for 2020-05 security patch level.

    removed stock twrp for firmware 52.1.a.0.672 until sony releases the kernel sources of the new security patch level.
    Otherwise the keymaster won't decrypt the userdata for twrp and twrp gets stuck on the twrp logo.

    stock twrp for firmware 52.1.a.0.672
    sodp twrp for 2020-04 security patch level

    hopefully fixed the touch problems of the stock twrp

    fixed the forced read only partition mountings of system, vendor, odm

    stock twrp for firmware 52.1.a.0.618

    sodp twrp for 2020-03 security patch level
    installing in ramdisk (to make it persistent) is impossible at the moment, because it is a 9.0 twrp which makes its ramdisk incompatible to the rom.

    Of course monthly twrp releases in sync with the current patch level need to be released or i would need to remove the userdata decryption completely.

    The stock twrp will follow, after it became ready.