[RECOVERY][TB-X505F][UNOFFICIAL] TWRP 3.6.x for Lenovo Tab M10 HD - Thinkpad Tablet Android Development

This version of TWRP works on the Lenovo TB-X505F (wifi).
For the TB-X505X, see this thread. For the TB-X605F/L, see this thread.
For the TB-X606F/L, see this thread. The X606F/L is the second gen M10 and it uses a Mediatek SOC.
Code:
#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.
*/
Working:
AFAIK, everything is working including:
data decryption
MTP
Known issues:
time not adjusting for Daylight Saving
OTA (for a workaround see this post)
Before installing TWRP
Before you install TWRP, upgrade your tablet to the Android 9 (Pie) or Android 10 (Q) stock ROM.
This tablet shipped with Android 8 (Oreo), in which the bootloader did not allow unlocking. When you tried to unlock the bootloader, it gave this error message:
Code:
fastboot oem unlock-go
FAILED (remote: 'unknown command')
fastboot: error: Command failed
Installation
It is recommended that you also install Magisk. This will ensure TWRP remains your default recovery.
Step-by-step guide
download TWRP to your PC (see the Download section below)
download magisk.apk to your MicroSD or OTG device. Get the latest Magisk apk file here. Rename the filetype from apk to zip (for example Magisk-v22.0.zip)
if your bootloader is already unlocked, go to step 4. 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:
Code:
adb reboot bootloader
fastboot oem unlock-go
fastboot reboot
flash the twrp image:
Code:
adb reboot bootloader
fastboot flash recovery twrp.img
if you haven't loaded Magisk yet, go to step 6. If you have already loaded Magisk, you can just reboot and you're finished:
Code:
fastboot reboot
adb reboot recovery
load Magisk (step one): reboot to recovery. Do not reboot into the system, because it will over-write TWRP with stock recovery. If that happens, go back to step 4 and start again. When you issue the reboot command (below), you have to immediately press the button combination to reboot to recovery (TWRP). Here are the steps:
issue the reboot command:
Code:
fastboot reboot
immediately press and hold all three buttons (Pwr+VolUp+VolDown). The tablet might reboot twice. Release all the buttons when you see the TWRP screen, or hear your PC acknowledge that ADB is connected.
load Magisk (step two): flash 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
Code:
01/03/2023 - bug fix: data partition again backs up and restores correctly
20/01/2023 - add TW_EXTRA_LANGUAGES and TB_X505F_S001149_221115_ROW kernel (credit to @Tonyha7 )
30/12/2022 - add system partition to AdvancedWipe (TB_X505F_S001147_220830_ROW firmware only)
15/11/2022 - TWRP 3.7.0-0 update
- support for TB_X505F_S001147_220830_ROW
18/12/2021 - TWRP 3.6.0-0 update
- support for A12 decryption (keymaster)
27/03/2021 - TWRP 3.5.1-0 update
- change to landscape mode for tablets
01/01/2021 - TWRP 3.5.0-0: initial release
Downloads
TWRP 3.7.0-0 for X505F: twrp-X505F_11.img (for TB_X505F_S001147_220830_ROW and above)
TWRP 3.6.0-0 for X505F: twrp-X505F_11_2021.img (for earlier stock ROMs)
Source code
https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp/tree/twrp-11
https://github.com/Yahoo-Mike/recovery_device_lenovo_X505F/tree/android-11.0
Credits
The guys at TeamWin Recovery Project.
Everyone whose device trees I plagiarised from GitHub.
Contributors
Yahoo Mike
Tonyha7
Last Updated 2023-03-01 (fix /data backup/restore)
Created 2021-01-01

reserved

Thanks for useful post,
Possible to reboot into recovery from fastboot?

zubair1836 said:
Thanks for useful post,
Possible to reboot into recovery from fastboot?
Click to expand...
Click to collapse
Not that I know of. The bootloader accepts the command fastboot reboot recovery, but boots to system anyway.

Hello there, I've been looking how to install this on my slow tablet for almost like an hour. Could there be some tutorial or extended explanation to the process and installation, I'm such a noob, sorry.

This worked for me. Thank you for your effort and the TWRP!

Worked for me too - many thanks!
Can't wait for a custom ROM!
TWRP Recovery Installation Steps
1. Download android platform tools
2. Unlock developer mode on the M10
3. Enable USB debugging on the M10
3. OEM unlock enable on the M10
4. XDA download TWRP copy to sd
5. Download Magisk app (from Github!!! johnwu), change extension to .zip
6. Adb to fastboot
7. fastboot flash recovery [filename.img]
8. Turn off device
9. Turn on device holding all 3 buttons, release when see Lenovo splash screen
10. In TWRP find Magisk zip
11. Install Magisk
Stock ROM Recovery
1. Download qualcomm drivers 64 bit install
2. Download Lenovo recovery and image tool windows app from Lenovo support website
3. Fastboot oem edl
4. Turn off M10
5. Start recovery windows app, wait till instructions
6. Hold volume up (up is the side of the button closest to the front camera) and insert cable
7. Release button after windows app detects device
8. Troubleshoot by checking windows device manager for the M10 appears as a Qualcomm device

I'm thinking about getting one of these tablets, but before I do so I'd like to know that the screen lock still works after installing TWRP.
This might sound like a crazy question, but my Samsung Tab A won't set a screen lock - pattern, PIN or password - once TWRP has been installed, and I'd rather not run into the same issue again.

Heeni said:
I'm thinking about getting one of these tablets, but before I do so I'd like to know that the screen lock still works after installing TWRP.
This might sound like a crazy question, but my Samsung Tab A won't set a screen lock - pattern, PIN or password - once TWRP has been installed, and I'd rather not run into the same issue again.
Click to expand...
Click to collapse
Confirmed working normally.

zubair1836 said:
Confirmed working normally.
Click to expand...
Click to collapse
Many thanks.

Thank you! TWRP is working fine!
Stupid me flashed before I installed the Android 10 OTA, so I had to temporarily go back to stock recovery. Unfortunately beamingbadger's method didn't work for me.
This is how it worked for me:
Download the OTA via Lenovo's "Rescue And Smart Assistant"
The stock recovery image will be in the Download folder (default path: C:\ProgramData\LMSA\Download\RomFiles) called "recovery.img"
Flash the recovery.img the same way as you would with the twrp img (adb reboot bootloader -> fastboot flash recovery recovery.img)
fastboot reboot
Install OTA
Flash TWRP recovery + Magisk again (follow the steps from the first post, skip bootloader unlock)

The method I use to install OTAs is:
open Magisk App
select "Uninstall Magisk", then the "Restore Images" option
reboot to Android (you will have no root access and stock recovery is restored)
apply OTA
re-flash twrp and install Magisk
NOTE 1: if you've unencrypted your data partition, it will be re-encrypted by this process.
NOTE 2: the new Magisk App (v22) can be installed in TWRP by renaming the *.apk to *.zip. See the new install instructions.

What's involved with running gsi ROMs on this device? It's got the same SoC as my Samsung Tab, which runs them well, so I'm assuming that this tab will also, but I'd like to know if there are any traps that I need to be aware of.

I can partly answer my own question. It all went more smoothly than I expected: installing TWRP, Magisk and then LineageOS R Mod //LiR, followed by Disable_Dm-Verity_enfec.zip.
If I want to try other GSI ROMs, do I need to flash stock before trying another one? I've had some trouble doing that (won't boot) and it's possibly to do with encryption.

Heeni said:
I can partly answer my own question. It all went more smoothly than I expected: installing TWRP, Magisk and then LineageOS R Mod //LiR, followed by Disable_Dm-Verity_enfec.zip.
Click to expand...
Click to collapse
That's great news. Well done.
Heeni said:
If I want to try other GSI ROMs, do I need to flash stock before trying another one? I've had some trouble doing that (won't boot) and it's possibly to do with encryption.
Click to expand...
Click to collapse
On my X605F I do this in twrp for a new GSI install:
format (not wipe) data partition. This is the option where you have to confirm by swiping.
factory reset. This clears the caches.
restore the stock boot and vendor partitions (from a backup I made). This is because Magisk can touch these partitions.
install the GSI system image
install anything else I need like disable_Dm-Verity, Magisk, gapps etc
I don't know what LOS R Mod //LiR does to your system. If it touches any other partitions, you should restore those to stock too.

Thanks for that. It gives me something to go on with. I've downloaded the stock ROM from lolinet, so I can grab the boot and vendor images from that.

I was able to try a couple of other GSI ROMs and I've settled on AndyYan's LineageOS 17.1 for now. The only serious installation issue I had - which I can laugh about in hindsight - was thinking I'd got myself into a very bad bootloop, when all I needed to do was let go of the power button after the Lenovo logo appeared.
On this tablet, there is no navigation capability at all (no navbar, no gestures, no setting to configure them) on installation, and I have to set it using adb. I suspect it goes back to PHH basic ROMs, but I don't feel like doing yet another install and testing right at this moment. Is this happening on the other tablets that you're testing, or is it unique to this one?

I just posted the v3.5.1 update to twrp.
It's also changed to landscape mode, as many of you requested.

Quick question, how do i apply new system updates with twrp installed? Should i not bother? Also, i forgot how to block check for updates!

will this allow flashing of stock roms download from lenovo recovery? ive been stuck on an ancient android 9 version because the ota updater fails.

Related

[UNOFFICIAL] TWRP 3.0.0-0 for the Pixel C (dragon-ryu) :: Current: 02-11-2016-1

This is UNOFFICIAL TWRP for the Pixel C. That said, the TeamWin team greatly helped me in getting this working. But at the same time, neither TeamWin nor me take any responsibility whatsoever for any undesired outcome resulting from any kind of use of this project and project files! If you don't exactly know what you're doing then just walk away and do something good. Don't touch any options of which you don't exactly know what they're for!
What works:
* So far, everything; encryption support should work, but some feedback on this would be welcome
Problems:
* The GUI will be sometimes slow, sometimes super slow. This is probably due to the high screen resolution of the Pixel C.
How to install:
- Unlock bootloader
- In the bootloader, run "fastboot flash recovery <.img file>"
- Reboot into Pixel C bootloader
- Boot into recovery (or later on/from Android through "adb reboot recovery")
If the recovery doesn't stick after booting into Android:
- Do the install procedure as above
- Do NOT reboot into Android
- Press Vol-Down + Power until you see the bootloader menu
- Select "Boot into Android Recovery"
- When in TWRP, mount system
- Using TWRP's File Manager, or using adb, delete the file "/system/bin/install-recovery.sh"
- Reboot
After doing this, OTAs won't work any longer, but they wouldn't work anyway after installing TWRP. Just so you know
DOWNLOAD
twrp-3.0.0-0-dragon-ryu-02-11-2016-1.img
SHA1 hash: 3e97aae6cc18975683eda2bd3732faaecec14166
Changelog
:: 01-19-2016-1
- Removed screen timeout by default, since the GUI is very slow and the screen unlock slider is very hard to use
- Added an option to fix the Fastboot Full Cap flag directly from TWRP; you find the option in "Advanced". If the Pixel C should ever not let you flash in fastboot, boot into TWRP, select Advanced -> Fix Fastboot, swipe to confirm, and you're set.
:: 02-11-2016-1
- Rebased on twrp/android-6.0 branch (i.e. upgraded to TWRP 3.0.0-0)
The recovery is based on the Pixel C stock kernel.
Awesome! I can survive without root for the time being but being able to enable multiwindow would be amazing!
Thanks!
Edit: I am getting a FAILED (remote: unsupported command) error and cant flash this. Anyone know a work around?
Worked fine for me with "fastboot flash recovery [image name]" did you unlock your bootloader? Also root works just fine, you just have to boot from your PC.
Sent from my Pixel C using Tapatalk
brando56894 said:
Worked fine for me with "fastboot flash recovery [image name]" did you unlock your bootloader? Also root works just fine, you just have to boot from your PC.
Sent from my Pixel C using Tapatalk
Click to expand...
Click to collapse
I did unlock my bootloader but can't get anywhere. Tried updating my sdk, drivers everything. I guess I will have to keep playing with it.
Edit: I relocked my bootloader, and then unlocked it again and now it is working. If anyone else runs into this give it a try.
it successfully installed on my pixel c. is reachable as the Android Recovery option. and boots to bootloader to allow boot of boot.img
this is a good thing. thanks to all involved.
it's been 1 month since release and good way to celebrate.
Good work. Thanks you
hooray thanks! just to clarify: I need encryption disabled to use twrp or just to flash SuperSU?
I'm currently using phhusson's noverity boot-img to boot and with a modified vendor img root is working fine while encryption is enabled ... just having to boot via fastboot every time is a bit awkward. And since I don't know what happens if the device got stuck and reboots itselfe without the modfied boot it would be awesome to have at least a nandroid backup
doumer said:
hooray thanks! just to clarify: I need encryption disabled to use twrp or just to flash SuperSU?
I'm currently using phhusson's noverity boot-img to boot and with a modified vendor img root is working fine while encryption is enabled ... just having to boot via fastboot every time is a bit awkward. And since I don't know what happens if the device got stuck and reboots itselfe without the modfied boot it would be awesome to have at least a nandroid backup
Click to expand...
Click to collapse
Hey... You can use TWRP even with encryption enabled, you just can't write anything to /data.
However for the next build I'm going to enable TWRP's decryption option and see if it works with the Pixel C. If it does I'll post a new build this evening (European Time).
I tried the systemless SuperSU on a decrypted /data partition but it wouldn't work (bootloop), clearly there's a lot of ground to cover here, but like I said maybe the decryption functionality will help us here.
EDIT: I'm also working on a boot.img with disabled forced encryption. Looks like we're going to get proper root very soon.
cheep5k8 said:
This is UNOFFICIAL TWRP for the Pixel C. That said, the TeamWin team greatly helped me in getting this working. But at the same time, neither TeamWin nor me take any responsibility whatsoever for any undesired outcome resulting from any kind of use of this project and project files! If you don't exactly know what you're doing then just walk away and do something good. Don't touch any options of which you don't exactly know what they're for!
What works:
* Well, basically everything IN TWRP works, it's just that without a kernel that disables forced encryption this is not of very much use. I tried flashing SuperSU, but it wouldn't work properly.
Problems:
* The GUI will be sometimes slow, sometimes super slow. This is apparently still a problem with how TWRP uses the graphics mode that is used on the Pixel C. Best is if you immediately disable the screen lock once you boot into TWRP because the unlock slider is abysmally sluggish.
How to install:
- Unlock bootloader
- In the bootloader, run "fastboot flash recovery <.img file>"
- Reboot into Pixel C coreboot bootloader
- Boot into recovery (or later on/from Android through "adb reboot recovery")
DOWNLOAD
2.8.7.0-01082016-1
Click to expand...
Click to collapse
Hello thank you for this. Yesterday I tried to build as well twrp but it wasn't fully working.
I just imported this config with TW_INCLUDE_L_CRYPTO := true && TW_INCLUDE_CRYPTO := true
I didnt copy paste the twrp.fstab I added but added its path to BOAR_smthing.
Also I used omnirom's android-6.0 revision with dragon's device tree.
The recovery seems to boot, as
Code:
adb devices
returns XXXXXx recovery.
Also I can reach the device's shell with adb shell. Just the screen stays black.
I was wondering if I missed something. Is your device tree available online ?
Khaon said:
Hello thank you for this. Yesterday I tried to build as well twrp but it wasn't fully working.
I just imported this config with TW_INCLUDE_L_CRYPTO := true && TW_INCLUDE_CRYPTO := true
I didnt copy paste the twrp.fstab I added but added its path to BOAR_smthing.
Also I used omnirom's android-6.0 revision with dragon's device tree.
The recovery seems to boot, as
Code:
adb devices
returns XXXXXx recovery.
Also I can reach the device's shell with adb shell. Just the screen stays black.
I was wondering if I missed something. Is your device tree available online ?
Click to expand...
Click to collapse
Not yet. I'm going to upload it later on to the TWRP devs for official inclusion.
You need to merge the minui patch so TWRP can use DRM for video on the Pixel C; there is no fb0 device.
there were some new boot images out today. i flashed one of them. when i boot to recovery the sdcard is not able to be mounted. do you have any suggestions on what i need to do or look at in order to get it fixed?
dkryder said:
there were some new boot images out today. i flashed one of them. when i boot to recovery the sdcard is not able to be mounted. do you have any suggestions on what i need to do or look at in order to get it fixed?
Click to expand...
Click to collapse
Because /data is (force-)encrypted. I uploaded a new TWRP build with various fixes but decryption doesn't work.
What I also found out is that the boot image for the Pixel C is NOT an Android boot image (!), but a ChromeOS one. This puts a lot of things in doubt, for example I am not sure if systemless SuperSU can handle this.
But, I'm working on all that (working on boot img without forced encryption right now, but so far it doesn't want to boot completely)
OK, so, I'm running the device unencrypted now, but there are many issues still to resolve.
OK guys, if you really want actual SuperSU, and other root stuff, and decrypted /data, here's how it works but it's complicated and will only work tethered as far as I can tell.
First, download this boot image: dragon-boot-encryptable-01092016-1.img
Now here are the steps:
- make sure you have a stock boot.img handy in case something goes wrong (as usual I can not take responsibility but chances of bricking are extremely slim if you know what you're doing)
- boot into fastboot
- flash the above boot image to boot ("fastboot flash boot dragon-boot....")
- flash the TWRP recovery (latest version) ("fastboot flash recovery twrp-dragon-...")
- hold power+vol down pressed.. the device will turn off, keep it pressed even as it turns off, it will turn on again and you are in the coreboot menu
- select "Android Recovery" which will start TWRP
- in TWRP, select system as read only when it asks ("never write onto the system partition").. my boot image does not disable dm-verity which seems to be still in effect, so if you change /system, the Pixel will refuse to boot (even though it's unlocked... no idea)
- once in TWRP, go to "Wipe" and then choose at the bottom "Format Data" (just wiping will not work)
- when that's done stay in the recovery
- get SuperSU 2.66 from somewhere and flash it through TWRP (using sideload for example)
- when it's done, go to "Backup" in TWRP and only backup boot (the kernel) - no password - no compression
- somehow copy the backed up kernel from the device to your computer ("adb pull" for example), but in no case let the Pixel boot into Android
- when that's done, tell TWRP to boot back into the bootloader
Now get ready to be real quick...
- boot (just boot, not flash) the TWRP backed up boot image (it's 32MB large and called boot.emmc.win, but it's all good): "fastboot boot boot.emmc.win" (and now you have to be rather quick)
- It will boot up for a second and then go back to the "The OS will boot in 30 seconds screen"
- Again press power+vol down and hold it, even as the device turns off, until you're in the coreboot bootloader
- There, choose fastboot again
- And once again boot the boot.emmc.win image ("fastboot boot boot.emmc.win")
- Now let it boot up
- If everything went OK you should be in Android, with decrypted /data, and SuperSU should be installed and working
If you want to avoid being encrypted again (although SuperSU should survive that) you will have to boot tethered everytime using that boot.emmc.win image.
Known Issues: Somehow because /data is decrypted, "Security" settings in Android will crash. Hopefully you don't need anything in there. You might also want to skip setting a lock pattern or pin when doing the initial setup, it might crash too.
So far, I tried installing AdAway using root which worked just fine.
If someone figures out how make this untethered: you da real MVP!
Thank you sir!! I will report back if I encounter any undocumented issues.
OK so I've managed to install Xposed, was pretty straightforward except for the tethered boot. Still looking into making it untethered.
since your modified boot and no encryption it seems to be smoother in graphics. in any event, the thing worked in format of data and install of the supersu zip. so, well done.
cheep5k8 said:
How to install:
- Unlock bootloader
- In the bootloader, run "fastboot flash recovery <.img file>"
- Reboot into Pixel C coreboot bootloader
- Boot into recovery (or later on/from Android through "adb reboot recovery")
DOWNLOAD
2.8.7.0-01082016-2 UPDATE: Includes various fixes from first build; decryption of data does NOT yet work
Click to expand...
Click to collapse
So, followed these instructions and whenever I try to reboot into recovery I get the no command screen. Am I missing something? lol
Edit: So figured thats the stock recovery stuff. Got to the stock recovery but can't get into twrp
2nd Edit: I redownloaded the file and didnt rename it shorter this time and now it works...weird
cheep5k8 said:
Not yet. I'm going to upload it later on to the TWRP devs for official inclusion.
You need to merge the minui patch so TWRP can use DRM for video on the Pixel C; there is no fb0 device.
Click to expand...
Click to collapse
Thank you for those informations .
Thank you so much for this! Aside from the laggy UI, which isn't an issue since we got TWRP (f yes!!!), this is amazing. Do you foresee any issues flashing fonts? I am not familiar with ChromeOS and Android structure combination as it seems there is a lot of talk about. Flashing a file that replaces the stock fonts with the ones of my choosing hypothetically should not pose a problem to /system/fonts/, correct? Thank you for your work

[RECOVERY][TB-X605F/L][OFFICIAL] TWRP 3.6.x for Lenovo Smart Tab M10

This version of TWRP works on both the TB-X605F (wifi) and TB-X605L (LTE). It does not work for the TB-X605FC/FL (Tab M10 FHD Rel).
Warning: this TWRP is for the Lenovo Smart Tab M10 with the Snapdragon 450 (SDA450) chipset. This image will not work for the second gen M10 (TB-X606F/L), which use a Mediatek SOC. See this thread.
For the M10 HD (TB-X505F/L), see this thread. For the TB-X505X, see this thread.
Code:
#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.
*/
Possible issues with TB-X605L
If the latest version of TWRP for TB-X605F doesn't work for your TB-X605L model, try version 3.4.0-0 from twrp.me.
Installation
TWRP for this device is officially supported. You can download it from twrp.me or in the TWRP App (from the PlayStore). Installation instructions are included on twrp.me.
It is recommended that you also install Magisk. This will ensure TWRP remains your default recovery.
Step-by-step guide
download TWRP to your PC (see the Download section below)
download magisk.zip to your MicroSD or OTG device. Get the latest Magisk zip file here.
if your bootloader is already unlocked, go to step 4. 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:
Code:
adb reboot bootloader
fastboot oem unlock-go
fastboot reboot
flash the twrp image:
Code:
adb reboot bootloader
fastboot flash recovery twrp.img
if you haven't loaded Magisk yet, go to step 6. If you have already loaded Magisk, you can just reboot and you're finished:
Code:
fastboot reboot
adb reboot recovery
load Magisk (step one): reboot to recovery. Do not reboot into the system, because it will over-write TWRP with stock recovery. If that happens, go back to step 4 and start again. When you issue the reboot command (below), you have to immediately press the button combination to reboot to recovery (TWRP). Here are the steps:
issue the reboot command:
Code:
fastboot reboot
immediately press and hold all three buttons (Pwr+VolUp+VolDown). The tablet might reboot twice. Release all the buttons when you see the TWRP screen, or hear your PC acknowledge that ADB is connected.
load Magisk (step two): flash 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 back button to go back to main TWRP screen.
select "Reboot" then "System"
if the Magisk Manager app wasn't automatically loaded, you can get it here.
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
Code:
02/03/2022 - TWRP 3.6.1_9: new TWRP release
23/11/2021 - TWRP 3.6.0_9: new TWRP release
01/01/2021 - TWRP 3.5.0-0: new TWRP release
21/11/2020 - TWRP 3.4.0-1: new official version with SPL patch
19/11/2020 - promoted security patch level to 2099-12-31. No need to worry about SPLs ever again.
02/09/2020 - promote security patch level to 2020-08-01 for TB-X605F_S210208_200807_ROW
06/08/2020 - officially supported
31/07/2020 - upgrade to TWRP 3.4.0-0
- data decryption working (security patch 2020-04-01)
- landscape mode (by popular demand)
- add more partitions to Backup options
15/01/2020 - reverted to API 28 (Android Pie)
- renamed "sdcard1" to "external_sd"
- changed [ro.build.incremental.version] in preparation for OTA #4
24/11/2019 - fixed date/time & EDL reboot mode
- dropped back to API 27
20/11/2019 - initial commit (API 28) - encryption/decryption not working
Downloads
official​
TWRP for X605F: twrp.me
Source code
github.com/minimal-manifest-twrp/platform_manifest_twrp_omni/tree/twrp-9.0
github.com/TeamWin/android_device_lenovo_X605F (official)
github.com/Yahoo-Mike/recovery_device_lenovo_X605F (unofficial)
FAQ
See the third post for answers to some FAQs like:
Will this TWRP work with other M10 and P10 devices?
Why is my "Data" partition empty (0 MB)?
how do I root my device?
Credits
The guys at TeamWin Recovery Project.
Everyone whose device trees I plagiarised from GitHub.
The amazing work of @Chaser42, @Long_Sam and others to get this project started.
XDA:DevDB Information
X605F Recovery, Tool/Utility for the Lenovo Thinkpad Tablet
Contributors
Yahoo Mike, Chaser42
Source Code: https://github.com/TeamWin/android_device_lenovo_X605F
Version Information
Status: Testing
Created 2019-11-19
Last Updated 2022-05-22 (v3.6.1 and warning for TB-X605L)
Encryption/Decryption
When you load the stock ROM, it creates and automatically encrypts the data partition. If you are not using the correct TWRP version, the data partition might be empty (0 MB). This is because TWRP failed to decrypt the data partition.
If your data partition is 0MB in TWRP, make sure you have loaded the latest version of TWRP (Nov 2020 or newer). Older builds required the security patch levels to match on TWRP and your system.
If you want to remove encryption completely, then you can use the dm-verity-forceencrypt tool. @turboperson123 has put together some instructions to remove encryption. If you've already loaded TWRP, then you only need to follow steps 6 and 7 from that post. @turboperson123 's method uses @Zackptg5 's Universal DM-Verity, ForceEncrypt, Disk Quota Disablers tool to remove encryption and dm-verity.
FAQs
Can I use this TWRP on other M10 and P10 tablets?
There are quite a few variants of these Tabs that use the Snapdragon 450 (SDM450) chipset:
TB-X605F (Tab M10 wifi) - tested working this TWRP
TB-X605L (Tab M10 LTE) - tested working with TWRP ( thanks @alexupsa )
TB-X705F/L (Tab P10) - no. Use the twrp available on this thread.
For the TB-X505F/L (M10 HD) see this post.
NOTE: the TB-606F/L (M10 2nd gen), TB-X605FC (M10 FHD) use different chipsets, so this TWRP won't work.
Why is my "Data" partition 0MB?
See the second post in this thread.
What should I backup?
Short answer: everything.
But the bare minimum might include:
System Image
Vendor Image
Firmware/Modem
Persist
Data
Cache
Boot
How do I root my device?
To root your device, here are the instructions for the:
X705F (thanks to @Chaser42)
X605F/L - follow steps 6 & 7 in the OP above. If you don't want to load TWRP, then try something like @Long_Sam's patched boot.img method.
X505F/L - follow the "step by step guide" in the OP above. Just make sure you use twrp for X505F (not for X605F).
How do I load OTAs with TWRP?
Note: if you ran the dm-verity-forceencrypt tool to unencrypt your /data, then the steps below will not work.
select "uninstall" in the Magisk Manager app. If MM doesn't reboot the system, then reboot - this will re-install stock recovery.
install the OTA (either in the system or using stock recovery).
re-flash TWRP (for the new security patch level)
re-install Magisk
TB-X605L working properly. Thank you!
TB-X605L working properly. Thank you!
Yahoo Mike said:
This is a work in progress. Volunteer testers are very welcome.
Click to expand...
Click to collapse
Wow...
That's really huge...
As we say here : "Monsieur, chapeau bas !"
Long_Sam
Lenovo has released quite a few variants of the Tab M10 now. I'm not sure this TWRP will work on all of them.
There are now even variants of a variant !
Code:
[B]M10[/B] with SDM-450 models: X605F (wifi) & X605L (LTE)
[B]M10 HD[/B] with SDM-429 models: X505F (wifi), X505L (LTE) & X505X (LTE Bands 1,2,3,4,5,7,8,20,38,40)
[B]M10 FHD[/B] with SDM-450 models: X605FC (wifi) & X605LC (LTE)
The M10 I have is shipped with a Snapdragon 450 (SDM-450) chipset & Hardware Code 63. But I see on their US site that Lenovo are now putting the SDM-429 in the X605. This might cause a problem with TWRP. I'm not sure if the kernels will be compatible.
The TWRP I've posted is for the X605F/L SDM450 (HW=63). I might need to compile a different TWRP for the SDM429 versions of the X605 & the X505.
If your X605 or X505 shipped with the SDM429, can you let me know if this TWRP works ? I need to know the Hardware Version, CPU and Hardware Code. Hardware Version and CPU are in System->About. The Hardware Code is in brackets after the S/N on the sticker on the back of the tablet, eg S/N Hxxxxxxx (63).
If you have an X605FC/LC, let me know if this TWRP works. I think it will, but I want make sure.
I have one with the 429 TB-X505F SD429 HW71 If i get some time today I might be bale to try it. I'll post soon as I do.
This morning I successfully compiled and ran the P10 kernel source on my M10. I had to tweak the config a bit. I tested it in TWRP. No problems.
Tomorrow, I'll inject it into the boot.img of the system ROM and see what happens. If it is mostly stable, then we're on the way to LOS for the M10. If it's completely stable, I'll push the source up to github.
I'll continue to use the stock kernel for the released versions of TWRP in this thread, though.
Thanks to @clsA for helping me work out that the M10 kernel is a subset of the P10 kernel.
@Yahoo Mike
thx for the twrp
succesfully flashed on my X605L
"Stock recovery image (recovery_stockROM.img) from TB-X605F_USR_S200065_1905280020_Q00332_ROW - just in case something goes wrong & you need to restore stock recovery. Only use this image on a TB-X605F. If you need it for any other variant, just ask in this thread and we'll track it down for you."
do you have the stock recovery for the X605L ?
how can i backup "DATA" inside twrp ?
will this help ?
https://forum.xda-developers.com/android/software/universal-dm-verity-forceencrypt-t3817389
OSIRIS2010 said:
...
do you have the stock recovery for the X605L ?
Click to expand...
Click to collapse
Now I think of it, you don't need it. If TWRP fails to flash, then stock recovery will still be there. If stock recovery is still not loading, just boot into the system and shutdown. When you shutdown, the system will re-flash stock recovery for you.
OSIRIS2010 said:
...
how can i backup "DATA" inside twrp ?
Click to expand...
Click to collapse
Have a look at the second post.
TL;DR...the dm-verity-forceencrypt tool will do it. But it will break the next OTA. The unencrypted P10 guys are having problems at the moment with this.
I've tried to get TWRP to unencrypt the data partition, but I can't get KeyMaster to initialise successfully. Maybe the next version of TWRP will be able to do it.
Yooo. Sorry I took so long works been crazy. I cant get it to reboot into twrp recovery. Its flashes the 605 recovery then I follow the next steps in the guide but I can only get it to reboot to the stock recovery screen. Run the reboot recovery command then immediately hold the volume + - down along with power. I tried a lot I let reboot twice then let off, and nothing then I tried several more times. Reflashing then the next step. I must not be holding my mouth...err I mean pushing the buttons right or the recovery just isn't gonna work. Add I'm very newbie at rooting and customizing. I've I've rooted one phone. A 70$ moto g5 plus I got off Ebay that was basically brand new. Installed twrp recovery and magisk. I bought that cause I have SD note 9 I cant root and have this need to play YouTube videos in my truck lol. Let me know if you have any suggestions I can try. Or ideas that might make it work. I pretty much fubard the tab and (at a different time) before I tried this recovery and was able to reflash stock img though odin.
11mackey11 said:
Yooo. Sorry I took so long works been crazy. I cant get it to reboot into twrp recovery. Its flashes the 605 recovery then I follow the next steps in the guide but I can only get it to reboot to the stock recovery screen. Run the reboot recovery command then immediately hold the volume + - down along with power. I tried a lot I let reboot twice then let off, and nothing then I tried several more times. Reflashing then the next step. I must not be holding my mouth...err I mean pushing the buttons right or the recovery just isn't gonna work. Add I'm very newbie at rooting and customizing. ...
Click to expand...
Click to collapse
Don't be too hard on yourself...you've done well to get this far.
I just had a quick look at the kernel for the X505F. It's very different from the X605F. So this TWRP definitely won't work for you. Sorry.
If you want me to build a TWRP for the X505F, PM me and we'll work something out.
How do you remove twrp I think that or magisk is giving me the booting issues. Half the time I reboot for things it gets stuck. Not sure if it's root or twrp but I can't seem to remove either.
cbomb1337 said:
How do you remove twrp I think that or magisk is giving me the booting issues. Half the time I reboot for things it gets stuck. Not sure if it's root or twrp but I can't seem to remove either.
Click to expand...
Click to collapse
If you uninstall Magisk, then the system will overwrite TWRP with stock recovery the next time you reboot. Just tap "uninstall" in the Magisk Manager app. You can also remove Magisk from TWRP following these instructions.
What kind of boot issues are you having? Are you using a TB-X605F with SDA450? Or is it something similar?
I am using Tb 605f it seems to be booting fine now after removing this riru module and edxposed. I'll just leave that and stick with just viper 4 Android lol
Do you know if them modules for increasing speed work? I think one of them was called fde and there the doze one.
cbomb1337 said:
I am using Tb 605f it seems to be booting fine now after removing this riru module and edxposed. I'll just leave that and stick with just viper 4 Android lol
Do you know if them modules for increasing speed work? I think one of them was called fde and there the doze one.
Click to expand...
Click to collapse
Good to hear it's all working again.
Sorry, I haven't tried any of those tweaks.
Lenovo have updated the stock ROM they serve for the TB-X605F through LMSA rescue. It's now at TB-X605F_USR_S210126_1910290024_Q00332_ROW. This is the latest update. There are no OTAs to apply. The M10 is due for a security OTA pretty soon, though. The P10 has already received it.
Unfortunately, it's no longer possible to post a direct link to Lenovo's website for this ROM. You'll have to use LMSA to get it.
FYI. Lenovo have changed how they serve the stock ROM. The ROM is now kept at rsdsecure-cloud.motorola.com. LMSA seems to generate (or request and receive) a one-off time-limited credentialed ticket for the download. You can't download the zip files without the credentials attached to the URL.
If you really want to, you can still intercept the URL in download_resources.json in the LMSA download folder.
is there anything new in the update. i might hold of because i dont want to lose root.
cbomb1337 said:
is there anything new in the update. i might hold of because i dont want to lose root.
Click to expand...
Click to collapse
No, there's nothing new. This isn't really an update, it just seems to be a consolidation of the old stock ROM and incremental OTAs.
This is only for M10 wifi (TB-X605F) with SDA450.
The latest OTA for TB-X605F has just landed. It's available on your tablet, or directly from: TB-X605F_USR_S210126_191029_Q00332_ROW_TO_TB-X605F_USR_S210152_200120_Q00332_ROW_WCE26E2CD5.zip.
The update takes the M10 to:
Code:
build: TB-X605F_USR_S210152_200120_ROW
security patch: 1 January 2020
kernel: 3.18.120-perf-gd60e12b6-dirty
If you have TWRP and root, you'll need to:
select "uninstall" in the Magisk Manager app
install the OTA (from SD card) in recovery and reboot
re-flash TWRP
re-install Magisk
only if you unencrypted the data partition
If you have unencrypted your data partition, it will be re-encrypted during this process. Make sure you back it up before you start the OTA. You might also need to restore the TWRP backup you made of the vendor partition, before the OTA will run. Once the OTA, TWRP and Magisk are installed, you can re-run the dm-verity tool.

[ROM][SM-T500] Samsung Galaxy Tab A7 10.4 (2020) - LineageOS 18.1

Update: March 24 2022: This ROM has been retired and a new one based on LOS 19.1 (and TWRP based on Android 11) have taken its place. New thread here: https://forum.xda-developers.com/t/...4-2020-lineageos-19-1-and-twrp-3-6-1.4421365/
---
Update 9:46am EST July 15 2021: new builds of TWRP and LineageOS with TWRP touch fixed and LOS w/ space for Gapps is now live.
WARNING: USE AT YOUR OWN RISK.
I have successfully ported TWRP and Lineage OS 18.1 to the Samsung Galaxy Tab A7 10.4 (2020), aka SM-T500. This is my first time porting TWRP or LOS, so there may be issues unknown about at this time. Thus far, the only known issue is that the touchscreen in TWRP does not work. This can be worked around by using a USB mouse and/or accessing the device via ADB.
Here are the steps to follow:
Update your device to the latest stock ROM (as of this writing) either using the built-in system updater or via Odin. You want the build that ends with "3BUF3".
Unlock device bootloader using instructions from other threads. This will wipe your device.
Boot into download mode and flash "vbmeta_disabled_R.tar" via Odin in the "Userdata" slot to disable verified boot. This will wipe your device again.
Boot device back into download mode and flash TWRP via Odin in the "AP" slot. If you boot up into the stock ROM rather than booting directly back into download mode then go through the initial setup process of the stock ROM and enable developer tools and ensure OEM Unlocking is still enabled (VaultKeeper can possibly undo OEM Unlocking if you get to the ROM but don't go into Developer Tools and view OEM Unlocking is enabled, so make sure to do this).
Boot device into TWRP (recovery mode) and format (not wipe) your data partition. Then reboot back into TWRP.
Push LineageOS (super.new.ext4.img) to device. Ideally push it to an SD card formatted with ExFat or EXT2/3/4 (FAT/FAT16/FAT32/VFAT won't work due to file-size limitations).
Install LineageOS image to "Super" partition. Make sure to select "Install from Image" in order to show .img files in the install selector screen.
(Optional) Push NikGapps Omni to your device and install the zip. Make sure you include a "nikgapps.config" file in your "/tmp" folder that is configured to install to "system" rather than "product" or "default".
Reboot to system. You should now be in LOS with Gapps.
(Optional, but recommended): Install Magisk via TWRP
(Optional, but recommended): Run fix script to fix brightness slider not working and to make Magisk work. If you didn't install Magisk but only want the brightness fix, just enter "n" when prompted in the script. To run the script:
NOTE: Script has .txt file extension to allow hosting on AFH. Remove that so it's just .sh to match the instructions below.
Download and push to device when booted into TWRP
adb push sm-t500_fixes.sh /tmp
Enter an adb shell
adb shell
Change directories and set permissions
cd /tmp
chmod +x /tmp/sm-t500_fixes.sh
Run script
/tmp/sm-t500_fixes.sh
Tips:
If you are not seeing all of your storage space in the OS on the internal flash, boot to TWRP and format data.
Flash TWRP via "AP" slot and flash VBMeta_Disabler via "Userdata" slot in Odin.
Flash LineageOS as an Image, not as a Zip.
For Gapps, use the latest NikGapps for ARM64 and Android 11/R.
For Gapps, make sure you install to the System partition and not Product. To do this you need to slightly modify a nikgapps.config file. Instructions on that can be found on the NikGapps site.
Downloads:
LineageOS 18.1 20210615 Beta 2: https://www.androidfilehost.com/?fid=14943124697586369438
TWRP 3.5.2 Beta 3: https://www.androidfilehost.com/?fid=14943124697586369439
vbmeta_disabled_R: https://www.androidfilehost.com/?fid=14943124697586369440
Fixes for brightness and Magisk (sm-t500_fixes.sh): https://www.androidfilehost.com/?fid=14943124697586369521
Known Issues:
OS-encrypted storage (Internal Data) not able to be decrypted in TWRP.
Brightness controls don't work: Fixed via "sm-t500_fixes.sh script.
TWRP touch screen doesn't work (use USB keyboard or adb). Should be fixed with TWRP Beta 3.
TWRP formatting external SD card may hardbrick device. Do not do this! Fixed with TWRP Beta 2.
Source (device tree for TWRP from my Github): https://github.com/agreenbhm/android_device_samsung_gta4lwifi
Source (kernel sources from Samsung): https://opensource.samsung.com/uploadSearch?searchValue=Sm-t500#
agreenbhm said:
I have successfully ported TWRP and Lineage OS 18.1 to the Samsung Galaxy Tab A7 10.4 (2020), aka SM-T500. This is my first time porting TWRP or LOS, so there may be issues unknown about at this time. Thus far, the only known issue is that the touchscreen in TWRP does not work. This can be worked around by using a USB mouse and/or accessing the device via ADB.
Here are the rough steps to follow:
Unlock device bootloader using instructions from other threads.
Patch stock ROM (AP) using Magisk, then flash rooted ROM. Will likely need to wipe device after this.
Boot into rooted ROM and ensure "OEM Unlocking" is still enabled in "Developer Tools".
Boot back into download mode and flash "vbmeta_disabled_R.tar" to disable verified boot.
Boot device back into rooted stock ROM to ensure things are still functional (may require a device wipe at this step).
Boot device into download mode and use ODIN to flash TWRP recovery.tar file via "AP" slot.
Boot device into TWRP to verify functionality (hold Vol-Up + Power during boot).
Access TWRP via adb using "adb shell" or with USB mouse (touch functionality currently not working).
Format data partition on device.
Via ADB shell: twrp format data
Via USB mouse: Wipe -> Advanced -> Format Data
Boot device into download mode.
Via ADB shell: twrp reboot download
Via USB mouse: Reboot -> Download
Flash LineageOS tar file via ODIN using the "AP" slot.
If device boots into TWRP after flashing LineageOS, use USB mouse to select: Reboot -> System
Device should boot and stall for ~1m at the Samsung logo screen with red text below, then should go blank and then display LineageOS boot image.
Downloads:
LineageOS 18.1 20210615 with TWRP 3.5.2: https://mega.nz/file/vMVglThZ#TepIHvdEypezq3z4S_4Lln7FRFVfC7CUjVGq3ByFb6U
TWRP 3.5.2: https://mega.nz/file/GYU1yCCQ#JsthI8BYNtfB08Pzt1eeXta2Lb1zCkUI185Zm88dEW4
vbmeta_disabled_R: https://mega.nz/file/iMFx3CQI#8cP4mPoRaQNwDATqt0vKD8wxqRWSTz1EL79U0fNpW8M
Click to expand...
Click to collapse
Great news!! But I think you need to post it in the ROMs, Kernels, Recover thread.
awesome. Will try after work. Also I think you posted in the wrong section.
Which slot to flash the vbmeta?
wizzdome said:
Which slot to flash the vbmeta?
Click to expand...
Click to collapse
AP
Thanks,
After flashing the vbmeta it booted into recovery automatically after what looked like a bootloop in progress, so I wiped with factory reset and then it rebooted fine. (still not sure exactly what the vbmeta does I was hoping it would make it so i didnt get that stupid pop up asking me to hit power button to continue booting due to it having the patched os) anyhow booted fine and twrp installed as you stated without touch screen but mouse with otg works fine. (great job so far) On to LOS... I think I should have checked oem lock before flashing LOS as when I installed I get stuck at boot screen that says oem lock is on... must have been from my factory reset... (facepalm)
Nope... Still sticking on boot with the following showing on the screen...
RPMB fuse not set
RPMB Provisioned
Current BInary: Custom (0x30f)
FRP Lock : OFF
OEM Lock : ON (U) {this was off verified before flash}
KG Status : Checking
Waranty Void : 0x1 (0xE02)
Quallcomm Secureboot : Enable
RP SWREV : B3 (1,1,1,3,1,1) k3 s3
secure download : enable
grdm status : normal (d0000501)
did : 041ce2d22dba
this is displayed in the corner on the bootscreen and looks like it belongs on the download screen, anyhow booting into twrp from this point works however factory reset fails with unable to mount key(something and key(something else) i figure i will let it sit a while as I know sometimes it just takes first boot a while to go through however it doesnt seem to be the problem. Have you had a positive install of the LOS? I am wondering if I had maybe gotten a bad copy of the file. When i go to install I get a pass in odin so not quite sure where to go from here other than back to the factory image any help to get this going would be great... I took on this task cause i needed someting to take my mind off the severely crappy week I have had... so looking forward to anything you can share here...
Actually, userdata is the slot I always use. It might work in both though.
Something to mention: there is not enough space on the /system partition to flash Gapps. I created a build that supports it (with a resized /system partition) but I couldn't get it to flash via Odin. The only way I got it to work was by flashing it via TWRP as an img file. I will be posting that soon. Unfortunately that will be the end of development for now as I hard-bricked the device and need to wait for a repair or replacement. Should be back developing in 2 weeks.
Nevermind what I said here.
jayzarry84 said:
Anyone get this to work? I just flashed the TWRP part but have not been able to get into TWRP
Click to expand...
Click to collapse
Get adb access in the OS and then run "adb reboot recovery"
agreenbhm said:
Get adb access in the OS and then run "adb reboot recovery"
Click to expand...
Click to collapse
question. I don't have an OTG cable and TWRP keeps booting. I've tried rebbot, rebbot bootloader, reboot system. any advice?
jayzarry84 said:
question. I don't have an OTG cable and TWRP keeps booting. I've tried rebbot, rebbot bootloader, reboot system. any advice?
Click to expand...
Click to collapse
You may need to get an otg cable for a USB mouse and choose "reboot system" from the gui. Alternatively, look at the /dev/block/by-name/misc partition and try blanking that out with dd. That has worked sometimes.
jayzarry84 said:
question. I don't have an OTG cable and TWRP keeps booting. I've tried rebbot, rebbot bootloader, reboot system. any advice?
Click to expand...
Click to collapse
Also, from an adb shell, try "twrp reboot". Supposedly that should boot to system, but I feel like in testing I got mixed results. According to the TWRP documentation though that should be the answer.
agreenbhm said:
Also, from an adb shell, try "twrp reboot". Supposedly that should boot to system, but I feel like in testing I got mixed results. According to the TWRP documentation though that should be the answer.
Click to expand...
Click to collapse
Not working. I'll wait for my otg cable to come in
jayzarry84 said:
Not working. I'll wait for my otg cable to come in
Click to expand...
Click to collapse
I was able to use adb to run the TWRP Format Data command and it rebooted the tablet and now LOS has booted up. I think I'm good!
Looking forward to see how this develops
Rom is fast and snappy. Brightness control does not work. I haven’t played too much because of work but that’s what I’ve found so far
Can a mod move this to the rom release section?
agreenbhm said:
Something to mention: there is not enough space on the /system partition to flash Gapps. I created a build that supports it (with a resized /system partition) but I couldn't get it to flash via Odin. The only way I got it to work was by flashing it via TWRP as an img file. I will be posting that soon. Unfortunately that will be the end of development for now as I hard-bricked the device and need to wait for a repair or replacement. Should be back developing in 2 weeks.
Click to expand...
Click to collapse
I've not been able to flash this yet but I know that the latest TWRP versions have a way to fix the system partition to accept gapps. /Wipe/Advanced check system then resize. Sometimes you have to do it more than once if it is a large gapps.
lewmur said:
I've not been able to flash this yet but I know that the latest TWRP versions have a way to fix the system partition to accept gapps. /Wipe/Advanced check system then resize. Sometimes you have to do it more than once if it is a large gapps.
Click to expand...
Click to collapse
I will look into that, but I'm not optimistic it will work. This device does not separately present the system partition, rather it uses a super partition which contains system, vendor, product, and odm. TWRP only shows me the super partition for working with. I was able to resize the system partition by expanding the Lineage image and file system on my pc to match the original stock system partition, then rebuilt the super image with the other partitions it needs.

[GUIDE][SM-T290/SM-T290N] Samsung Galaxy Tab A 8.0 (2019) - How to Install LineageOS 18.1 (GSI) + Gapps

Hello!
So recently I was able to install LineageOS 18.1 (GSI) + GApps on my Samsung Galaxy Tab A 8 (SM-T290) tablet and wanted to share how I did it. I noticed a lack of decent step-by-step guides to modding this tablet so I figure I'd share what I learned through scouring multiple threads and through multiple headaches. Fun fact: I also got this working with LineageOS 19 (GSI), however it ran pretty poorly and Android 12 is ugly as hell so why bother anyway? ALSO interestingly enough, you'll see I wrote [SM-T290N] in the title as well. That is the model of the Kid's Edition of this phone, which happens to be the one I had. So I can confirm this process works for the Kid's Edition of this tablet as well as the original.
Some Things To Note
Below I'll list the software/firmware I used in this process. You don't necessarily need to follow this exactly but I don't see any reason not to. The end result is a working install of LineageOS with GApps so if that's what you want I would just follow along step-by-step. ALSO I'm writing this from memory so if I make a mistake please let me know and I'll try and correct it.
Click to expand...
Click to collapse
What You'll Need
Your tablet
A USB Cable to connect your tablet to your PC
A 4GB+ MicroSD card
A Windows PC
Some patience
Instructions
Preparing Your MicroSD Card
1. Place the LineageOS 18.1 .img file from this thread (On SourceForge, there is a section below the files about the naming conventions and how they relate to the hardware of your device and configuration of your ROM. I used the lineage-18.1-20220315-UNOFFICIAL-arm64_bvS-vndklite.img.xz image for my device. If your device is slightly different, you can use Treble Info to determine what ROM you should use. Just make sure to use the VNDKLITE rom if your device supports it.
2. Place the multidisabler .zip folder on there as well. This will preserve encryption provided by TWRP after rebooting.
3. Finally, place the MindTheGapps .zip folder on your SD card (make sure to get the correct version. In my case this was the 11.00-arm64 version).
4. Insert your MicroSD card into your device.
Unlocking the Bootloader
So the first thing you're gonna want to do is unlock your OEM bootloader on your Samsung device.
1. Go to Settings->About Phone->Software Information and look for a field called "Build Number". Tap this Five Times until you see a notification saying developer settings were enabled.
2. Go to Settings->Developer Settings and look for the setting labeled OEM Unlock and turn it on.
If you don't see this setting try connecting to wifi, changing your date and time to around two months prior (I set mine to back to May 2021 since the firmware I was using was set in July 2021), then go back to your developer settings and switch them off and back on again. You should now see the OEM Unlock option.
Click to expand...
Click to collapse
3. From here, you can reboot your device into Recovery Mode by holding the Vol+ and Vol- buttons when the device begins to boot again.
4. You should see a blue screen with some options. Press the Vol+ button to enter Download Mode. This is where you'll use Odin to flash the firmware you need as well as TWRP.
Flashing Firmware
So when I attempted this process I used Magendanz's Unofficial TWRP 3.6.0 as it is the only version of TWRP I found for this device. I also used Odin v3.14.1_3B Patched from this XDA thread. Magendanz's TWRP requires you to have the T290XXU3CUG4 Firmware (I used the XAR region) in order to flash TWRP to your device (you can check wether or not you already have this firmware on your phone by looking the About Phone section again). It takes a while to download though make sure you have some time.
1. Download Odin and run the program. Unzip your firmware folder and use the relevant files when selecting the BL, AP, CP, CSC fields in Odin. I didn't use the HOME_CSC just leave it blank.
2. Connect your device via USB and Flash this firmware to your device.
3. Once your device restarts, go through the setup process and then repeat the Unlocking the Bootloader instructions above in order to make sure it is unlocked again.
4. Reboot your device the same way as stated above.
Flashing TWRP
Before starting, be aware that after you flash TWRP to your device, your device will restart and attempt to open the stock system again. You're going to want to hold the Power and Vol+ buttons simultaneously. You will likely get a warning screen saying that the bootloader is unlocked and may ask you to do a factory reset, this (I believe) is fine. The key here is that once you press the Power Button to continue (as instructed on the warning screen) you'll want to immediately press and hold the Power and Vol+ keys for around 6 Seconds before letting go again (you should be seeing the Samsung Galaxy Tab A logo screen). After letting go, wait around 3-4 seconds, if nothing changes, restart the device by holding all three buttons (Power, Vol+,Vol-) and attempt the process again. It's a pain in the ass but you'll get it eventually. Just make sure not to let the device boot into the system again as that can cause problems in TWRP and you'll likely have to start the process over (from flashing the firmware).
1. Once your tablet is once again in Download Mode, open Odin again and flash the TWRP (tar.md5 file) to the AP (recovery) partition. Do not use any of the other partitions.
2. If this is successful, your phone will begin to reboot. Quickly press and hold the combination of buttons Power and Vol+ until you see the warning dialog pop up. Once you do, release all buttons and be ready to quickly press and release the Power button continue, and then immediately after press and hold the Power and Vol+ buttons again for 6 seconds. After around 6 seconds, release all buttons. Wait around 3-4 seconds and, if the screen does not change to the TWRP logo, restart the device by pressing and holding all buttons simultaneously and try this step again.
3. If you have entered into TWRP, congrats!
Installing Custom ROM + Software in TWRP
1. The first thing you'll want to do is select the Wipe->Format Data. Type 'yes' and hit enter (or swipe I forget which).
2. Next, select Install, and then select your MicroSD card as your storage device. You should see your zip files (if not switch from the install image option).
3. Install the multidisabler, do not reboot
4. Go back into Install and select Install Image (might not be the exact naming) option. Select your MicroSD card as the storage device again and install the LineageOS 18.1 rom. Do not reboot.
5. Go back into Install and select your MindTheGapps zip file and install it.
Now, a lot of people run into a problem when trying to install Gapps which is your device complaining about no more available space in the system partition. If this is the case, go back to Wipe and select Advanced Wipe. Select your system partition and then select Change or Repair Partition. Once you're here you should see the size and available space of your partition. You'll want to hit Resize Partition and let it do it's thing. To confirm it worked, go back to Wipe->Advanced Wipe->Select System->Change or Repair Partition and your available space should be much larger now. Now just attempt to install MindTheGapps again.
Click to expand...
Click to collapse
Final Steps
Once you reboot you should be able to successfully reach the setup screen for Lineage. Go through the steps of setting up your device as usual and be sure that Gapps are installed. Go ahead and re-enable developer settings and enable USB-Debugging and Root Debugging. The reason for this is that, when I first installed Gapps, Google Play Protect would keep throwing warnings at me about my device not being Google Play Certified. This means I couldn't actually use any of the google play services. If you run into the same issue, here are the steps you can take to fix it:
1. First, go into Settings->Apps and find your Google Play Services app. Clear the cache and delete the app data, then reboot your device. If you try and sign into the Google Play store and you are able to without getting any play protect warnings, then you're good you can disregard the following steps.
2. If you are still receiving these warnings, you'll want to head over to this site and follow the instructions (I'm not gonna tell you how to use ADB here). Once you submit your framework ID, reboot your device. Everything should be working fine now.
And that's it! If I am forgetting any steps please let me know, again I am writing this from memory of the process so it may be missing some minor details. I hope this helps!!!
How's the stability, speed and the responsiveness on Lineage with a t290? I have mine rooted debloated and twrp installed but it is slow on stock OS
kkdamion said:
How's the stability, speed and the responsiveness on Lineage with a t290? I have mine rooted debloated and twrp installed but it is slow on stock OS
Click to expand...
Click to collapse
It runs surprisingly well! Much better than stock. There’s virtually no input lag and the battery life is also very solid on lineage.
Where i run into some lag is when trying to use apps that have embedded video in them. For whatever reason the T290 cannot handle video very well at all.
So yeah I would definitely recommend trying it, it’ll really breathe new life into that tablet
i cant get google play services to work and i cant fetch device_id to register the device
i get "no closing qoute" message
adb shell 'sqlite3 /data/data/com.google.android.gsf/databases/gservices.db \
/system/bin/sh: no closing quote
EDIT: downloaded "android device id" APK from the internet and gathered the framework id information from the app
kkdamion said:
i cant get google play services to work and i cant fetch device_id to register the device
i get "no closing qoute" message
adb shell 'sqlite3 /data/data/com.google.android.gsf/databases/gservices.db \
/system/bin/sh: no closing quote
EDIT: downloaded "android device id" APK from the internet and gathered the framework id information from the app
Click to expand...
Click to collapse
Glad it worked out for you! Let me know if you have any more questions and I'd be happy to help.
Hi! is this applicable also for SM-T295?
for those trying to figure out the Google Play Certified page with the adb command
Code:
adb shell 'sqlite3 /data/data/com.google.android.gsf/databases/gservices.db \
"select * from main where name = \"android_id\";"'
do : adb shell
first then paste in :
sqlite3 /data/data/com.google.android.gsf/databases/gservices.db \
"select * from main where name = \"android_id\";"
and it shouldn't give you the error
i must say. linageos on my sm-t290 is really nice
its fast and smooth way much better then stock fw
i would reccomend anyone with a t290/t295 to install this GSI
Im into a bootloop right now after a few fails with installing Lineage on my SM-T290..
Seems like i cant install any rom? not sure how to fix this issue, can anyone point me in the right direction?
Im able to get into TWRP and download mode. but cant install any rom?
thepalek1ng said:
Hello!
So recently I was able to install LineageOS 18.1 (GSI) + GApps on my Samsung Galaxy Tab A 8 (SM-T290) tablet and wanted to share how I did it. I noticed a lack of decent step-by-step guides to modding this tablet so I figure I'd share what I learned through scouring multiple threads and through multiple headaches. Fun fact: I also got this working with LineageOS 19 (GSI), however it ran pretty poorly and Android 12 is ugly as hell so why bother anyway? ALSO interestingly enough, you'll see I wrote [SM-T290N] in the title as well. That is the model of the Kid's Edition of this phone, which happens to be the one I had. So I can confirm this process works for the Kid's Edition of this tablet as well as the original.
What You'll Need
Your tablet
A USB Cable to connect your tablet to your PC
A 4GB+ MicroSD card
A Windows PC
Some patience
Instructions
Preparing Your MicroSD Card
1. Place the LineageOS 18.1 .img file from this thread (On SourceForge, there is a section below the files about the naming conventions and how they relate to the hardware of your device and configuration of your ROM. I used the lineage-18.1-20220315-UNOFFICIAL-arm64_bvS-vndklite.img.xz image for my device. If your device is slightly different, you can use Treble Info to determine what ROM you should use. Just make sure to use the VNDKLITE rom if your device supports it.
2. Place the multidisabler .zip folder on there as well. This will preserve encryption provided by TWRP after rebooting.
3. Finally, place the MindTheGapps .zip folder on your SD card (make sure to get the correct version. In my case this was the 11.00-arm64 version).
4. Insert your MicroSD card into your device.
Unlocking the Bootloader
So the first thing you're gonna want to do is unlock your OEM bootloader on your Samsung device.
1. Go to Settings->About Phone->Software Information and look for a field called "Build Number". Tap this Five Times until you see a notification saying developer settings were enabled.
2. Go to Settings->Developer Settings and look for the setting labeled OEM Unlock and turn it on.
3. From here, you can reboot your device into Recovery Mode by holding the Vol+ and Vol- buttons when the device begins to boot again.
4. You should see a blue screen with some options. Press the Vol+ button to enter Download Mode. This is where you'll use Odin to flash the firmware you need as well as TWRP.
Flashing Firmware
So when I attempted this process I used Magendanz's Unofficial TWRP 3.6.0 as it is the only version of TWRP I found for this device. I also used Odin v3.14.1_3B Patched from this XDA thread. Magendanz's TWRP requires you to have the T290XXU3CUG4 Firmware (I used the XAR region) in order to flash TWRP to your device (you can check wether or not you already have this firmware on your phone by looking the About Phone section again). It takes a while to download though make sure you have some time.
1. Download Odin and run the program. Unzip your firmware folder and use the relevant files when selecting the BL, AP, CP, CSC fields in Odin. I didn't use the HOME_CSC just leave it blank.
2. Connect your device via USB and Flash this firmware to your device.
3. Once your device restarts, go through the setup process and then repeat the Unlocking the Bootloader instructions above in order to make sure it is unlocked again.
4. Reboot your device the same way as stated above.
Flashing TWRP
Before starting, be aware that after you flash TWRP to your device, your device will restart and attempt to open the stock system again. You're going to want to hold the Power and Vol+ buttons simultaneously. You will likely get a warning screen saying that the bootloader is unlocked and may ask you to do a factory reset, this (I believe) is fine. The key here is that once you press the Power Button to continue (as instructed on the warning screen) you'll want to immediately press and hold the Power and Vol+ keys for around 6 Seconds before letting go again (you should be seeing the Samsung Galaxy Tab A logo screen). After letting go, wait around 3-4 seconds, if nothing changes, restart the device by holding all three buttons (Power, Vol+,Vol-) and attempt the process again. It's a pain in the ass but you'll get it eventually. Just make sure not to let the device boot into the system again as that can cause problems in TWRP and you'll likely have to start the process over (from flashing the firmware).
1. Once your tablet is once again in Download Mode, open Odin again and flash the TWRP (tar.md5 file) to the AP (recovery) partition. Do not use any of the other partitions.
2. If this is successful, your phone will begin to reboot. Quickly press and hold the combination of buttons Power and Vol+ until you see the warning dialog pop up. Once you do, release all buttons and be ready to quickly press and release the Power button continue, and then immediately after press and hold the Power and Vol+ buttons again for 6 seconds. After around 6 seconds, release all buttons. Wait around 3-4 seconds and, if the screen does not change to the TWRP logo, restart the device by pressing and holding all buttons simultaneously and try this step again.
3. If you have entered into TWRP, congrats!
Installing Custom ROM + Software in TWRP
1. The first thing you'll want to do is select the Wipe->Format Data. Type 'yes' and hit enter (or swipe I forget which).
2. Next, select Install, and then select your MicroSD card as your storage device. You should see your zip files (if not switch from the install image option).
3. Install the multidisabler, do not reboot
4. Go back into Install and select Install Image (might not be the exact naming) option. Select your MicroSD card as the storage device again and install the LineageOS 18.1 rom. Do not reboot.
5. Go back into Install and select your MindTheGapps zip file and install it.
Final Steps
Once you reboot you should be able to successfully reach the setup screen for Lineage. Go through the steps of setting up your device as usual and be sure that Gapps are installed. Go ahead and re-enable developer settings and enable USB-Debugging and Root Debugging. The reason for this is that, when I first installed Gapps, Google Play Protect would keep throwing warnings at me about my device not being Google Play Certified. This means I couldn't actually use any of the google play services. If you run into the same issue, here are the steps you can take to fix it:
1. First, go into Settings->Apps and find your Google Play Services app. Clear the cache and delete the app data, then reboot your device. If you try and sign into the Google Play store and you are able to without getting any play protect warnings, then you're good you can disregard the following steps.
2. If you are still receiving these warnings, you'll want to head over to this site and follow the instructions (I'm not gonna tell you how to use ADB here). Once you submit your framework ID, reboot your device. Everything should be working fine now.
And that's it! If I am forgetting any steps please let me know, again I am writing this from memory of the process so it may be missing some minor details. I hope this helps!!!
Click to expand...
Click to collapse
bro, I have a problem, my tablet is in a bootloop and I don't know what to do, try with other custom roms but it's the same, what do I have to do so that when I install a custom room it doesn't give me that error?
Flashing the Gapps package resulted in an error: Failure to mount '/system_root' (Invalid argument)
V0latyle said:
Flashing the Gapps package resulted in an error: Failure to mount '/system_root' (Invalid argument)
Click to expand...
Click to collapse
Sorry for the bother, new to Android modding scene.
I went into the recovery menu (oem unlock on) and tried to flash TWRP as written on this guide, but I get a secure check fail : aboot on my device and fail on Odin. What do I do here?
Edit: Aparently my device is SM-T295, basically the LTE version of the same device, which is why it isn't recognising it. My bad.
Do you have any video to teach better ???
HyruleanKnight said:
Sorry for the bother, new to Android modding scene.
I went into the recovery menu (oem unlock on) and tried to flash TWRP as written on this guide, but I get a secure check fail : aboot on my device and fail on Odin. What do I do here?
Edit: Aparently my device is SM-T295, basically the LTE version of the same device, which is why it isn't recognising it. My bad.
Click to expand...
Click to collapse
Shouldn't matter, TWRP is the same for both variants.
There's two ways to get around the secure check fail problem:
After updating via Odin, make sure you immediately interrupt the boot and force reboot into Download Mode. Then, flash TWRP.
Or, after updating, allow your device to boot to Android, skip through the setup wizard (make sure you connect to the internet), and enable Developer Options. Ensure OEM Unlocking is there and grayed out. If not, leave it for a bit until it is. This disables Vaultkeeper on the bootloader. Then, reboot to download mode and flash TWRP.
In both cases, after flashing TWRP, DO NOT let the device boot into Android. Force boot into recovery, then install the Multidisabler from here.
Now to my own problem...
I don't know what I did differently (or wrong) but I cannot get LineageOS to boot correctly on my T290. I was running 18.1 before. I recently updated to CVG3 and followed the same process as I did before - flashed TWRP, then installed the LineageOS GSI to /system.
18.1 continuously bootloops without even loading LineageOS.
19.1 gets to the LineageOS splash screen, and occasionally the setup screen, but continuously reboots also.
After flashing TWRP, I'm installing the multidisabler, then wiping /system, /data, /cache.
Any idea what I'm doing wrong?
@J.Michael any thoughts? You're more familiar with Samsung than I am
V0latyle said:
Shouldn't matter, TWRP is the same for both variants.
There's two ways to get around the secure check fail problem:
After updating via Odin, make sure you immediately interrupt the boot and force reboot into Download Mode. Then, flash TWRP.
Or, after updating, allow your device to boot to Android, skip through the setup wizard (make sure you connect to the internet), and enable Developer Options. Ensure OEM Unlocking is there and grayed out. If not, leave it for a bit until it is. This disables Vaultkeeper on the bootloader. Then, reboot to download mode and flash TWRP.
In both cases, after flashing TWRP, DO NOT let the device boot into Android. Force boot into recovery, then install the Multidisabler from here.
Now to my own problem...
I don't know what I did differently (or wrong) but I cannot get LineageOS to boot correctly on my T290. I was running 18.1 before. I recently updated to CVG3 and followed the same process as I did before - flashed TWRP, then installed the LineageOS GSI to /system.
18.1 continuously bootloops without even loading LineageOS.
19.1 gets to the LineageOS splash screen, and occasionally the setup screen, but continuously reboots also.
After flashing TWRP, I'm installing the multidisabler, then wiping /system, /data, /cache.
Any idea what I'm doing wrong?
@J.Michael any thoughts? You're more familiar with Samsung than I am
Click to expand...
Click to collapse
I think I have a solution.
I see that you are installing the multidisabler after you booted TWRP and by wiping the partitions, however, what you are supposed to do is this:
After you have booted into TWRP and have swiped to allow modifications, go to Wipe> Format Data and type yes. Don't reboot, and don't wipe any other partitions.
After that, go to install and then install the multidisabler, don't reboot.
Then install the latest LineageOS gsi to the system partition, and finally install gapps, then reboot.
Make sure you are choosing the arm64_bvS_vndklite variant, otherwise it will bootloop.
Hope this helps!
Just Mike said:
I think I have a solution.
I see that you are installing the multidisabler after you booted TWRP and by wiping the partitions, however, what you are supposed to do is this:
After you have booted into TWRP and have swiped to allow modifications, go to Wipe> Format Data and type yes. Don't reboot, and don't wipe any other partitions.
After that, go to install and then install the multidisabler, don't reboot.
Then install the latest LineageOS gsi to the system partition, and finally install gapps, then reboot.
Make sure you are choosing the arm64_bvS_vndklite variant, otherwise it will bootloop.
Hope this helps!
Click to expand...
Click to collapse
Okay, so install Multidisabler AFTER wiping data. I'll try that.
I'm using the bgS image so it's already got Google apps. I didn't have any success flashing any of the Gapps packages on the vanilla images.
Is Multidisabler still necessary on Android 11 on this device, or do we just need a patched vbmeta.img?
V0latyle said:
Okay, so install Multidisabler AFTER wiping data. I'll try that.
I'm using the bgS image so it's already got Google apps. I didn't have any success flashing any of the Gapps packages on the vanilla images.
Is Multidisabler still necessary on Android 11 on this device, or do we just need a patched vbmeta.img?
Click to expand...
Click to collapse
Yes, Multidisabler is necessary, otherwise it'll bootloop. I haven't tried anything with a patched vbmeta and frankly don't want to.
The bgS version will work just fine for Android 11.
Currently running Android 13 with LineageOS 20.0, the bvS version. Gotta say it works great. MindtheGapps 13 will work, I haven't encountered any "This device is not certified" issues.
Just Mike said:
Yes, Multidisabler is necessary, otherwise it'll bootloop. I haven't tried anything with a patched vbmeta and frankly don't want to.
The bgS version will work just fine for Android 11.
Currently running Android 13 with LineageOS 20.0, the bvS version. Gotta say it works great. MindtheGapps 13 will work, I haven't encountered any "This device is not certified" issues.
Click to expand...
Click to collapse
Do I need to wipe /system or /boot or anything before installing? I did exactly as you said - rebooted to recovery (was running Samsung stock), formatted data, installed multidisabler, then installed a LineageOS 19 image to /system. It begins to boot (LineageOS animation) then reboots.
Are you using Andy Yan's builds?
V0latyle said:
Do I need to wipe /system or /boot or anything before installing? I did exactly as you said - rebooted to recovery (was running Samsung stock), formatted data, installed multidisabler, then installed a LineageOS 19 image to /system. It begins to boot (LineageOS animation) then reboots.
Are you using Andy Yan's builds?
Click to expand...
Click to collapse
Nope, you don't have to wipe any other partitions, only format data
Yes, I'm using Andy Yan's builds. I'll link the thread here: https://forum.xda-developers.com/t/gsi-13-lineageos-20-trebledroid-based.4517345/
If I may ask, which type GSI from Andy Yan did you use?
Just Mike said:
Nope, you don't have to wipe any other partitions, only format data
Yes, I'm using Andy Yan's builds. I'll link the thread here: https://forum.xda-developers.com/t/gsi-13-lineageos-20-trebledroid-based.4517345/
If I may ask, which type GSI from Andy Yan did you use?
Click to expand...
Click to collapse
Trying to get back into TWRP, just a sec...
-arm64_bgS.img
Flashing the vndklite one now to see if it works
If I can get this working, I plan on using a bgN flavor so I can just install Magisk, since I don't use SuperSU
Edit: vndklite is bootlooping too

How To Guide [Android13] Custom GSI ROM Installation - Full Process

I'm going to explain the complete process for getting up and running on a custom GSI ROM as the guides so far seem to either have only parts of information or incorrect information.
Following this process will wipe your data and alter your phone. I am not responsible for any bricked or damaged devices.
For the purpose of this thread I'm going to assume the installation of an Android 13 GSI image which you can get from the GSI images site. I like to use crDroid.
Make sure you read and understand all instructions before beginning!
1 - Unlock the bootloader
Important things to note:
One Xiaomi account can unlock one device per month. If you need to unlock multiple devices create an account for each one.
Unlocking the bootloader requires a wait time of 1 week after adding your Xiaomi account to the device before it can be unlocked
Create a Xiaomi account to use during this process here: https://account.xiaomi.com
Download the MI Unlock tool from here: https://en.miui.com/unlock/download_en.html
Procedure:
Ensure a SIM card is in with mobile data working and disable Wifi (required when associating your device with your Xiaomi account)
Enable developer mode by going into "About Phone" and tapping on the MIUI Version until it unlocks the setting
In Settings go to Additional Settings > Developer Options
Enable "OEM Unlocking" option
Select the "Add Account" option and enter your Xiaomi account details to link your device to your account
Open the Mi Unlock tool on your PC and log in with your Xiaomi account
If you get asked for a phone number when you log in the tool may get stuck as it doesn't allow you to click on the country code drop down correctly.
To avoid this, use the QR code icon on the first sign in page and from your phone go into the Xiaomi Account settings and click the scan icon on the top right
Log your account in with your phone to set the phone number there and you should be able to log in through the Mi Unlock tool next time without a problem.
Boot your phone into fastboot mode by holding Volume Down & Power buttons
Connect your phone to your PC with a USB cable
Click Unlock on the Mi Unlock tool and it should check your device and then give you a wait timer (generally 168 hours)
After that time is up (you can use your phone normally while waiting but don't mess with the Xiaomi Account settings) connect your phone in fastboot mode again and click Unlock in the Mi Unlock tool to unlock the bootloader.
2 - Install TWRP Recovery (or alternative)
Important things to note:
This phone does not have a dedicated recovery partition, the recovery is a ramdisk that resides within the boot partition
You cannot flash a recovery partition directly to the boot partition as it will then fail to boot
Make sure you use a current version of fastboot: https://provider.xiaomi.eu/tools/fastboot.zip
All commands written below are to be used without the apostrophes within a command prompt (powershell will require .\ placed in front of the command)
Download a TWRP image from here: https://sourceforge.net/projects/recovery-for-xiaomi-devices/files/vili/ Use the A13 image for Android 13 ROMs.
Procedure:
Boot your phone into fastboot mode by holding Volume Down & Power buttons
Connect your phone to your PC with a USB cable
Run command "fastboot boot twrp.img" to reboot phone into TWRP recovery
If this is the first time using TWRP it will likely be in Chinese language. Click the 2nd to last button on the right side of the menu, then the globe icon on the top right to change language.
Go to Advanced and choose Flash Current TWRP to install TWRP into the boot image
Choose Reboot to Recovery to test the image is installed
3 - Install Latest Xiaomi.eu ROM (optional)
Important things to note:
I like to use the xiaomi.eu ROM as a base before installing a GSI image as it seems to be more stable and functional afterwards
This step is optional as you can continue with the global ROM base instead
Additionally, you can stop after this step if you would prefer to use a MIUI based ROM instead of a custom GSI image
The Xiaomi.eu ROM can be downloaded from here: https://xiaomi.eu/community/threads/miui-14-stable-release.67685/
The bootloader must be unlocked and TWRP recovery installed
Procedure:
Boot your phone into TWRP recovery by holding Volume Up & Power buttons
Click the Wipe button and then Format Data. Enter yes to wipe the data partition. (This will erase all data as well as the internal storage)
Connect your phone to PC and copy the xiaomi.eu ROM onto the phone
Click the Install button on the main menu in TWRP and select the ROM zip file to install
Go to Advanced and choose Flash Current TWRP to install TWRP back into the boot image
4 - Install Custom GSI Image
Important things to note:
This phone has a Super partition which dynamically contains system, system_ext and vendor partitions
This means that you cannot flash a GSI image directly to the system partition from TWRP so it must be installed via fastbootd
fastbootd is an enhanced version of fastboot that works with the dynamic Super partition
fastbootd mode looks like TWRP but it will say "Entered fastboot mode..." on the screen
Make sure you use a current version of fastboot: https://provider.xiaomi.eu/tools/fastboot.zip
All commands written below are to be used without the apostrophes within a command prompt (powershell will require .\ placed in front of the command)
Extract vbmeta.img file from the Xiaomi.eu ROM (or global ROM if using that) and place it in same folder as fastboot
Download your custom GSI image of choice from here or other source: https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list
Extract the GSI image, rename it system.img and place it in the same folder as fastboot
Procedure:
Enter fastbootd mode on your phone using one of the following methods:
boot phone into fastboot mode and from your PC run command "fastboot reboot fastboot"
boot phone into TWRP and choose Reboot and then Fastboot
From your PC run the command "fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img" to disable the boot image hash checks to avoid boot loops
Run the command "fastboot erase system" to wipe the existing system image
Run the command "fastboot flash system system.img" to install your custom GSI image
NOTE: If you get an error saying "Not enough space to resize partition" run the command "fastboot delete-logical-partition product_a" and repeat the install again
5 - Install Magisk and Root
Important things to note:
Using the TWRP installation method by renaming the magisk apk to zip is not very reliable and the lastest versions require installation to be performed from within the OS
Download the lastest magisk from here: https://github.com/topjohnwu/Magisk/releases
We use a backup of the installed boot image rather than one from the xiaomi ROM as it has TWRP recovery installed in the ramdisk
Procedure:
Boot your phone into TWRP recovery
Enter the Backup menu, select the boot partition and run the backup
Copy the boot.emmc.win file out of the TWRP backup folder into the Download folder on your phone and rename it boot.img
Reboot your phone into System
Install the magisk apk file
Open magisk and click Install on the top right (in the Magisk section, not the App section)
For the Method choose Select and Patch a File then click Lets Go
Find the boot.img backup file copied to the Download folder and select it (after patching it will tell you the filename of the patched image)
Reboot your phone into TWRP recovery
Choose Install, then Install Image, select the file Magisk created above, select the Boot partition and then swipe to flash
Reboot to system and check in Magisk that it shows as installed (you may also want to reboot to recovery to ensure TWRP is still installed)
6 - Fixing Safetynet
Important things to Note:
The Shamiko magisk module is used to hide root status from apps that detect root/magisk. This can be used to make any app work that fails due to root status.
Shamiko uses the Denylist in Magisk settings to block root settings for those apps enabled but you should NOT have the denylist enforced in Magisk settings
You can find the Shamiko module here: https://github.com/LSPosed/LSPosed.github.io/releases
The default Universal Safetynet Fix can be found here however due to problems in a previous phone, I used the modded version from here (I'm not sure if that's still required for A13)
Procedure:
In Magisk settings choose to hide the magisk app to reinstall it with a different name and app id
In Magisk settings enable Zygisk and reboot phone
In Magisk settings choose Configure Denylist, show system apps from the top menu and enable Google Play Services, Google Play Store & Google Service Framework
In Magisk install the following modules: Shamiko, Universal Safetynet Fix
Install a Safetynet Checker from Google Play (SafetyNet Device Check) and verify safetynet tests pass successfully
7 - Post installation Fixes
Below are some fixes to common problems after installing a custom ROM.
Phh Settings Tweaks:
Qualcomm features - Use alternate audio policy -> fix audio in whatsapp
Qualcomm features - Disable soundvolume -> fix broken audio
Xiaomi features - Enable DT2W -> to enable double tap to wake
Misc features - Force alternative backlight scale -> fix auto brightness
IMS Features - Install IMS APK for Qualcomm -> allows SMS to work

Categories

Resources