Skip to content

Instantly share code, notes, and snippets.

@AnAnonymousPotato
Last active November 11, 2024 13:28
Show Gist options
  • Save AnAnonymousPotato/14850489fee6279bfefda7646480eddd to your computer and use it in GitHub Desktop.
Save AnAnonymousPotato/14850489fee6279bfefda7646480eddd to your computer and use it in GitHub Desktop.
<Reddit Post> [GUIDE] How to flash a GSI and Root the Lenovo Tab M10 HD (X306X)

image As you can see, I'm running Arrow OS 13.1 (Android 13) on Lenovo Tab M10 HD 2nd Gen (X306X)

I just copy-pasted my reddit post in this github gist.

[Complete Guide on How to Flash a GSI and Root This Device]

»Intro/Information

Warning and useful information: This guide is for this specific device only, and works best for the 4GB RAM + 64GB storage variant of this device; on lower GB RAM variants, installing a GSI may lag the device. This guide may work on most other devices too, but some steps will differ. I'm not responsible if your device gets into a bootloop, you lose any data or your device gets hard bricked. Please follow the steps carefully and use your common sense + brain. If your device does get into a bootloop, use the Lenovo RSA to fix it (more details at the end of post). I'm not an expert (nor a developer) in this field, so I can just give basic advice. I'm just a normal person and this is my first guide ever regarding this Android Rooting. But feel free to ask any questions if you have doubts. Also, my English is not very good; there may be some grammatical issues.
Credits: Most of the credit goes to Mkr-Infinity for the guide on how to flash GSI and unlock bootloader; Munchy for the how to root Android without custom recovery video; Zillion for the TWRP recovery; everyone on the Telegram channel who helped me; and Google. I have just made this guide by combining many guides, there is not any new thing I added. I could not find any guide that had all things combined into one, so I decided to make one myself.

A GSI is like a custom ROM but more general; it works on almost any simalar device and doesn't need a specific device model. You can install it on any device (which released on Android 9 or newer; it supports a specific system which allows you to use GSI) with an unlocked bootloader. On this Telegram channel, you can find all GSIs that work perfectly on this device + their videos. The videos showing the GSIs are in a private group, and I don't have the link to that group. Or, you can join this Telegram channel of this Lenovo TB- X306X device. In my case, I use the "Arrow OS 13.1" (of Android 13) GSI, which is in that Telegram channel.

»Steps to Flash A GSI on this device

  1. Unlock the bootloader, enable and setup USB debugging. You should have already known this step; if not, then use Google.
  2. You don't need a custom recovery. But, a custom recovery (TWRP) (edit: it is now discontinued, that means it will not get any updates or fixes; but it may still be usable.) is available for this device. Though I don't know if it works on Android 11+. The developer said it only works on Android 10.
  3. Connect your device to your PC, then open ADB.
  4. Boot into bootloader with adb reboot bootloader
  5. Flash this vbmeta using fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img -Or you can just drag and drop the file into the CLI (Command line interface) instead of writing "vbmeta.img" at the last.
  6. Boot into fastbootd (yes, fastbootd) fastboot reboot fastboot
  7. Flash the GSI using fastboot flash system GSI-enternamehere.img You can also do this . Note: If you receive the not enough space to resize partition error, you may need to do fastboot delete-logical-partition product and then again flash the GSI.
  8. Wait for the process to complete. In my case, it took around 300 seconds to complete. You will see text like Sending Sparse System 1/15, 2/15, 3/15 and so on... Then you will receive see a text telling you that the process is done.
  9. Then boot into recovery mode using fastboot reboot recovery
  10. Once you enter the recovery, navigate to the "Factory reset / Wipe data" option using volume keys on your tablet and then use the power button key to select. Then just reboot to system.
  11. Now everything is done! Enjoy a new version of Android on your old tablet. But, if you want more customization, you need to root your tablet.

»Steps to root this device

Since the TWRP custom recovery does not work on Android 11+, you need to use the patch the boot.img to root your tablet using Magisk.

  1. First of all, you need the boot.img of this device so you can patch it with Magisk. To get it, you will first need to download "Lenovo Rescue and Smart Assistant (RSA)"
  2. Then, install it on your PC. It will also install some Lenovo and Motorola drivers on your PC.
  3. Login into RSA with your Lenovo Account, then select the "Rescue Tablet" option. You will get the text field to enter you device's serial number. The serial number is a 8 digit combination/string with capital letters (and maybe even numbers too?). It can be found behind your tablet on a sticker, or by doing adb devices.
  4. It will then ask the country from which the device is purchased (or manufactured?) and the RAM/ROM in it (eg: 2+32 GB, 4+64, etc.).
  5. Follow all steps the Lenovo RSA tells you. It will then download the firmware file (~2.2 GiB). After downloading the file, you can close Lenovo RSA.
  6. Extract the firmware.img file the Lenovo RSA has download, using any file explorer you prefer. I used "NanaZip".
  7. Find the boot.img inside the extracted folder. This is the file you need. You can delete the original firmware.img file, or you can keep it in case your device goes into a bootloop. Keep a copy of the boot.img on your PC and on your tablet.
  8. Open the Magisk app on your tablet, then click on "Install" beside the "Magisk" text. Then click on "patch a file". Select the boot.img. Magisk will then patch it and put it into the downloads folder on your tablet.
  9. Then, you can follow this video. The guy in that video has explained all the steps after this very well.

»How to fix a bootloop

If your tablet is stuck in a bootloop, you can use Lenovo RSA to fix it. It will wipe all data and re-install the stock ROM, and lock the bootloader.

  1. Use the steps written in "Steps to root this device" to get the stock firmware.img for this tablet using Lenovo RSA.
  2. Instead of closing Lenovo RSA in step 5, you need to click on the "Rescue" button and follow all the steps the Lenovo RSA tells you.
  3. You may need to wait around 2-5 minutes or more for the process to finish.
  4. Now, you tablet is free from the bootloop. The bootloader of the tablet is locked. You need to unlock it again. You can again try flashing the GSI or root it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment