How to flash Xiaomi smartphone on pure Android: from unlocking to installing GSI

Why do users want to get rid of MIUI and what is a โ€œpure Androidโ€?

Xiaomi smartphones have long gained popularity due to the ratio of price and characteristics, but their brand shell MIUI has caused mixed reviews. Some are annoyed by the abundance of advertising in system applications, others from redundant features that slow down the device. Still others just want a clean Android (or close to it) with a minimalist interface, quick security updates and the lack of โ€œextraโ€ software.

By โ€œpure Androidโ€ is usually understood one of three things: Pixel Experience (as close as possible to Googleโ€™s stock Android), LineageOS (stable custom open source firmware), or GSI-Generic System Image is a universal firmware that is compatible with most devices on Project Treble).

In this article, weโ€™ll break down all three options, but the focus will be on installing GSI as the most versatile way for modern Xiaomi smartphones (starting with the Redmi Note 7 and later).

Before you get to the instructions, answer two key questions: 1. Are you ready to lose the warranty? (Unlocking the bootloader will void it.) 2. Do you understand the risks? (Incorrect firmware can turn a phone into a brick.)

If the answer is yes, read on. If not, consider alternatives like disabling MIUI ads through ADB or installing a Nova Launcher launcher.

๐Ÿ“Š What annoys you the most in MIUI?
Too much advertising.
Unnecessary system applications
Delays in updates
Unstable work
I like everything.

Step 1: Checking the compatibility of the device with pure Android

Not all Xiaomi smartphones can be flashed on pure Android, the main condition is support for Project Treble (architecture that allows you to install). GSI-It's easy to check it out:

  1. Install the Treble Check app from Google Play.
  2. Open it and see the Seamless System Updates: โœ… Supported โ€“ Your device is compatible with GSI. โŒ Unsupported - Sweet GSI It will not work (you will have to look for custom firmware specifically for your model).

Also, look for the partition type: A/B (with seamless updates) or A-only (outdated format).

For A/B-The process of firmware is easier, but there are nuances there - for example, on some Redmi models after installation. GSI The camera may not be working or NFC.

Xiaomi list with Project Treble support (2018โ€“2026)
Models starting with the Mi 8, Redmi Note 7, POCO F1 and later support Treble. The full list can be found at treble.info.
Xiaomi modelSupport for TrebleType of sectionNotes
Redmi Note 10 Proโœ… Yes.A/BThe camera is partially working (patch needed)
POCO X3 Proโœ… Yes.A-onlyNFC does not work for most GSIs.
Mi 11โœ… Yes.A/BRequires to disable avb in fastboot
Redmi 9AโŒ No.โ€”Only custom firmware for a specific model

โš ๏ธ Note: If your device does not support Project Treble, try to install GSI This will lead to hard brick, in which case, look for custom firmware on forums. XDA Developers or 4PDA.

Step 2: Unlock the bootloader (Bootloader Unlock)

Without unlocking the bootloader, you can't flash a clean Android. Xiaomi officially allows you to do this, but the process takes up to 7 days (due to checking the account).

  1. Link your Mi Account to your device: โœ… Go to Settings. โ†’ Xiaomi account. โœ… Turn on sync and confirm the phone number.
  2. Enable the developer mode: โœ… Go to Settings. โ†’ The phone. โœ… 7 times press the version MIUI. โœ… Back to Settings โ†’ Additionally. โ†’ For developers.

Activate USB debugging and OEM unlocking:

  • โœ… Turn on Debugging. USB and Unlock. OEM.
  • โœ… Connect your phone to your PC and confirm your debugging permission.

Now download the official Mi Unlock Tool from Xiaomiโ€™s website (Windows only) and follow the instructions: 1. Launch the utility and log in to your Mi. 2 account. Transfer the phone to fastboot mode (turn off, then press Volume Down + Power). 3. Connect the device to your PC and press Unlock in the program. 4. Wait for the SMS with the confirmation code (may come in a few days!).

๐Ÿ”น Install drivers ADB/Fastboot manually

๐Ÿ”น Try another one. USB-cable (original)

๐Ÿ”น Disable driver signatures in Windows

๐Ÿ”น Launch the utility on behalf of the administrator-->

โš ๏ธ Note: Once the bootloader is unlocked, all data on the phone will be erased, including photos on internal memory. Backup in advance! Also note that some banking applications (e.g. Sberbank Online) may stop working due to the changed bootloader state.

Step 3: Selecting Firmware - GSI vs. Castom Firmware

Now that the bootloader is unlocked, you have to decide what to install.

  • ๐Ÿ“ฑ GSI-Generic System Image: Universal firmware compatible with most Project Treble devices. Pros: wide selection (Android 12-14), frequent updates. Cons: camera may not work, NFC print-sensor.
  • ๐Ÿ› ๏ธ LineageOS: Built specifically for your model. Pros: better compatibility, all features work. Cons: not all models have up-to-date builds.
  • ๐Ÿ”„ Port firmware (transported from another device): Risky option, often with bugs. Suitable only for advanced users.

For beginners, we recommend starting with GSI. The most popular images are: Pixel Experience (as close as possible to Googleโ€™s Android), LineageOS (stable, without Google services by default), Havoc-OS (much customization).

You need to download them from official websites or trusted sources (for example, XDA Developers).

๐Ÿ’ก

Before downloading GSI Check his type: arm64-ab (for A/B-devices arm64-aonly (A mismatch will lead to a firmware error.

If you have chosen custom firmware, look for it in the theme of your model on 4PDA or XDA. Pay attention to: โ€ข Android version (current - 13-14). โ€ข Date of the last update (if the firmware has not been updated for more than a year - it is better to look for another). โ€ข User reviews (especially about the camera and mobile network).

Step 4: Install firmware via fastboot or recovery

The most reliable way to flash GSI is through fastboot.

  • ๐Ÿ–ฅ๏ธ Computer with installed ADB Fastboot (you can download it in Android) SDK Platform Tools).
  • ๐Ÿ”Œ Cable USB (preferably original).
  • ๐Ÿ“ Unarched GSI-Image (file with extension.img).

Instructions for A/B-Devices (most of the modern Xiaomi devices):

  1. Turn your phone into fastboot (Loudness down + Power).
  2. Connect to your PC and check the connection with the command: fastboot devices (should display the serial number of the device).
  3. Please. GSI inactive partition (e.g., inactive partition, system_b): fastboot flash system_b [name file.img]
  4. Delete user data: fastboot -w
  5. Reboot: fastboot reboot

For A-only devices, the team will be different:

fastboot flash system [name file.img]

POCO F3

avb

fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

๐Ÿ’ก

If the phone is stuck on the logo for more than 10 minutes after the firmware is installed, then GSI is incompatible with your device. Try a different image or restore the original firmware through the Mi Flash Tool.

โš ๏ธ Note: If you see fastboot: error: Cannot generate image for userdata, the userdata partition is corrupted.

Step 5: Solving Typical Problems After Firmware

Even if the firmware is successful, there may be problems, and here are the most common ways to solve them:

Problem.Possible causeDecision
The camera's not working.There are no drivers for your model.Install the ANX Camera patch or sew through the custom core
No mobile network.Incompatibility of modemsScroll down vendor and firmware from stock firmware
NFC's not workingThere is no support in GSIUse custom firmware instead of GSI
Phone overheatsUnoptimized coreInstall a custom core (e.g., FrancoKernel)

If the phone does not turn on at all after firmware (hard brick), try to recover through the EDL-This will require: 1. USB-to-USB cable (or circuit of contacts on the board). 2. Mi Flash Tool and stock firmware for your model. 3. Xiaomi account with unlocked rights to EDL (Some models require authorization).

How to enter EDL-Xiaomi
On the phone turned off, press Volume up + Volume down and connect to the PC.The device should be defined as a Qualcomm HS-USB QDLoader 9008.

Step 6: Optimize clean Android after installation

You've successfully run a clean Android, but that's only half the battle, and now you need to set up the system for maximum performance and convenience.

  • ๐Ÿ”ง Turn off unnecessary Google services: Go to Settings โ†’ Google โ†’ Google account and deactivate syncing of unnecessary data (e.g. Google Fit or Google News).
  • โšก Activate Developer Mode: Enable Settings โ†’ The phone. โ†’ Build number (7 times) and activate window animation = 0.5x speed up the interface.
  • ๐Ÿ›ก๏ธ Set up security: Install Magisk for root rights (if needed) and Universal SafetyNet Fix for banking applications.
  • ๐Ÿ“ฑ Recover data: Use Swift Backup (requires root) or Google Backup to port apps and settings.

If you have installed Pixel Experience, we recommend you to: โ€ข Activate Now Playing (recognition of music on a locked screen). โ€ข Set up Adaptive Battery in Settings โ†’ Battery. โ€ข Install GCam (modified Google Camera) for the best photos.

๐Ÿ’ก

To return navigation gestures like MIUI, install the Fluid Navigation Gestures app from Google Play.

FAQ: Answers to Frequent Questions

Can I flash a clean Android without unlocking the bootloader?
No. Without an unlocked bootloader, custom firmware installation is impossible. The only workaround is to use Magisk to modify stock MIUI (but that won't give a pure Android).
How to return MIUI after installing a clean Android?
Download the stock firmware for your model from the Xiaomi website, transfer the phone to fastboot and run through the Mi Flash Tool (choose the clean all option).
Why does GSI not work after GSI?
This is a typical problem for some Xiaomi models (e.g. Redmi Note 9 Pro).Solution: 1.Stripe vendor and firmware from stock. MIUI. 2. Install a patch for Wi-Fi (search on) XDA 3. try another one. GSI-Image (for example, based on Android 12 instead of 13).
Can I upgrade to pure Android through OTA?
Yes, but only if you installed a firmware with support OTA-Updates (e.g. LineageOS or Pixel Experience) GSI Updates are less frequent and will have to be installed manually via fastboot.
Will Google Pay work after the firmware?
Probably not, because of the changed state of the bootloader and the lack of Google certification. Solution: 1. Install Magisk and SafetyNet Fix. 2. Hide the root using MagiskHide (but this does not guarantee 100% operability). 3. Use alternatives like Revolut or Samsung Pay.