Development [RECOVERY][3.7.0-12.1][UNOFFICIAL][UNIFIED] TWRP with A12/A13 encryption support

Search This thread

der_akinator

Senior Member
Mar 27, 2015
130
185
Berlin
OnePlus 3T
OnePlus 9 Pro

Evon88

Senior Member
Feb 4, 2019
116
16
OnePlus 6
This is an unofficial build of TWRP, based on the Android 12.1 branch, that supports encryption used by most Android 12 and 13 ROMs.

As always I'm not responsible any bricked device or data loss resulting from the use of this TWRP version. You use this at your own risk.

For ROMs using FBEv1 encryption aka A11 encryption, please use the official builds by
@Nebrassy from:


Download:



Installation:
  1. Get your rom's vendor_boot image. For most ROMs this can usually be downloaded. For OOS based ROMs you can get it for example by extracting it from the official payload.bin with payload-dumper-go. A third universal option, if you have root, is to use the command "dd if=/dev/block/by-name/vendor_boot_SLOT of=/sdcard/vendor_boot.img" on your device. This writes the vendor_boot image to your sdcard folder, but you have to substitute SLOT with either a or b, depending on your currently active slot.
  2. Reboot to bootloader.
  3. Run "fastboot flash vendor_boot vendor_boot.img" with the TWRP vendor_boot image.
  4. Run "fastboot boot boot.img" with the TWRP boot image.
  5. Go to Advanced > Flash Current TWRP.
  6. After that is done, if you were using a custom kernel, reflash it now.
  7. If you were using magisk, reflash it now.
  8. Reboot to bootloader.
  9. Run "fastboot flash vendor_boot vendor_boot.img" with the ROM vendor_boot image from step one.
In the case you just want to test TWRP without installation, please skip steps 5-7.
Permanent installation works fine for me with crdroid 13 and magisk installed. I have not tested any other ROMs or custom kernels. After permanent installation you can at any time reboot to recovery without reflashing vendor_boot. During a ROM update use the "Automatically reflash TWRP after flashing a ROM" option in the install zip menu to preserve TWRP.


Source Code:

Bugs:

Please let me know.


Thanks to:
  • Nebrassy
  • TWRP team
  • LineageOS
broooooooo, now you are helping all op9p users
much love and respect 😭
 

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
15,196
34,466
Halifax
GT-i9250
Google Nexus 4
Update

Hi everyone,
I just uploaded a new build. It fixes some missing firmware files and kernel module loading.
USB OTG, vibration and battery status is now working.

Download:
Does the A/B flashable zip with the TWRP ramdisk in it work to install it? Might be able to skip the vendor_boot steps that way.

I will try it. Thanks for your tip.
I tried it out over latest Lineage and it does seem to work! I even then re-rooted with Magisk and re-flashed blu_spark from within TWRP. 🥳

Only issue (but it's pretty big) is that vibration is broken and it seems to hang the UI hard any time it tries to vibe, so my workaround is to hit Cancel at the Decrypt page, go to Settings and turn all the vibration down to 0, then go back to Mount and Decrypt Data from there. (You can also just be verrrrrry patient when doing pattern.)

Not sure if this is because I installed the whole ramdisk directly like that or because it's over Lineage. I'm guessing the latter, with some kind of modules mismatch?

Any ideas how to resolve that? Disabling vibration entirely might be needed, since I recall @Nebrassy never got it working across all ROMs.

Either way, being able to use the TWRP zips will save a lot of headaches for rooted users. 🙂

P.S. Also great that vendor_boot is only need for fastboot tempboot, since that means my twrp_ab addon.d-v2 script should work for us already! 🤘

P.P.S. We need to get you in the TWRP Development Zulip if you're not lurking there already: https://rebrand.ly/teamwin-recovery-zulip-community

Edit: twrp-installer-3-7-0_12-0-20221129-lemonadep-zip attachment removed since a newer build exists.
 
Last edited:

der_akinator

Senior Member
Mar 27, 2015
130
185
Berlin
OnePlus 3T
OnePlus 9 Pro
I tried it out over latest Lineage and it does seem to work! I even then re-rooted with Magisk and re-flashed blu_spark from within TWRP. 🥳

Only issue (but it's pretty big) is that vibration is broken and it seems to hang the UI hard any time it tries to vibe, so my workaround is to hit Cancel at the Decrypt page, go to Settings and turn all the vibration down to 0, then go back to Mount and Decrypt Data from there. (You can also just be verrrrrry patient when doing pattern.)

Not sure if this is because I installed the whole ramdisk directly like that or because it's over Lineage. I'm guessing the latter, with some kind of modules mismatch?

Any ideas how to resolve that? Disabling vibration entirely might be needed, since I recall @Nebrassy never got it working across all ROMs.

Either way, being able to use the TWRP zips will save a lot of headaches for rooted users. 🙂

P.S. Also great that vendor_boot is only need for fastboot tempboot, since that means my twrp_ab addon.d-v2 script should work for us already! 🤘

P.P.S. We need to get you in the TWRP Development Zulip if you're not lurking there already: https://rebrand.ly/teamwin-recovery-zulip-community
Yes, your twrp install script works for me too. Tanks for that.

I disabled vibration in a fresh build. Maybe I will find a way to get it working but it isn't important.

I think it's is reasonable for non root users to take the extra two steps in comparison to the official version because it's a one time thing. Updates are possible by using the zip installer.
 
  • Like
Reactions: galaxys and osm0sis

erad1

Senior Member
Dec 3, 2010
1,417
773
MiamiBeach
OnePlus 6
So first off ...thanks for the awesomeness! But ... I'm having an issue with roms not flashing because of a "timestamp" issue? Is there a workaround?
 

GeminiRx

Senior Member
Apr 16, 2011
163
16
HTC Desire
Samsung Galaxy S4
Quick question.
The following is not clear to me.
In step 1 it says to download your own vendor_boot.
In step 3 it says to flash it but which one? My own one or the TWRP one. (I'm currently on CrDroid13)
 

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
15,196
34,466
Halifax
GT-i9250
Google Nexus 4
You flash the twrp one in order to boot twrp, then after permanent install, you flash yours or it won't boot to os
Now that there's a TWRP zip you could skip vendor_boot shenanigans altogether by, a) flash from Magisk app, or even b) flash from custom ROM recovery like Lineage Recovery. 🤘
 

TheSayaMan

Senior Member
Sep 12, 2016
908
380
OnePlus 9 Pro
Now that there's a TWRP zip you could skip vendor_boot shenanigans altogether by, a) flash from Magisk app, or even b) flash from custom ROM recovery like Lineage Recovery. 🤘
Actually no, when you boot this twrp, it will not boot to twrp without the twrp vendor_boot. Likewise, the os won't boot unless you replace it with the original vendor_boot from stock, rom, etc.
 

Top Liked Posts

  • 2
    On Crdroid v8.12 with C.63 OOS12 firmware going into any menu freezes the build. Touch will work from the start but after that it freezes completely.
    I disabled vibration and replaced the last build. Was it the boot image or the zip installer that led to freezing?

    1
    On Crdroid v8.12 with C.63 OOS12 firmware going into any menu freezes the build. Touch will work from the start but after that it freezes completely.
    That's the vibration bug again. As a workaround don't decrypt and go to settings and turn off vibration, then go to mount and decrypt and reboot so it saves the settings file.

    Guess we'll need another build with vibration disabled again @der_akinator. 🫤
    1
    Update
    • add vendor_boot and dtbo to backup targets
    • add CPU temperature output
    • fix vibration (still doesn't work in fastbootd mode)
    I tested this build on LOS 19.1 (OOS 12 firmware) and crdroid 13 (OOS 13 firmware). Also keep in mind that you have to use the boot image according to your installed firmware, if you want to install/test via fastboot.

    Working fine on latest oos 13 eu
  • 8
    Update
    • add vendor_boot and dtbo to backup targets
    • add CPU temperature output
    • fix vibration (still doesn't work in fastbootd mode)
    I tested this build on LOS 19.1 (OOS 12 firmware) and crdroid 13 (OOS 13 firmware). Also keep in mind that you have to use the boot image according to your installed firmware, if you want to install/test via fastboot.

    6
    Update

    This is mainly for OOS13 users that want to install via fastboot.
    • new OOS13 boot image for installation option 3 (tested on OP9pro with OOS13-F72 and F73)
    • adb works independently of mtp now. So it works before decryption and in fastbootd mode.
    4
    @der_akinator, could you add vendor_boot and dtbo to the list of partitions available on the Backup page? It'll cover everything important for custom kernels and recoveries in a backup/restore that way. 🤞😁
    Yes, I can upload a new build in a couple of hours.
    3
    Hi dear dev,

    I'm just playing a bit around with the loved twrp
    First the pro:
    Backup and restore working like a charm (saved me a few times)

    Cons for me (I know it's in early stage and not meant to work perfect on oos13)
    Formatting data is giving error : unable to check mergestatus ( see screenshot)
    Tried installing a Rom just for fun and a few errors appear (mount system, mount vendor etc. Failed) tried to I stall new nameless A13 rom

    Overall it's fantastic to have a dev who is working actively on making a great device even better
    Device : op9 pro running .F73 OOS13

    View attachment 5810375
    Just saying it's no big deal just wanted to say this if I could help you

    Greetings
    Benji
    There is some works regarding this issue but it isn't production ready yet. Maybe with the next TWRP release.
    3
    OP9 not Pro version.
    Stock rom full updated to the last version. ( I can't remember what version was)

    Finally I got a brick and I unbricked with MSM and with stock rom.


    At this point I'm on Oxygen OS 11.2.10.10 LE25AA on OP9 model LE2113.
    with fastboot boot twrp.img was not working.
    I installed official "twrp-3.7.0_11-0-lemonadep.img" and then install with adb sideload twrp-installer-3.7.0-12.1-2-lemonadep.zip


    Recovery is loaded correctly but i'm not able to use (touch isn't working) also I tryed OTB mouse & keyboard but not working.
    I might have found a fix but for testing I depend on you because I haven't an OP9. If you want to stay on OOS11 you should probably use the official TWRP 3.7.0-11.0 version due to differences in encryption.

  • 42
    This is an unofficial build of TWRP, based on the Android 12.1 branch, that supports encryption used by Android 12 and 13 ROMs. This build is tested on OP9pro but it was confirmed to work on OP9 with OOS 12 firmware installed. Other configurations have to be tested.

    As always I'm not responsible for any bricked device or data loss resulting from the use of this TWRP builds. You use this at your own risk.

    For ROMs using FBEv1 encryption aka A11 encryption, please use the official builds by
    @Nebrassy from:

    Download:


    Installation:

    You have three option for this depending on your current system.

    1. Option for rooted devices:
    1. Download the twrp-installer zip
    2. Flash it with Magisk manager or some other kernel flash utility
    3. Reflash your custom kernel and Magisk if previously installed
    2. Option for users with other custom recoveries but without root:
    1. Download the twrp-installer zip
    2. Flash it with "adb sideload twrp-installer*.zip"
    3. Reboot to recovery
    4. Reflash your custom kernel and Magisk if previously installed
    3. Option is universal:
    1. OOS13 (firmware) users please download boot-oos13.img. All other users please use boot.img
    2. Reboot to bootloader
    3. Run "fastboot boot boot*.img" with the boot image
    4. Go to Advanced > Flash Current TWRP
    5. Reflash your custom kernel and Magisk if previously installed

    TWRP Updates:
    1. Download and flash the twrp-installer zip
    2. After that reflash your custom kernel and Magisk if previously installed

    ROM Updates:

    Please follow the official update instructions for your ROM!


    If they give an option to update via recovery you have to substitute adb sideload commands with zip installations. And use the "Automatically reflash TWRP after flashing a ROM" option if you are going to install a ROM zip to preserve TWRP.

    In case your ROM does not provide a recovery update instruction you can try to update via recovery but you are on the safe side if you follow the official instructions. They always have a reason for their particular update instructions!

    Instructions that work for me (on LOS based ROMs):
    1. Flash ROM zip with "Automatically reflash TWRP after flashing a ROM" checked
    2. Flash your previously installed zips (custom kernel, Gapps, Magisk, etc)
    3. Reboot to system
    4. If Gapps packages keep crashing:
      1. Reboot to TWRP
      2. Flash Gapps again
      3. Reboot to system
    For OOS updates you can follow these steps (I haven't tested them):

    About backups/restore:

    Restore data only WITHOUT pin/pattern set.


    Backups can be made with or without pin/pattern set. It is always good practice to copy your backups to your PC or an USB drive. Also after you restored your data partition you have to reboot to system and do a second reboot to get a working system.

    In case you restore a backup with pin/pattern set or have some other issues I have a guide that works for me:

    Source Code:
    Bugs:
    • Vibration is not working
    • vendor_dlkm mount error in fastbootd mode
    • In case you notice anything else please let me know.

    Thanks to:
    • @Nebrassy for the original device tree
    • @osm0sis for the zip installer
    • TWRP team
    • LineageOS
    13
    Update
    • /data/fonts/* is excluded from backups (has to be verified by someone with backup errors)
    • screen turns completely off now
    • updated firmware files from LE2125_11.C.63 (maybe this helps with OOS13 problems)
    • initial installation is now possible without flashing vendor_boot (I tested a few combinations of installation methods and initial system configurations. So hopefully nothing is broken this time.)
    Have a happy New Year tomorrow!

    8
    Update
    • add vendor_boot and dtbo to backup targets
    • add CPU temperature output
    • fix vibration (still doesn't work in fastbootd mode)
    I tested this build on LOS 19.1 (OOS 12 firmware) and crdroid 13 (OOS 13 firmware). Also keep in mind that you have to use the boot image according to your installed firmware, if you want to install/test via fastboot.

    7
    Update

    Sorry for the short update cycles but there are some problems with vibration that results in heavy input delays.
    But the new update also includes a zip installer by @osm0sis which you can just flash to update your currently installed version.

    Download:
    7
    Update
    • fix Magisk installation bug
    • fix "failed to mount '/vendor_dlkm (Block device required)" error message on OOS