How to put custom firmware on Xiaomi: a complete guide with a guarantee of success

Installation of custom firmware on the Xiaomi smartphone is a way to reveal the hidden potential of the device, get current updates after the end of official support or get rid of annoying advertising in the mobile phone. MIUI. But the process requires care: one wrong action can turn a phone into a brick. In this article, we will look at all the steps from preparation to final setup, taking into account the nuances for different models (Redmi Note 12 Pro).+, POCO F5, Xiaomi 13 Ultra and others).

It is important to understand: custom firmware is divided into two types โ€” GSI (Universal images for all devices with Project Treble and specific (designed for a specific model) The former are easier to install, but may work unstable, the latter require finding a compatible version. We will look at both options and also explain how to avoid common mistakes, such as losses. IMEI After firmware on some models with a MediaTek processor.

1. Device Preparation: What to Do Before Firmware

Before you start installing, make sure your Xiaomi is ready for the procedure.

  • ๐Ÿ”‹ Charge the battery to at least 70% โ€“ the process can take up to 2 hours, and discharging in the middle will lead to a failure.
  • ๐Ÿ“ฑ Check the device model in Settings โ†’ The phone. โ†’ Model: Some firmware (e.g. for POCO X3 Pro) not compatible with Redmi Note 10 Pro despite similar features.
  • ๐Ÿ” Create a backup through Settings โ†’ Additionally. โ†’ Backup copying or by means of TWRP (If already installed, the cloud (Mi Cloud) will not store application data!
  • ๐Ÿ–ฅ๏ธ Prepare a PC with Windows 10/11 Or Linux (for fastboot commands). MacOS may have driver problems.

Pay special attention to unlocking the bootloader - without this custom firmware will not install. Xiaomi officially allows you to unlock the bootloader, but the process takes up to 7 days (due to account verification). If you bought the phone with your hands, make sure that the previous owner did not link your Mi Account - otherwise unlocking will be impossible without his participation.

โš ๏ธ Note: On devices with Qualcomm Snapdragon processor (e.g. Xiaomi) 12T) Unlocking the bootloader will reset all data, including internal memory. 10C) Sometimes files are saved, but you shouldnโ€™t risk it.

๐Ÿ“Š What kind of firmware do you plan to install?
LineageOS
Pixel Experience
MIUI Pro (modified)
Another. GSI
I haven't decided yet.

2 Unlock the bootloader: the official way from Xiaomi

The process of unlocking a bootloader on Xiaomi changed in 2023, and now requires you to link your Mi Account to your device and wait for confirmation.

  1. Activate Developer Mode: Go to Settings โ†’ About Phone and click on MIUI Version 7 times.
  2. Back to Settings โ†’ Additionally. โ†’ For developers and include OEM-unlocking and debugging USB.
  3. Download Mi Unlock Tool (version no lower than 5.5.224.30).
  4. Connect your phone to your PC in fastboot mode (turn off the device, then press Volume Down + Power).
  5. Launch the Mi Unlock Tool, log in to the Mi Account (should match the one on the phone) and follow the instructions.

After you send your unblock request, you'll have to wait 3 to 7 days.

  • ๐Ÿ”„ Signing out of your Mi Account on your phone.
  • ๐Ÿ“ฑ Reset the device to factory settings.
  • ๐Ÿ”Œ Connect your phone to another PC to unlock.

If the unblocking has not been completed after a week, check:

  • ๐Ÿ”— Is your Mi Account linked to your phone (in Settings) โ†’ The Mi Account must be โ€œConnectedยป).
  • ๐Ÿ“… Is the waiting period expired (sometimes the timer is reset when you update the Mi Unlock Tool).
  • ๐ŸŒ Does the antivirus (for example, Kaspersky) block the work of the utility.

โš ๏ธ Note: On devices with HyperOS (new firmware from Xiaomi, released in 2026), the unlocking process may be different.For Xiaomi 14 and Redmi models K70 Additional confirmation is required through SMS.

โ˜‘๏ธ Preparation for unlocking the loader

Done: 0 / 5

3.Selecting custom firmware: whatโ€™s best for Xiaomi in 2026

The firmware choice is crucial for the stability, performance and functionality of the device, and we analyzed the current options for Xiaomi and compiled a table with their features:

FirmwareTypeAdvantagesDeficienciesCompatibility
LineageOSGSI/Official.Clean Android, Frequent Update, High StabilityNo Xiaomi features (like Game Turbo)Most of the models from Project Treble
Pixel ExperienceGSI/InformalGoogle Pixel interface, optimized performanceThe camera may not be working or NFC on some modelsRedmi Note 11 Pro+, POCO F4 GT etc.
MIUI ProModified MIUIAll Xiaomi features are saved, ads are removed, tweaks are addedRare updates, possible bugsOnly for specific models (e.g. Xiaomi) 12S Ultra)
ArrowOSGSIMinimalist design, good optimizationLess customization than in LineageOSDevices with Android 12+
Havoc-OSGSIMaximum customization (themes, gestures, animations)Can brake on weak devices (e.g. Redmi) 9A)Requires Android 10+

For most users, we recommend the Pixel Experience, which offers a balanced experience with minimal bugs. If you want a clean Android without unnecessary bells and whistles, choose LineageOS. MIUI Pro with optimizations for productivity.

Where to download firmware:

  • ๐Ÿ”— Official builds: LineageOS, Pixel Experience.
  • ๐Ÿ”— Informal ports: XDA Developers (Search for the theme of your model).
  • ๐Ÿ”— GSI-Images: GitHub Phhusson.

๐Ÿ’ก

Before downloading the firmware, check its release date. Builds older than 6 months may contain vulnerabilities or may not support new applications.

Installation TWRP: alternative recovery for firmware

TWRP (Team Win Recovery Project is a custom recovery that allows you to install firmware, backup and restore the system. Without it, most custom firmware is impossible to install. Here's how to install it:

First, download the current version. TWRP for your model from an official website or trusted sources (for example, 4PDA). Pay attention to the version: for Xiaomi 11T Pro and POCO X4 Pro 5G Different builds are required, even if they have the same processor (Dimensity 1200).

Installation via fastboot:

fastboot flash recovery twrp-3.7.0_12-0-suryansi.img


fastboot boot twrp-3.7.0_12-0-suryansi.img

After successful installation:

  1. Reboot to TWRP (click Volume Up + Power when turned on).
  2. Make a full backup of the Boot, System and Data section (in case of rollback).
  3. Format Data (important! otherwise the firmware won't stand up).

โš ๏ธ Note: On some devices (Redmi Note 9 Pro, POCO M3) post-installation TWRP Stock recovery recovers when you reboot, and to avoid that, right after you've firmwareed. TWRP Install the Disable Force Encryption module (you can download it from the XDA).

What if TWRP doesnโ€™t see internal memory?
After installation TWRP internal memory is not displayed, most likely encryption enabled. Solution: 1. Go to Wipe โ†’ Format Data (this will delete all data!). 2. Enter yes for confirmation. 3. TWRP โ€” If the problem persists, check if your model supports the memory. TWRP official website.

5. The process of installing custom firmware: Step-by-step

Now that the bootloader is unlocked and installed TWRP, We can start with firmware. We're going to look at two scenarios: installation. GSI and specific firmware for your model.

Scenario 1: Installation GSI-firmware (universal)

GSI-Images are suitable for most devices with Project Treble (all Xiaomi on Android 9)+). Procedures for action:

  1. Download. GSI-Image (e.g. LineageOS or Pixel Experience) in.img.xz format.
  2. Unclose it (you should get a file). system.img).
  3. Move it. system.img telephone SD-map.
  4. V TWRP Choose Install โ†’ Install Image and point the way to system.img.
  5. Select the System Image section and confirm the installation.
  6. After completion, run the Wipe โ†’ Dalvik / ART Cache.
  7. Reboot to the system.

Scenario 2: Install firmware for a particular model

If you have downloaded a firmware adapted to your model (for example, MIUI Pro for Xiaomi 13, the process is easier:

  1. Downloaded ZIP-archives, miui_pro_v5.2_xiaomi13.zip) Move it to the phone.
  2. In TWRP, select Install and specify the path to the archive.
  3. Add (if required) Gapps (Google services) and Magisk (for root rights).
  4. Wipe Dalvik / ART Cache.
  5. Reboot.

The first run can take up to 10-15 minutes โ€” don't interrupt the process! If the system doesn't load for more than 20 minutes, then the firmware is incompatible with your device.

๐Ÿ’ก

If there is no network after the firmware (no network). IMEI), I guess she did. NVRAM. Solution: Sweat the stock firmware through the Mi Flash Tool, then re-install the custom.

6.Setting up the system after firmware

After successful installation of custom firmware, several steps must be taken to ensure the correct operation of the device:

  • ๐Ÿ”ง Google Services Settings: If you installed firmware without Gapps, download Open Gapps (select version) ARM64 and Android, corresponding to your firmware. TWRP.
  • ๐Ÿ”’ Getting root rights: If you need superuser rights, install Magisk (version 26.4)+). Boot in. TWRP, plough ZIP-archive and reboot.
  • ๐Ÿ“ถ Recovery IMEI (For MediaTek: On some devices (Redmi Note 11, POCO M4 Pro) after the firmware, the network may disappear. SN Write Tool or Maui META repair IMEI.
  • ๐Ÿ”‹ Battery Optimization: In the first charging cycles, calibrate the battery: discharge to 0%, then charge to 100% without interruption.

To check the stability of the system:

  • ๐Ÿ“ฑ Run a performance test in AnTuTu or Geekbench.
  • ๐ŸŽฎ Run a demanding game (such as Genshin Impact) for 10-15 minutes to check the heating.
  • ๐Ÿ“ถ Check the mobile network, Wi-Fi, Bluetooth and NFC (if).

โš ๏ธ Note: If the camera does not work after the Pixel Experience firmware, download the module ANX Camera for Magisk. LineageOS may require additional libraries (libpatch).

7.Typical errors and their solutions

Even with strict adherence to the instructions, there can be problems, and we've collected some of the most common errors and ways to correct them:

Mistake.Reason.Decision
Fastboot mode start when enabledBoot section damagedSwitch to stock boot.img via fastboot flash boot.img
The phone can't see. SIM-mapFlew. IMEI orthoseRestore. IMEI through SN Write Tool or Switch a Different Build
Error 7 in TWRPThe firmware is not designed for your model.Check compatibility on the forum XDA
Infinite boot (bootloop)Incompatible Magisk modules or a damaged SystemRemove modules through TWRP or re-flash the system
No sound after firmware.There are no proprietary driversInstall the stock firmware through the Mi Flash Tool, then repeat the firmware

If your problem is not listed in the table, try:

  1. Find a solution 4PDA (enter the device model + fault-finding).
  2. Ask a question about your scaling up. XDA Developers.
  3. Return to stock firmware via the Mi Flash Tool and repeat the process from scratch.
How to return the stock firmware if something went wrong?
1. Download the stock firmware for your model from the Xiaomi website (choose the Fastboot version). 2. Unarchivate ZIP-archive in folder. 3. Connect your phone in fastboot mode to your PC. 4. Launch Mi Flash Tool, specify the path to the firmware folder. 5. Press Refresh, then Flash (select Clean all option). 6. Wait until it is completed (the phone will reboot automatically).

8. Update custom firmware: how not to lose data

Custom firmware updates more often than stock firmware, and the process of updating is easier. Here's how to do it without losing data:

For GSI-firmware:

  1. Download a new image system.img.
  2. Download to TWRP.
  3. Install the new image in the System section (without formatting Data).
  4. Wipe Dalvik / ART Cache.
  5. Reboot.

For specific firmware (e.g. LineageOS):

  1. Download the new one. ZIP-archive.
  2. Download to TWRP.
  3. Install an archive (without Wipe Data).
  4. If the update is major (for example, from Android 13 to Android 14), back up and run the Wipe System.

For firmware with OTA-Updates (e.g. Pixel Experience):

  • ๐Ÿ“ฒ Go to Settings. โ†’ System system โ†’ Updating the system.
  • ๐Ÿ”„ Click "Check Updatesยป.
  • ๐Ÿ“ฅ Download and install the update (the phone will reboot automatically).

โš ๏ธ Note: If Google services stop working after the update, re-sweep Gapps (the same version as the firmware). Magisk requires re-installation of the module after the system update (download the latest version from GitHub).

๐Ÿ’ก

Update your firmware only through official sources, and builds from dubious sites may contain backdoors or spyware.

FAQ: Frequent questions about custom firmware on Xiaomi

โ“ Can I install custom firmware without unlocking the bootloader?
No, itโ€™s impossible. All modern Xiaomi devices (starting in 2016) require unlocking the bootloader to install unofficial software. The only exception is firmware through exploits (like DirtyCOW), but they only work on very old models (until 2018) and often lead to unstable work.
โ“ Which firmware is better for games: stock MIUI custom-made?
Modified games are better suited MIUI (for example, MIUI pro MIUI EU). These firmware retain Xiaomiโ€™s branded Game Turbo optimizations, but remove ads and unnecessary services. Pure Android (LineageOS, Pixel Experience) can give better performance in benchmarks, but in games often loses due to the lack of drivers for the game. GPU.
โ“ Why does the firmware not work after the firmware? NFC?
The problem is NFC typo GSI-Firmware, as they do not include proprietary Xiaomi drivers.Solution: Install firmware adapted to your model (not your model). GSI). Download and run through TWRP driver-module NFC (look for XDA You can go back to the stock firmware if you NFC critical (for example, for contactless payments).
โ“ How to return official updates OTA post-stitch?
To get official updates from Xiaomi again, you need to: Install stock firmware via Mi Flash Tool (select Clean all option); Lock the bootloader (optional, but recommended for security); Update to the latest version via Settings โ†’ Update the system. OTA-updates will come automatically. Please note that when you return to the stock firmware, all data will be deleted!
โ“ Can you install custom firmware on Xiaomi with HyperOS?
Yes, but with reservations. HyperOS (a new firmware from Xiaomi, released in late 2023) is built on Android 14, so: To install custom firmware still requires unlocking the bootloader. Not all custom firmware supports Android 14 - check compatibility on the forums. You can return to HyperOS after custom firmware only through the Mi Flash Tool (normal). OTA-If your device has upgraded to HyperOS, it is recommended to make a full backup through the firmware before you update. TWRP, As the retraction can be problematic.