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

Search This thread

Andsie

Senior Member
Jun 26, 2017
50
7
OnePlus 9 Pro
Yes, but I want to wait with updating the first post until I get some feedback. Last time it broke the zip installer but this time it looks good to me.
i gave it a try on Stock ROM A13 f.72:

fastboot boot twrp.img did not work

installing zip under magisk worked fine - kept root by installing magisk rightaway after flashing twrp.zip

first backup worked fine, too

one problem: not every usb external drive is recognized

error "failed to mount '/vendor_dlkm (Block device required)" is still present
 

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
i gave it a try on Stock ROM A13 f.72:

fastboot boot twrp.img did not work

installing zip under magisk worked fine - kept root by installing magisk rightaway after flashing twrp.zip

first backup worked fine, too

one problem: not every usb external drive is recognized

error "failed to mount '/vendor_dlkm (Block device required)" is still present
At least the zip installer works now. Could you provide a logcat output and recovery.log that captures the usb drive issue. You find this option at Advanced -> copy log -> Include logcat.
 

Steve0007

Inactive Recognized Developer / Retired Forum Mod
May 10, 2009
5,657
8,928
Paris
OnePlus 8T
OnePlus 9 Pro
Yes, but I want to wait with updating the first post until I get some feedback. Last time it broke the zip installer but this time it looks good to me.
I have just tried on Stock ROM A13 F72:

Installing zip under magisk worked fine
Kept root by installing magisk.apk rightaway after flashing twrp.zip
Data backup worked fine
Just need to reinitialize the phone and see if data restore would work?

Also got the error message "failed to mount '/vendor_dlkm (Block device required)" but as you said it is just comestic.
Thanks for your work !!
 

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
I have just tried on Stock ROM A13 F72:

Installing zip under magisk worked fine
Kept root by installing magisk.apk rightaway after flashing twrp.zip
Data backup worked fine
Just need to reinitialize the phone and see if data restore would work?

Also got the error message "failed to mount '/vendor_dlkm (Block device required)" but as you said it is just comestic.
Thanks for your work !!
Restoring data works fine for me but I had to reboot two times for everything to work.
 

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
I would have sent this to you - but I don't find it after processing on my phone - do I do something wrong?
By default it's written to /sdcard but you have to unlock data. If you select an other storage location like an USB drive, it is written to the root of that drive. You can also use your PC and run "adb logcat", which prints everything to your terminal screen.
 

osm0sis

Senior Recognized Developer / Contributor
Mar 14, 2012
15,307
34,655
Halifax
GT-i9250
Google Nexus 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.
 

Andsie

Senior Member
Jun 26, 2017
50
7
OnePlus 9 Pro
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.
A little bit rude - dear osmosis

BTW - editing a post is not the solution, either
 
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.
No, no! He should try more, because why not?
 

ffejy462

Senior Member
Jan 17, 2013
1,945
1,092
Ames
OnePlus 6T
OnePlus 9 Pro
Fyi. If updating oos incrementally, after uninstalling magisk, updater will fail at 34%.

Flash current boot img, then update oos. After reboot, confirm update took, then reinstall TWRP.

ie
Updating oos incrementally if TWRP is installed:

Download incremental update
Uninstall magisk (restore images)
Flash boot img (exkm or similar) of current, not new, oos rom
Update oos with updater app
Install magisk to inactive slot (after ota)
Reboot
Confirm oos update
Flash TWRP per og instructions
 
Last edited:
  • Like
Reactions: der_akinator

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
Fyi. If updating oos incrementally, after uninstalling magisk, updater will fail at 34%.
Flash current boot img, then update oos. After reboot, confirm update took, then reinstall TWRP.
ie
Update oos steps with TWRP:
Download incremental update
Uninstall magisk (restore images)
Flash boot img (exkm or similar) of current, not new, oos rom
Update oos with updater app
Install magisk to inactive slot (after ota)
Reboot
Confirm oos update
Flash TWRP per og instructions
Did it work with the steps you mentioned or are they the steps which lead to failure? Do you mean with incremental flashing a full OOS zip on top of OOS or a partial OTA zip? There are some problems with partial OTAs and they are not recommended to be installed via TWRP.
 

ffejy462

Senior Member
Jan 17, 2013
1,945
1,092
Ames
OnePlus 6T
OnePlus 9 Pro
Did it work with the steps you mentioned or are they the steps which lead to failure? Do you mean with incremental flashing a full OOS zip on top of OOS or a partial OTA zip? There are some problems with partial OTAs and they are not recommended to be installed via TWRP.
The steps I listed are the steps needed to incrementally update oos if TWRP is installed. Oos updater will fail at 34% if current boot img isn't flashed before updating.

My post was intended to help those with oos and TWRP trying to update incrementally. The update failure isn't an issue with TWRP, but rather (a feature of) the updater.
I did, however, kinda expected magisk restoring images functionality negating the need to flash boot img, but I guess I was mistaken.
Thank you for getting us a working TWRP on a12/13 btw.
 

ThePresence

Senior Member
May 24, 2011
1,073
233
31
Mumbai
OnePlus 9 Pro
I've OOS13 F17. How do I update to F18? Any recommended steps or I should just flash ota via updater and reflash magisk and in done. What's the correct way to update.
 

der_akinator

Senior Member
Mar 27, 2015
168
259
Berlin
OnePlus 3T
OnePlus 9 Pro
I've OOS13 F17. How do I update to F18? Any recommended steps or I should just flash ota via updater and reflash magisk and in done. What's the correct way to update.
I can't give you an advice because I don't run OOS but just do it as described by @ffejy462 three post above. Keep in mind that partial OTAs can cause problems.
 
  • Like
Reactions: ffejy462

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.