Install firmware on Xiaomi via Recovery: a complete guide with nuances

Recovery is a process that requires careful and understanding of each step. This method is relevant when a standard update through Settings โ†’ About Phone โ†’ System Update is not available: for example, when you switch to custom firmware, roll back to an old version of MIUI or recover from a crash. However, not all users know that an incorrectly selected firmware file or an interrupted process can turn a device into a brick.

In this article, we will analyze two scenarios: installation through stock recavery (Mi Recovery) and custom (TWRP), We'll also tell you how to prepare your smartphone, where to download official and unofficial firmware, and what to do if something goes wrong. TWRP Unable to use most Xiaomi models after 2017.

Preparation of the device: what to do before the firmware

Before you start installing firmware, you need to follow a few critical steps, and neglecting them can lead to data loss, locking the device or even breaking it.

First, back up all your important data. Firmware through the backups will often cause you to reset your settings, and when you switch to custom firmware (like LineageOS or Pixel Experience), you may need to clean up the /data partition completely. Use Mi Cloud, Google Drive, or local copy on your PC.

  • ๐Ÿ“ฑ Contacts (export in.vcf format)
  • ๐Ÿ“ธ Photos and videos (check folders) DCIM and Pictures)
  • ๐Ÿ”‘ Local notes and SMS (apps SMS Backup & Restore)
  • ๐ŸŽฎ Game savers (use Helium or manual backup)

Second, check the device model and the current firmware version. This can be done in Settings โ†’ About Phone โ†’ MIUI version or through the fastboot getvar product command (if the bootloader is unlocked). Installing firmware that is not designed for your model (for example, Redmi Note 10 Pro instead of Redmi Note 10) will cause the device to fail.

๐Ÿ“Š What type of firmware do you plan to install?
Official MIUI
Castomium (TWRP)
Global instead of Chinese
Retracement to the old version

Unlocking the bootloader: a mandatory step for TWRP

If you plan to use TWRP (Team Win Recovery Project) to install custom firmware, unlocking the bootloader is an inevitable step. Xiaomi locks the bootloader on all devices released after 2017 to prevent unauthorized system changes.The unlocking process takes 7 to 30 days (depending on Xiaomi policy) and requires:

  • ๐Ÿ“ฑ Linked Mi Account to the device
  • ๐Ÿ”— Internet connection (necessarily via SIM-map)
  • ๐Ÿ’ป Mi Unlock Tool (download from the official website)
  • ๐Ÿ”ง Switched on. OEM Unlock in the Developer Settings

Instructions for unlocking:

  1. Activate Developer Mode by pressing the MIUI version 7 times in the settings.
  2. Enable OEM Unlock and USB Debugging in Settings โ†’ Additional โ†’ For Developers.
  3. Connect your phone to your PC, launch the Mi Unlock Tool and follow the instructions.
  4. Wait for SMS or unblock notifications (can take up to 720 hours).

โš ๏ธ Attention: Unlocking the bootloader resets the device to factory settings, and Xiaomi can block the account if it detects suspicious activity (for example, frequent unlocking of different devices).

What happens if you flash a phone with a locked bootloader?
When you try to install custom firmware through TWRP on a device with a locked bootloader, the system will give an Anti-Rollback Protection error or simply do not boot, at best, the phone will go to fastboot mode, at worst it will become a โ€œbrickโ€ (it will not respond to buttons and charging).

Firmware selection: official MIUI vs custom builds

The type of firmware that determines not only the functionality of the device, but also the method of installation.

Type of firmwareAdvantagesDeficienciesIs TWRP required?
Official MIUI (Fastboot)Stability, support OTA-updates, warrantyAdvertising, restrictions of regional versionsNo.
Official MIUI (Recovery)Quick installation, data retention (sometimes)Not all versions are available in.zip format.Yes (stock or TWRP)
LineageOS (Pixel Experience)Pure Android, no Bloatware, advanced settingsNo guarantee, possible bugs with camera or sensorsYes (required)
Ported MIUI (EU, xiaomi.eu)Advertising-free, multilingual, weekly updatesThere may be problems with banking applications (due to lack of certification)Yes.

For beginners, we recommend starting with official firmware in.zip for recovery.

  • ๐ŸŒ On the official Xiaomi website (select a version for your model and region).
  • ๐Ÿ”— Forums 4PDA or XDA Developers (Look for themes with a tagline "[ROM][OFFICIAL]").

Castom firmware should only be installed if you understand the risks.

  • ๐Ÿ“ฑ xiaomi.eu (MIUI Advertising-free for European users).
  • ๐Ÿค– LineageOS (Pure Android).
  • ๐Ÿ“ฒ Pixel Experience (like the Google Pixel interface).

๐Ÿ’ก

Before downloading the firmware, check its hash amount (MD5 or SHA-1) using the HashMyFiles utility or online services.

Installation of firmware through stock recavery (Mi Recovery)

Xiaomi stock reavers allow you to install only official firmware in.zip format. This method is suitable for rollback to the previous version of MIUI or recovery after a software failure. Important: stock reavers do not support the installation of custom firmware or modified cores.

Step-by-step:

  1. Download the firmware in.zip format (for example, miui_BLOCKOTA_V12.5.1.0.RJBCNXM_20210913.0000.00_11.0_cn.zip) and rename it in update.zip.
  2. Move the file to the root folder of the phoneโ€™s internal memory (not to folders!).
  3. Turn off the device and press the Volume Up + Power combination to enter Mi Recovery.
  4. Choose a language (usually English or Chinese).
  5. Go to Install update.zip to System and confirm the installation.
  6. After you complete the process, select Reboot to System.

โš ๏ธ Note: If E:footer is wrong occurs during installation, it means that the firmware file is corrupted or not intended for your model.

Download the official firmware in.zip format

Rename the file to update.zip

Charge your phone at least 50%

Disable protection with a pattern lock / password (optional)-->

Install firmware through TWRP: a step-by-step guide

TWRP (Team Win Recovery Project) is a custom recovery that offers enhanced capabilities over stock, which allows you to install any firmware, backup, mount partitions, and even restore data, but you must unlock the bootloader to use it.

Instructions for installing firmware through TWRP:

  1. Download the current version of TWRP for your model from an official website or trusted sources (e.g. 4PDA).
  2. Install. TWRP Fastboot: Fastboot Flash Recovery twrp-3.6.2_11-0-sweet.img fastboot reboot recovery
  3. In TWRP, make a full backup of the current system (Boot, System, Data sections).
  4. Go to Wipe โ†’ Advanced Wipe and mark Dalvik/ART Cache, System, Data, Cache. Confirm the cleanup (this will delete all data!).
  5. Press Install, select a firmware file (.zip) and confirm the installation.
  6. After completion, install Magisk (if root is required) or Disable_Dm-Verity_ForceEncrypt (bypass encryption on some firmware).
  7. Reset the device.

The first download after the firmware can take up to 10-15 minutes. If the screen has been getting stuck on the Xiaomi logo for longer than 20 minutes, then something has gone wrong (maybe the firmware is incompatible with your model or Data is not reset).

๐Ÿ’ก

Installation via TWRP always requires a complete cleanup of the Data partition if the transition is between different types of firmware (for example, from MIUI to LineageOS), ignoring this step will lead to endless restarts (bootloop).

Solving common errors in firmware

Even with the correct following of the instructions, errors can occur, and let's consider the most common of them and how to fix them:

Mistake.Reason.Decision
Error 7 in TWRPThe firmware is not designed for your model or Android version.Check the compatibility of the firmware file with your device
E: unknown command [log]Damaged update.zip file or lack of spaceCheck it out. MD5-file sum and free up memory
Hanging on the Xiaomi logoFirmware incompatibility or uncleaned DataReturn to TWRP, run Wipe โ†’ Format Data and reinstall the firmware
Anti-Rollback ProtectionReverse to the old version of MIUIInstall firmware no older than the current one or use XiaomiTool V2 to bypass

If the device does not turn on after a failed firmware:

  1. Try going to fastboot (click Volume Down + Power).
  2. Flash the device through the Mi Flash Tool (requires.tgz firmware for fastboot).
  3. If the phone doesnโ€™t respond to the buttons, plug it into charging for 30 minutes โ€“ sometimes โ€œresuscitationโ€ of the battery helps.
What happens if TWRP is not installed?
If you try to flash TWRP through fastboot, you get a FAILED error (remote: 'Not allowed in Lock State'), it means that the bootloader is not unlocked, and some Xiaomi models (such as the Redmi Note 8 Pro) require special versions of TWRP with a patch to bypass Anti-Rollback.

Additional advice and recommendations

Firmware through the Recovery is a process that can be simplified if you know a few nuances:

  • ๐Ÿ”‹ Always charge your phone at least 60-70% before running your firmware.Discharge during the process can damage system files.
  • ๐Ÿ”Œ Use the original. USB-cable USB 2.0 on PC (ports) USB 3.0 sometimes causes errors in fastboot data transfer).
  • ๐Ÿ›ก๏ธ After custom firmware is installed, some banking applications (such as SberBank Online) may stop working due to lack of SafetyNet certification.
  • ๐Ÿ“ก If after firmware lost mobile network, check the settings APN Or re-flash the modem (vendor and firmware sections).

For power users: If you experiment with firmware frequently, consider installing OrangeFox Recovery, a TWRP alternative with a more user-friendly interface and support for themes.

FAQ: Frequent questions about Xiaomi firmware

Can I use Xiaomi without unlocking the bootloader?
Yes, but only through stock recavers and only official firmware in.zip format. Unlocking is mandatory for custom firmware or modified cores to be installed.
How do I know if my Xiaomi bootloader is unlocked?
Turn off your phone and press Volume Down + Power. If you see Unlocked and an open-lock picture, the bootloader is unlocked. If Locked is locked.
Will I lose my warranty after I run through TWRP?
Yes, installing custom recavators and firmware will void Xiaomi's warranty. However, you can return the stock firmware and lock the bootloader back (via the Mi Flash Tool) so that the service center does not detect interference.
What is Anti-Rollback and How to Get Around It?
Anti-Rollback is Xiaomiโ€™s protection, which prohibits rollbacks on older versions of MIUI. You can bypass it with the help of special firmware with a patch (for example, from Xiaomi.eu) or the XiaomiTool V2 utility, but this is risky and can lead to locking the device.
How to return the stock firmware if the phone does not turn on?
Download fastboot firmware (.tgz) for your model from the official website. Then use the Mi Flash Tool: Unpack the archive into a folder without spaces in the title. Connect the phone in fastboot mode (press Volume Down + Power). In the Mi Flash Tool, select the firmware folder and press Refresh, then Flash. Select the clean all option for full cleanup.