[OnePlus 9 Pro] der_akinator:
This is an unofficial build of TWRP, based on the Android 12.1 branch, that supports encryption used by Android 12-14 ROMs. This build is tested on OP9 pro, but it was confirmed to work on regular OP9 too.

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 Android 11 encryption, please use the official Android 11 based builds by @Nebrassy from:

https://xdaforums.com/t/recovery-11-official-teamwin-recovery-project.4294289/

Download:

Unofficial OOS 14 images:

24-02-27-OOS-14 - Google Drive

drive.google.com

New official images:

OnePlus 9 Pro (lemonadep)

Disclaimer:Team Win strives to provide a quality product. However, it is your decision to install our software on your device. Team Win takes no ...

twrp.me

Old unofficial images:

twrp-lemonadep - Google Drive

drive.google.com

Installation:

Permanent installation is not possible with TMO 12 stock ROM installed. With TMO 13 stock it's possible, but it was reported that uninstalling causes issues. OOS 14 is currently not supported.

OOS users should make a backup of boot before installation. Otherwise incremental updates can't be applied.

Installation overwrites all boot partition changes done previously (e.g. by Magisk or custom kernel). So you have to reflash all zips that change the boot partition after TWRP is installed.

For permanent installation, you have three options depending on your current system.

1. Option for rooted devices:

Download the twrp-installer zip

Flash it with Magisk manager or some other kernel flash utility

Reflash your custom kernel and Magisk.apk if previously installed (see example of how to install with Magisk manager below). Or alternatively flash zips in TWRP.

Don't reboot

Rename downloaded Magisk.apk to Magisk.zip

Open Magisk app

Select Modules tab

Click "Install from storage"

Select Magisk.zip

2. Option for users with other custom recoveries but without root:

Download the twrp-installer zip

Reboot to recovery

Flash it with "adb sideload twrp-installer*.zip"

Reboot to recovery

Reflash your custom kernel and Magisk.apk if previously installed

3. Option is universal:

Download boot.img

Reboot to bootloader

Run "fastboot boot boot.img" with the TWRP boot image on your PC

Go to Advanced > Flash Current TWRP

Reflash your custom kernel and Magisk.apk if previously installed

Try without installation:

Download boot.img

Reboot to bootloader

Run "fastboot boot boot.img" with the TWRP boot image on your PC

Uninstall:

Just flash the boot partition with your current ROMs boot image with the following steps.

Replace "YOUR ROM BOOTIMAGE" with the filename of the extracted boot image of your current ROM.

Reboot to bootloader

Run "fastboot flash boot_a YOUR ROM BOOTIMAGE"

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.

Collection of OOS boot images:

https://xdaforums.com/t/guide-magisk-unlock-root-keep-root-oos-13-1-0-590.4252373/

TWRP Updates:

Download and flash the twrp-installer zip

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. Also use the "Automatically reflash TWRP after flashing a ROM" option, if you are going to install a ROM zip to preserve TWRP installation.

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):

Flash ROM zip with "Automatically reflash TWRP after flashing a ROM" checked

Flash your previously installed zips (custom kernel, Gapps, Magisk, etc)

Reboot to system

If Gapps packages keep crashing:

Reboot to TWRP

Flash Gapps again

Reboot to system

OOS full OTA updates should work out of the box.

For incremental OOS updates, you have to flash the original boot image. Your can follow this short guide and use the boot image from link in the uninstall section.

https://xdaforums.com/t/recovery-3-...-a13-encryption-support.4523857/post-87946361

About backups/restore:

Restore data only WITHOUT pin/pattern set.

If you restore a backup made from another ROM, then the currently installed, you may have to format data. So please manually copy all contents from /sdcard to a PC or flash drive.

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:

https://xdaforums.com/t/recovery-3-...-a13-encryption-support.4523857/post-87958305

How to use MTP, adb and fastbootD:

Windows:

Install official Google USB drivers and select the right USB drivers. For MTP and adb, the WinUSB driver is sufficient on Windows 11. For fastbootD, Google drivers (Android Bootloader interface) has to be chosen.

You may have to select WinMTP for MTP and Google USB drivers for adb, if you run Windows 10.

To use adb on Windows, MTP has to be disabled with "Mount->Disable MTP" in TWRP.

Steps for choosing a specific driver (no the exact wording):

Connect phone in specific mode

Open device manager

Right click on phone either under "Android device" or "USB device", depending on mode

Select "update driver"

Select 2. option "browse my computer"

Select "pick from available drivers"

Pick driver according to above description

Linux:

Intall the fastboot and adb packages for your distribution

Set udev rules. There might be a package for your distro or use this gh repo: https://github.com/M0Rf30/android-udev-rules

Add user to the group used in udev rules. Most common are "plugdev" and "adbusers"

Source Code:

TWRP: https://github.com/TeamWin/android_bootable_recovery

Kernel: https://github.com/nilz3000/kernel_oneplus_sm8350-twrp

Device Tree:

https://github.com/nilz3000/device_oneplus_sm8350-common-TWRP

https://github.com/nilz3000/device_oneplus_lemonadep-TWRP

https://github.com/nilz3000/android_hardware_oplus

Bugs:

Permanent installation alongside TMO stock isn't possible

Error message regarding vendor_dlkm in fastbootD for OOS users (just cosmetic and not problematic)

In case you notice anything else please let me know.

If you encounter any bug, please give me description with logcat.txt and recovery.log output attached. You can copy those to your data folder in TWRP, if you go to Advanced->Copy Logs.

Thanks

to:

@Nebrassy for the original device tree

@osm0sis for the zip installer

TWRP team

LineageOS