Install Android on Xiaomi: from unlocking the bootloader to custom firmware

Installing an alternative version of Android on Xiaomi smartphones is a popular way to expand the functionality of the device, get rid of advertising in MIUI or get the latest security updates on older models. However, the process requires care: the wrong actions can turn the phone into a brick. In this guide, we will discuss all the steps from preparation to final configuration, taking into account the features of unlocking the bootloader in 2026 and compatibility with the latest versions of Redmi, POCO and Mi.

It’s important to understand that installing custom Android (like LineageOS, Pixel Experience, or ArrowOS) is insecure and can affect some features like Widevine. L1 (viewable HD-Netflix content) or contactless payments, but for many users, the benefits of a clean Android without a bloat, quick updates and advanced customizations outweigh the risks.

1.Preparation: What to Know Before Installation

Before you start firmware, make sure your device is supported by the custom firmware you choose. Compatible model lists are usually published on XDA Developers forums or project sites (like LineageOS Wiki). Pay attention to the model codename (like raphael for Redmi K20 Pro) rather than the marketing name – this is critical for choosing the right firmware.

Also check:

  • πŸ”‹ Battery charge at least 70%. Interrupting the process due to discharge can make the phone inoperable.
  • πŸ’Ύ Backup: Use Mi Mover, Swift Backup, or adb backup to save data. Cloud backups (like Google Drive) don't work -- they won't restore system settings.
  • πŸ”§ Tools: Windows PC 10/11 Linux, USB-cable (preferably original), debugging USB (Settings β†’ The phone. β†’ Version. MIUI β†’ 7 Click to activate the developer mode).

⚠️ Note: On devices with MediaTek processors (e.g. Redmi Note 11 or POCO M4 Pro) unlocking the bootloader may not be possible without an authorized Xiaomi account. β†’ The phone. β†’ Full specification.

πŸ“Š What kind of firmware do you plan to install?
LineageOS
Pixel Experience
ArrowOS
MIUI Europa
Another.

2 Unlocking the bootloader on Xiaomi in 2026

Since 2023, Xiaomi has tightened the rules for unlocking the bootloader, now requiring:

  1. Link your Mi Account to your device (in your phone settings).
  2. Waiting 7 days after the tether is a must for new devices.
  3. Use the official Mi Unlock Tool software (you can download it on the Xiaomi website).

Instructions for unlocking:

  1. Download and install Mi Unlock Tool on PC.
  2. Launch your phone in Fastboot mode: Turn off the device, then press the Power button + Volume down.
  3. Connect your phone to your PC and log in to the Mi Unlock Tool under the same account as your phone.
  4. Press Unlock and wait until it is completed (usually takes 1-3 minutes).

⚠️ Warning: If the Mi Unlock Tool gives you a "Couldn't unlock" error, check: Mi Account is logged on to your phone for more than 7 days. Find Device is disabled on your phone. β†’ Mi Account β†’ Find Device. You're using the original USB-cable (not all cables support data transfer to Fastboot).

Link Mi Account to phone | Disable Find Device | Install Mi Unlock Tool on PC | Wait 7 days after account binding | Download ADB/Fastboot-->

Installation of custom recovery (TWRP)

TWRP (Team Win Recovery Project) is an alternative recovery needed to install custom firmware. Official TWRP builds are available on twrp.me, but many Xiaomi models require unofficial versions (you can find them on XDA or Telegram developer channels).

Instructions for installing TWRP:

  1. Download the TWRP image for your model (file with.img extension).
  2. Move the file to the folder with the platform-tools (from Android SDK).
  3. Launch your phone in Fastboot and connect to your PC.
  4. Open the command line in the folder with platform-tools and do: fastboot flash recovery twrp-3.7.0_12-raphael.img Fastboot Reboot Recovery (Replacement) twrp-3.7.0_12-raphael.img in the name of your file).

After rebooting to TWRP, don’t restart your phone to the system β€” start installing the firmware immediately. Otherwise, the standard recovery MIUI will overload the TWRP.

What happens if TWRP doesn’t start?
If the phone is loaded into a standard recovery after the fastboot reboot command, then: 1. Your model is used A/B-sections (e.g, POCO F3 or Redmi K40). In this case, you need to stitch TWRP Both Slots: Fastboot Flash Recovery twrp.img fastboot flash boot twrp.img 2. Anti-rollback set. Check version MIUI β€” if it's newer than it supports TWRP, You'll need to roll back on the old firmware.

4. Selection and installation of custom firmware

The most popular firmware for Xiaomi:

FirmwareFeaturesSupport for GAppsComplexity of installation
LineageOSClean Android, stable operation, long-term supportYes (should be downloaded separately)Medium
Pixel ExperienceGoogle Pixel interface, regular updatesIncludedLow.
ArrowOSMaximum customization, support for themesYes (optional)Tall.
MIUI EuropaMIUI without advertising and Chinese servicesYes.Low.

Installation process (LineageOS example):

  1. Download firmware and, if necessary, GApps (for example, NikGapps or OpenGapps).
  2. Move files to your phone or to your phone SD-map.
  3. In TWRP, run Wipe β†’ Advanced Wipe and mark Dalvik / ART Cache System Data Cache

Don't wash.

Internal Storage

MicroSD

Install

GApps

Wipe β†’ Format Data

1. Repeat Format Data in TWRP.

2. Swipe the kernel (boot.img) from the firmware archive separately.

3. Check firmware compatibility with the Android version (for example, firmware on Android 13 will not stand on the Android 12 device without prior updates).-->

5. Magisk installation for root rights

Magisk is a tool for obtaining root rights without violating the integrity of the system (unlike the outdated SuperSU), it also allows you to hide root from applications (for example, banking) and install modules for advanced configuration.

Installation instructions:

  1. Download the latest Magisk (.zip file) from GitHub.
  2. Download the phone to TWRP and swipe Magisk-v26.4.zip (version may vary).
  3. Restart. Once you start, install the Magisk application from the same archive (.apk file).

To check if the installation is correct, open Magisk and make sure that all items in the Superuser section are green. If the app doesn't start, try:

  • Reinstall Magisk via TWRP.
  • Switch Magisk-uninstaller.zip, then repeat the installation.
  • Check compatibility with your firmware on XDA.

πŸ’‘

Magisk allows you to hide root from specific applications (such as banking or games). To do this, open Magisk β†’ Settings β†’ MagiskHide and mark the desired programs.

System configuration after installation

After the first download custom Android will need:

  1. Activate Google Services (if you have installed GApps): Sign in to your Google account in the settings.
  2. Configure access rights for Magisk (if you have installed root).
  3. Update the firmware through the built-in updater (for example, in LineageOS it is Settings β†’ System β†’ System Update).
  4. Restore data from a backup (if you did backup via TWRP or Swift Backup).

Typical problems after installation and their solution:

Problem.Possible causeDecision
No mobile network.No IMEI or incorrect APN settingsSwitch persist.img from stock firmware or manually add APN
Wi-Fi/Bluetooth is not workingIncompatible kernel or driversSwipe the kernel (boot.img) from firmware compatible with your model
Fast battery dischargeBackground processes or incorrect calibrationCalibrate the battery via TWRP or flash the Battery Calibration module in Magisk

⚠️ Note: If contactless payments have stopped working after firmware (NFC), Check: Availability of Widevine Certificates L1 (can be checked in the appendix DRM Status of section /vendor β€” Sometimes you have to stitch it separately. Magisk settings: turn off MagiskHide for the Google Pay app.

7. Custom firmware update

Update custom Android can be in two ways:

  1. Through the built-in updater (recommended for beginners): In LineageOS or Pixel Experience, updates come automatically to Settings β†’ System β†’ Update. Download the update and install it without any further manipulation.
  2. Manually via TWRP (for power users): Download the new firmware version from the official website. Download to TWRP and stream the file (without Wipe Data unless otherwise specified).

Important: Check the changelog on the firmware site before updating. Sometimes a clean installation (with a full reset) is required if the Android version changes (for example, from 12 to 13).

πŸ’‘

When upgrading via TWRP, remember to flash Magisk again, otherwise the root will disappear and the modules will stop working.

FAQ: Frequent questions about installing Android on Xiaomi

Can I return the standard MIUI after installing custom firmware?
Yes, but the process depends on the model: For devices with an unlocked bootloader, download the official firmware (.tgz or.zip) from Xiaomi and run through the Mi Flash Tool in Fastboot mode. If the bootloader is locked, you will need to re-unblock (with a wait of 7 days). back MIUI After custom firmware, you can lose data if you do not make a backup copy.
Why is the camera or fingerprint sensor not working after the firmware?
This is a typical problem when using informal firmware or cores. Solutions: Check if your model supports the camera on the selected firmware (for example, some Xiaomi devices require proprietary MIUI Camera drivers). Install the ANX Camera module or GCam via Magisk. For the fingerprint sensor, scrolle vendor.img separately from stock firmware.
How to check if the bootloader is unlocked?
Turn off your phone and press the Power button + Volume down to enter the Fastboot. If the bottom of the screen says "Unlocked" with the open lock, the bootloader is unlocked. If "Locked" is locked.
Which Xiaomi models are better not to use?
It is not recommended to install custom firmware on: Devices with MediaTek and a locked bootloader (for example, Redmi 10A, POCO C40); New flagships (Xiaomi 14, Redmi K70) - due to rollback and the risk of losing the functionality of the cameras. Devices with dynamic partitions (for example, POCO F5), if there is no stable firmware for your model. Before firmware, be sure to check the reviews on XDA or 4PDA for your model.
Can I install Android on Xiaomi without unlocking the bootloader?
No, unlocking the bootloader is mandatory for custom firmware installation. EDL-The mode (emergency download mode), but it requires an authorized Xiaomi account and special equipment (for example, Deep Flash Cable.