[Lenovo P11] LSS4181:
#include <std/disclaimer.h>
/*
* I am not responsible for bricked devices, dead SD cards, thermonuclear
* war, or the current economic crisis caused by you following these
* directions. YOU are choosing to make these modifications, and
* if you point your finger at me for messing up your device, I will
* laugh at you.
*/

This is mostly based on Ungeskriptet's work on TB-J716F. Many thanks to his work. Additionally thanks to the devs of twrpdtgen utility which is very useful for obtaining some very helpful information about the device from a stock recovery image.

The recovery is currently flashable and functional. You may refer to the flashing guide for J716F to flash the recovery on this device as the procedure is the same.

The following stuffs were tested working: Decryption (A11 only), Backup, Wiping, Touch, Fastbootd, MicroSD card.

Other functionalities should behave similar to TB-J716F TWRP.

Not working stuffs: Vibration, busybox (haven't really checked but should be similar to TB-J716F).

Device tree: twrp_device_lenovo_Q706F

UPDATE (Jan 14, 2023): Updated builds of TWRP 3.7.0 for Android 11 (A11) and 12 (A12).

twrp-Q706F-A11-3.7.0-r2: This is for Android 11 GSIs. Can only reliably decrypt Android 11 /data partitions.

twrp-Q706F-A12-3.7.0-r2: This is for Android 12 GSIs. CANNOT decrypt Android 11 /data partitions. Need further testing for Android 12 /data partitions.

Neither build can decrypt Android 13 /data at the moment. If security is not a concern for your use case, you may consider using a tool such as DFE-NEO to disable force encryption of /data. This will enable TWRP to access your /data partition under all circumstances and will save you the hassle of having to back up the entire /data partition when going back and forth between different GSIs.

The updated build contains many more options that can be backed up in case needed. Additionally, some parameters necessary for decrypting A12 /data has been added. Unfortunately, from current feedbacks, it seems decryption is only possible if not using any lock (PIN, Pattern, or Password). Also, with these parameters, it is now possible to make A12 TWRP determine the lock type of A11 /data partition, but it cannot be decrypted even with the correct credential provided.

EXPERIMENTAL: I've added a nuclear option for /data backup, the "Data Image" option. This will back up your /data partition as a whole regardless of its content. You need a large enough external SD card for this option to work, as TWRP's "Enable Compression" doesn't appear to do anything for emmc backups.

!! WARNING !! - Before backing up the entire /data partition, BE SURE TO REMOVE ANY SCREEN LOCK, as after restore, while your system will boot, YOUR CREDENTIALS MAY NOT BE ACCEPTED ANYMORE! YOU WILL LOSE ACCESS TO YOUR USER FILES.

The resulted backup would depend on the size of your internal storage. In my case, the data partition was about 230GB in size, and the whole backup process as well as digest creation took about 2.5 hours in total.

Backing up of the entire /data partition is still experimental, and make sure to check that you're backing up to an external storage if you checked the "Data Image" option!

Spoiler content hidden.

Spoiler content hidden.