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

Search This thread

javi2246

Member
Jul 22, 2022
33
6
@MENINBLK had the exact same problem also with google fonts. Maybe he found a solution for that. I will try to replicate for myself and search for a solution.
A few weeks ago I was gossiping on zulip (twrp) and they were talking about this problem. But I don't know if it was in the general, dev or where.
The truth is I have a ****ty memory, so you better ask them directly if you want fix the problem 😅, maybe @osm0sis remember.

I would try to lend a hand, but I have no idea about programming :/

Edit: It doesn't pose any problem to me, you just have to delete those fonts... The OS continues to function well without them.
 
  • Like
Reactions: osm0sis

patkoz16

Member
Jul 2, 2020
23
0
OnePlus 9 Pro
po aktualizacji do Androida 12.1 na powłoce fastboot boot boot.img wyświetlacz utknął w najbliższym fastboot? masz rozwiazanie??

spróbuj fastboot flash boot boot.img?
 
Last edited:

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
after update to android 12.1 on shell fastboot boot boot.img display stuck in fastboot mode ? you have solution ??
Please read Option 3 of the installation instruction. If you are not using root or any other custom recovery you have to first flash vendor_boot.img before fastboot boot boot.img. But at first get the vendor_boot.img of your current system.
 

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
15,307
34,655
Halifax
GT-i9250
Google Nexus 4
A few weeks ago I was gossiping on zulip (twrp) and they were talking about this problem. But I don't know if it was in the general, dev or where.
The truth is I have a ****ty memory, so you better ask them directly if you want fix the problem 😅, maybe @osm0sis remember.

I would try to lend a hand, but I have no idea about programming :/

Edit: It doesn't pose any problem to me, you just have to delete those fonts... The OS continues to function well without them.
I seem to recall @BillGoss reporting that deleting the offending font files had no negative effect, and maybe that the ROM recreates the files after restore and some uptime. Not sure if a general fix was proposed to exclude/fix the issue on the Gerrit or anything, however.
 
  • Like
Reactions: javi2246

patkoz16

Member
Jul 2, 2020
23
0
OnePlus 9 Pro
Przeczytaj opcję 3 instrukcji instalacji. Jeśli nie używasz roota ani żadnego innego niestandardowego odzyskiwania, musisz najpierw sflashować vendor_boot.img przed fastboot boot boot.img. Ale najpierw pobierz vendor_boot.img swojego obecnego systemu.
flash vendor boot to boot or to recovery ? vendor boot.img from my telephone or vendor boot from link this topic ?
 

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
15,307
34,655
Halifax
GT-i9250
Google Nexus 4
Please read Option 3 of the installation instruction. If you are not using root or any other custom recovery you have to first flash vendor_boot.img before fastboot boot boot.img. But at first get the vendor_boot.img of your current system.
One update you should add to Option 1 is that after flashing the TWRP zip in Magisk you don't need to reboot to recovery, you can immediately reflash Magisk with Direct Install in the app, and then any custom kernel from any kernel flasher app before rebooting. 😁
 
Last edited:

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
I noticed a similar error when rebooting into fastbootd. Even on Lineage. Not sure what's up there.

I believe there is no twrp-12 branch in effect, only 12.1, so 3.7.0_12 is correct and matches mainline TWRP. Best to leave it alone.

Would be nice if you could adjust the status header to be below the holepunch when you get the chance! Awesome (and rapid!) work here! 🤘😁

Edit: Oh wait, you just meant the build iteration from -0 to -1! 🤦‍♂️😅
Strange los is using vendor_dlkm but same error on my device too. Any ideas how to pull logs? ADB in fastbootd mode seems to be broken.
 

BillGoss

Senior Member
Sep 2, 2010
5,557
4,904
Sydney
OnePlus 8T
OnePlus 9 Pro
I seem to recall @BillGoss reporting that deleting the offending font files had no negative effect, and maybe that the ROM recreates the files after restore and some uptime. Not sure if a general fix was proposed to exclude/fix the issue on the Gerrit or anything, however.
The backup will fail if there are files (directories are ok) under /data/fonts and /data/nandswap
There was some discussion at the time about excluding them, but it never came to a resolution.

I've never had issues after deleting the files, though they sometimes come back and I've never worked what causes them to reappear.

The problem also affects Orange Fox as it's based on TWRP.
 

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
15,307
34,655
Halifax
GT-i9250
Google Nexus 4
Strange los is using vendor_dlkm but same error on my device too. Any ideas how to pull logs? ADB in fastbootd mode seems to be broken.
I believe adb is tied to MTP Enabled for some reason with the current USB config on this device, but of course there's no data decryption or MTP in fastbootd mode, so no adb.

I'm not sure if @Nebrassy ever figured out how to fix it, but you might want to pick his or other maintainers' brains about it on Zulip.
 
Last edited:

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
  • Like
Reactions: osm0sis

patkoz16

Member
Jul 2, 2020
23
0
OnePlus 9 Pro
Last edited:

Steve0007

Inactive Recognized Developer / Retired Forum Mod
May 10, 2009
5,657
8,928
Paris
OnePlus 8T
OnePlus 9 Pro
@der_akinator
FYI
Currently on latest OOS 13
Flashing twrp thru Magisk, and directly Flasing back magisk works fine
But trying to backup data dont work (error 255).
Also asked for user 10 (company profil) decryption code... Which we don't have.
 
  • Like
Reactions: Smedslund

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
@der_akinator
FYI
Currently on latest OOS 13
Flashing twrp thru Magisk, and directly Flasing back magisk works fine
But trying to backup data dont work (error 255).
Also asked for user 10 (company profil) decryption code... Which we don't have.
Is the user 10 profile specific to you or is this a default profile setup by OOS? I might install OOS13 myself and see whats going on there. Multi user system seem to be a common problem in TWRP. I will try to look into the backup code but it will probably take a bit longer to find a workaround for that. If I can find a solution at all for this...
 
  • Like
Reactions: osm0sis

Top Liked Posts

  • 1
    Maybe someone can answer a question for me: If I wanna replace this TWRP with LineageOS recovery, can I still follow the instructions for installing LOS 20, or do I need to take any extra steps? I remember reading that there is no dedicated recovery partition anymore, so it says to flash it to boot, but just wanted to confirm that that'll replace TWRP with LineageOS revovery.

    Thanks!
    Flash the required boot.img will replace TWRP.
  • 10
    Good new for OOS users. One of the TWRP devs found a workaround for data restore on OOS. Just delete "/data/system/users/0/package-restrictions.xml", after data is restored. I will exclude this file by default in a future build, but for existing backups, the file must always be removed manually.

    Edit:
    This is also useful for custom ROMs, because it makes first boot faster and eliminates the need to reboot again.
    6
    Seems to take a lot longer to boot and show the decryption prompt than -5. 🤔
    Uploaded a new build that reverts some of the fstab changes. Works fine on my device and hopefully on yours too.

    5
    Update
    • Fix backups and logs not accessible from system
    If you already have backups that aren't accessible from system, flash change_backup_selinux_context.zip which is available in the latest download folder. All backups made with TWRP builds starting from 14-01-23 (aka 3.7.0-12.1-4) are affected.

    4
    Hi der_akinator,
    thanks for your reply.

    Why only boot.img can be flashed at the moment ?

    I do not understand the difference between TWRP flashnig methid and Fastboot / ADB sideload and the other stuff.....

    I ask only for better understand as I have anyway understood that the correct procedure is by using Fastboot / ADB sideload and so on.....
    I uploaded a new build with which you can flash vendor_boot and dtbo. It also adds backup support for additional firmware partitions.

  • 46
    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:

    Permanent installation is not possible with TMO stock ROM installed.


    To temporarily boot TWRP, use the first three steps of Option 3.
    For permanent installation, you have three options 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

    Uninstall:

    Just flash the boot partition with your current ROMs boot image with the following steps:
    1. Reboot to bootloader
    2. Run "fastboot flash boot_a YOUR ROM BOOTIMAGE"
    3. Run "fastboot flash boot_b YOUR ROM BOOTIMAGE"
    Alternatively you can flash your currently installed OTA zip, which overwrites boot on the unused slot, but not on the currently used one.

    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.
    To make first boot faster and eliminate the need to reboot again, additionally use the step mandatory for OOS users.

    If you want to copy your backup to PC, but it doesn't show up, flash change_backup_selinux_context.zip, which is available in download folder.

    For OOS users:
    When data is restored, you have to delete "/data/system/users/0/package-restrictions.xml" before rebooting to 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:
    • Permanent installation besides TMO stock isn't possible
    • 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!

    10
    Update
    • improve vibration support
    • fix kernel modules loading in fastbootd mode for custom roms (might result in an error message regarding vendor_dlkm for OOS users, but it's just cosmetic)
    Tested on LOS 19.1 (OOS 12 firmware) and crdroid 13 (OOS 13 firmware).

    10
    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.

    10
    Good new for OOS users. One of the TWRP devs found a workaround for data restore on OOS. Just delete "/data/system/users/0/package-restrictions.xml", after data is restored. I will exclude this file by default in a future build, but for existing backups, the file must always be removed manually.

    Edit:
    This is also useful for custom ROMs, because it makes first boot faster and eliminates the need to reboot again.