[Thinkpad Tablet Android Development] Yahoo Mike:
This version of TWRP works on the Lenovo TB-X606FA, TB-X606F and TB-X606X.

Warning: this TWRP will

not

work for any of the Tab M10 variants with Qualcomm SOCs. For the TB-X505F, see this thread. For the TB-X605F/L, see this thread.

#include <std_disclaimer.h>
/*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*/

Encryption

This device was released with Android 9 using full disk encryption (FDE). But we now have Android 13 GSIs for this tablet - and Android 13 does not support FDE. Android 13 only supports file-based encryption (FBE).

If you are using a ROM/GSI that uses FBE, you must use the twrp with -fbe in the name. If you use the wrong one, twrp will not be able to decrypt the data partition.

If you don't know if you're using FBE or FDE, then run this command while Android is running: adb shell getprop ro.crypto.type. If it returns "block", then your device is FDE. If it returns "file", it's FBE.

Installation

With a stock ROM, it is recommended that you also install Magisk. This will ensure TWRP remains your default recovery.

If Windows 10/11 does not recognise your tablet in fastboot mode, then see post #2.

Step-by-step guide

download TWRP to your PC (see the Download section below)

download the latest magisk.apk to your SDcard or OTG device. Change the filetype from "apk" to "zip".

get a copy of the vbmeta.img file from the stock ROM. It should be located in one of the subdirectories of LMSA's c:\ProgramData\LMSA\Download\RomFiles directory (after you download it using the LMSA rescue (power-off mode). This is only required the first time you flash TWRP, or the first time after you re-flash the whole stock ROM.

if your bootloader is already unlocked, go to step 5. To unlock bootloader:

on tablet: go to Settings->System->About and press "Build number" 7 times to enable Developer Options.

on tablet: go to Settings->System->DeveloperOptions. Turn on: "OEM unlocking" and "USB debugging".

connect tablet to your computer. Tablet will ask for permission to "Allow USB debugging". Tick "always allow" and select "OK".

backup any files you want to keep to an external device (MicroSD/OTG/computer), because the next step will wipe all your photos, files, google account etc on the tablet.

Now unlock the bootloader:

adb reboot bootloader
fastboot flashing unlock

follow the instructions on the tablet, then reboot to Android.

note: if fastboot reports <waiting for device>, then you need to install the Mediatek USB drivers. Go to developer.android.com/studio/run/oem-usb, then find the link to Mediatek (MTK) and follow the installation instructions.

note: after unlocking, tablet will take a while to come back up - because it has to do a factory reset and encrypt data again.

flash the TWRP image:

adb reboot bootloader
fastboot flash recovery twrp_X606FA_11.img
fastboot --disable-verification flash vbmeta vbmeta.img
fastboot reboot recovery

backup the stock boot, system and vendor partitions in TWRP, if you don't have backups already

load Magisk:

In TWRP:

select "Install"

use "select storage" to locate device you stored magisk.zip on.

press the OK button

select the Magisk zip file

swipe to confirm Flash

when Magisk is finished, hit the "Reboot System" button

finished!

If you prefer to use button combos, rather than fastboot/ADB commands:

Vol Down + Power = fastboot mode

Vol Up + Vol Down + Power = recovery mode

Changelog

2023-03-27 - add TWRP 3.7.0 for FBE ROMs/GSIs (Android 13+) only

2022-02-06 - added separate download for TB-X606F

2021-12-16 - TWRP 3.6.0 updates
- support for Android 12 decryption (keymaster)

2021-07-05 - TWRP 3.5.2 updates
- corrected display of Cyrillic (and other non-ASCII characters) in file names on external drives (utf8)

2021-03-10 - TWRP 3.5.1 updates
- cherrypicked update 1995 to force splash screen to display on boot
- orientation is now landscape (for tablets)
- updated install instructions to reflect new Magisk apk (v22).

2021-02-02 - fix blank screen on boot - don't need to press power button anymore to wake screen up

2021-01-24 - TWRP 3.5.0_10-0: initial release

Downloads

(FDE)

This will work with stock ROMs and most pre-A13 ROMs/GSIs.

TWRP 3.6.0_11-0 for X606FA: twrp-X606FA_11.img

TWRP 3.6.0_11-0 for X606F: twrp-X606F_11.img

Downloads

(FBE)

This will

not

work with stock ROMs or most pre-A13 ROMs/GSIs. This is for ROMs/GSIs that use FBE to encrypt. Android 13+ only supports FBE.

TWRP 3.7.0_12-1 for X606FA with FBE encryption: twrp-X606F_12.1.fbe.img

Source code

https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp/tree/twrp-12.1

https://github.com/Yahoo-Mike/recovery_device_lenovo_X606FA/tree/android-12.1-fbe

Credits

The guys at TeamWin Recovery Project.

Everyone whose device trees I plagiarised from GitHub.

Contributors

Yahoo Mike

Created 2021-01-24

Last Updated 2023-03-27 (FBE support)