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

Search This thread

der_akinator

Senior Member
Mar 27, 2015
127
167
Berlin
OnePlus 3T
OnePlus 9 Pro
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 installer zip
  • TWRP team
  • LineageOS
 
Last edited:

Shooter7889

Senior Member
Mar 24, 2019
235
128
FLORENCE
OnePlus 7 Pro
OnePlus 8T

Attachments

  • Screenshot_2022-11-27-23-53-46.png
    Screenshot_2022-11-27-23-53-46.png
    216.9 KB · Views: 362
  • Screenshot_20221128-005551_Root_Explorer.png
    Screenshot_20221128-005551_Root_Explorer.png
    97.7 KB · Views: 368
  • Like
Reactions: der_akinator

der_akinator

Senior Member
Mar 27, 2015
127
167
Berlin
OnePlus 3T
OnePlus 9 Pro
Hi Guys,
Can the latest TWRP be used to flash A13 ROMs like we used to do with older devices? I am fed up with wiping the entire storage for every ROM installation using sideloading...
Updating A13 ROMs, in my case crdroid 13, works fine. I have not tested clean installation of a different ROM after factory reset with user data preservation.
 
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. I have not encountered anything major yet.


Thanks to:
  • Nebrassy
  • TWRP team
  • LineageOS
 

der_akinator

Senior Member
Mar 27, 2015
127
167
Berlin
OnePlus 3T
OnePlus 9 Pro
It seems to boot and decrypt very well, but backup always fails with error createtarfork 255
Your problem seems to be a general TWRP problem, that oftentimes happens in multiuser system. And I couldn't access your recovery.log. In this file you find conflicting files, that are the reason for the error.

Here is a link to the github issue, maybe it helps you solving the problem.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 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!

    7
    Update
    • fix Magisk installation bug
    • fix "failed to mount '/vendor_dlkm (Block device required)" error message on OOS
    5
    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
    First of all, edit your old post instead of making a new one each time you try...

    Second, maybe if xda's having trouble with attachments for you then you should stop trying to upload to xda? Try Google Drive or something instead...

    5 posts in a row like "did it work?" is a bit ridiculous.
    3
    Restore doesn't work on LOS 19.1. Force checked twice...

    I made the backup without pattern/pin, now when it comes to restoring I try to do a factory reset first, I restart I enter the OS, I go back to TWRP and I do the restore, I restart and the lineageos logo stays loading, it restarts only a couple of times, I enter TWRP to get the logs (it doesn't ask for a pin) but I'm going to mount the files and it's empty, it seems that everything has been deleted, in the "mount" option there is a button that says decrypt data, but it asks for a password (text)....
    I could reproduce your issue when restoring backup with pattern set. It looks like super and data shouldn't be restored at the same time.
    May solution:
    1. Factory reset but NOT format data in TWRP
    2. Flash previously installed OTA zip.
    3. Reboot to system
    4. Don't set any pin/password
    5. Reboot to TWRP
    6. Backup should show up again and restore only data
    7. Reboot to system
    8. If that doesn't help reboot to TWRP and restore only super

    Edit: It doesn't matter if backup is made with or without pin/pattern. It is important that pin/pattern is not present when restoring it.
  • 41
    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 installer zip
    • 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!

    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
    5
    Now it's working fine. I'm trying to find a way to flash twrp again.

    Edit flashed vendor.boot image and boot.img and now my phone is dead I gues it's not responding at all.

    Phone is booted to bootloader now.
    If you flashed boot then that's the problem. You don't flash boot. You boot it first.
    fastboot boot boot.img
    Follow the instructions and you won't have any problems.