Install firmware on Xiaomi via Recovery: from unlock to final setup

Smartphone firmware via Recovery is one of the most reliable ways to update or completely change the software on Xiaomi, Redmi or other devices. POCO. This method is suitable for installing official updates (if the standard is the same). OTA refuses to work), and for the installation of custom firmware like LineageOS, Pixel Experience or MIUI But the process requires care: a mistake at any stage can turn a phone into a brickΒ».

Unlike Fastboot, where commands are executed from a computer, Recovery installation takes place directly on the device itself, which makes it easier for beginners to do so, but imposes limitations: for example, you can’t flash anti-rollback versions (if they’re newer than the current one), and some models require bootloader pre-unlocking. In this article, we’ll take a look at the whole way from preparation to final setup, and how to avoid typical bugs and repair the phone if something goes wrong.

β€”β€”β€”

1. Device preparation: unlocking the bootloader and backup

Before you start firmware, you need to follow two critical steps: unlock the bootloader (if it is blocked) and create a full backup of data, TWRP) or unofficial firmware will be impossible, and without a backup you risk losing photos, contacts and settings.

To unlock the bootloader on Xiaomi will need:

  • πŸ”— Mi Account linked to the device (required to have a confirmed phone number).
  • πŸ’» Computer with drivers installed ADB Fastboot (you can download from the site) XDA Developers).
  • πŸ“± Developer mode enabled and permitted debugging USB (Settings β†’ The phone. β†’ Version. MIUI β€” tap 7 times).
  • ⏳ Time: The unlocking process takes up to 720 hours (30 days) of waiting after the first account link.

After unlocking the loader, it is recommended to install TWRP Recovery – Custom Recovery that supports installation ZIP-Firmware files and backups. Official versions TWRP For most Xiaomi models, available at twrp.me. note that some new devices (such as Xiaomi 13 or Redmi Note 12) may require a special version with support for Dynamic Partition.

⚠️ Attention: Unlocking the bootloader resets all data on the device! Before starting the procedure, copy important files to your computer or cloud. Also note that some banking applications (such as Sberbank Online or Tinkoff) may stop working on unlocked devices due to the SafetyNet trigger.

For backup, use:

  • πŸ“ Built-in function MIUI Backup (Settings) β†’ System and device β†’ Backup).
  • πŸ”„ TWRP (If already installed, it creates a complete image of the system, including /data and /system.
  • ☁️ Google Drive, Mi Cloud for Contacts, Photos and Notes.
πŸ“Š What kind of firmware do you plan to install?
Official MIUI (Stable)
Official MIUI (weekly)
Custom (LineageOS, Pixel Experience, etc.)
I don't know.

2. firmware selection: official MIUI vs custom builds

The type of firmware not only affects the capabilities of the device, but also the stability of its operation. MIUI Xiaomi is divided into two types:

  • πŸ“¦ Stable - undergo long-term testing, are updated every 1-3 months, are suitable for daily use.
  • πŸ”„ Weekly (Developer) - contain new features, but may have bugs, updated every week.

Custom firmware (for example, LineageOS, ArrowOS, Havoc-OS) offer:

  • πŸ†• More recent versions of Android (like Android 14 for devices that don’t officially support it).
  • πŸš€ No Advertising and Unnecessary Applications (Bloatware).
  • πŸ”§ Advanced settings (e.g., kernel management, change) DPI screen).

However, custom firmware has disadvantages:

  • πŸ”‹ Possible problems with autonomy (fast battery discharge).
  • πŸ“Έ Not all camera features work properly (especially on Xiaomi with proprietary drivers).
  • πŸ›‘οΈ Lack of official support (updates depend on enthusiasts).
CriteriaOfficial MIUICustom firmware
Stability⭐⭐⭐⭐⭐⭐⭐⭐ (build-dependent)
Android featuresStandard. + brand-piece MIUIPure Android or close to it
UpdatesRegular but slowFrequent, but not for all devices
SecurityOfficial support, encryptionVulnerability risk (if the build is irrelevant)
Compatibility with banking applicationsYes (if the bootloader is locked)Partially (required Magisk to pass SafetyNet)

Where to download firmware:

  • πŸ”— Officially MIUI: en.miui.com (select the version for your model!).
  • πŸ”— Castomy: XDA Developers or Telegram-channels of developers.

⚠️ Warning: Never download firmware from questionable sites! ZIP-files may contain viruses or spyware. Check checksums (MD5/SHA-1) post-load.

Installation TWRP Recovery (if required)

TWRP (Team Win Recovery Project is a custom recovery that allows you to install firmware in the format ZIP, Xiaomi’s official Stock Recovery supports only the installation of official.zip digitally signed updates.

For installation TWRP Follow the following steps:

  1. Download the image TWRP for your model from the site twrp.me (file with the extension.img).
  2. Connect your phone to your computer in Fastboot mode (turn off the device, then press Volume down). + Nutrition).
  3. Open the command line in the folder with ADB The command is: fastboot flash recovery. twrp-3.7.0_12-1-redmi_note_10.img (Replace the file name with yours).
  4. Reboot to TWRP Team: fastboot boot twrp-3.7.0_12-1-redmi_note_10.img

After the first entrance to the TWRP The system may offer to allow modification of the partition /system. Swipe for confirmation (this is necessary for installing firmware).

β˜‘οΈ Preparation for installation TWRP

Done: 0 / 5

4. Step-by-step instruction: firmware through Recovery

Now, let's get to the process of installing the firmware, and it's good for Stock Recovery and for Stock Recovery. TWRP, but with some differences.

Step 1: Download to Recovery

Turn off your phone. Use the combination to log in to Recovery:

  • πŸ”„ Stock Recovery: Volume up + Meals (hold until the Mi logo appears).
  • πŸ”§ TWRP: Loudness up + Food (let go when the menu appears).

Step 2: Clean Partitions (Wipe)

Before installing a new firmware, be sure to reset:

  • In Stock Recovery, select Wipe Data β†’ Wipe All Data.
  • V TWRP Go to Wipe. β†’ Advanced Wipe and mark: Dalvik / ART Cache System Data Cache Then swipe to confirm.

⚠️ Note: If you install the firmware of the same version as the current one (e.g. update) MIUI 14.0.1 β†’ 14.0.2), you can do without completely resetting. But when you change the type of firmware (for example, with a new type of firmware). MIUI on LineageOS) wipe is mandatory!

Step 3: Installation of firmware

Copy. ZIP-Firmware file on the phone (internal memory or SD-In the map. TWRP:

  1. Choose Install.
  2. Show the way to ZIP-file.
  3. Swipe for confirmation.
  4. Wait until it is completed (it can take 5-15 minutes).

In Stock Recovery:

  1. Select Install update.zip to System.
  2. Confirm the installation.
  3. After you complete the process, select Reboot to System.

Step 4: First download

The first run after firmware can take up to 10-20 minutes. Don't interrupt the process! If the device has been stuck on the logo for longer than 30 minutes, try:

  • πŸ”„ Reboot to Recovery and Repeat the Installation.
  • πŸ“± Check firmware compatibility with the phone model.
What to do if the firmware is not installed?
If TWRP Error 7 is a bug, which means that the firmware is not suitable for your model or version. MIUI. Solutions: 1. Check the model name in Settings β†’ The phone. β†’ Model (e.g. Redmi Note 10 may have the codename mojito). 2. Download firmware with the correct codename. 3. If you install custom firmware, make sure it supports your anti-rollback version of the bootloader).

5. Typical errors and their solutions

Even with the exact following of the instructions, there can be problems.

Mistake.Reason.Decision
Error 7 in TWRPIncompatible firmware or incorrect code nameDownload firmware for an exact model (check in fastboot getvar product)
The device does not load (bootloop)Incorrect wipe or damaged ZIP-fileRepeat installation with complete System and Data cleanup
DM-Verity corruptionThere is no support for DM-Verity in custom firmwareSweep disable_dm-verity_forceencrypt.zip post-stitch
The sensor does not work after the firmwareIncompatible version of the kernel or driversSwipe another firmware option or roll back to the official MIUI

If the phone doesn’t turn on after firmware (black screen, no button response), try:

  1. Connect to charging for 30 minutes - sometimes helps with the discharge of the battery.
  2. Hold the Loud down + Power for 10-15 seconds for forced reboot.
  3. Swipe the device through Fastboot (instructions are available at xiaomiflash.com).

πŸ’‘

If the mobile network does not work after firmware, check the settings APN. They're often reset when custom firmware is installed. β†’ SIM-maps and mobile networks β†’ Access points (APN).

6. Post-firmware setup: data optimization and recovery

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

Data recovery

If you're backing up in TWRP, can be restored:

  1. Reboot to TWRP.
  2. Select Restore and specify the folder with backup.
  3. Mark the sections for recovery (e.g. Data for applications and settings).

To recover from MIUI Backup:

  1. Go to Settings β†’ System and Device β†’ Backup.
  2. Select the backup file and follow the instructions.

Optimizing productivity

After the firmware custom firmware is recommended:

  • πŸ”‹ Calibrate the battery: fully discharge and charge the phone 2-3 times.
  • πŸ—‘οΈ Clear the application cache in Settings β†’ Annexes.
  • πŸ› οΈ Disable unnecessary services (e.g. Mi Cloud if not used).

Passing SafetyNet (for banking applications)

If you have custom firmware installed, banking applications may be blocked due to the SafetyNet trigger.

  1. Install Magisk (through) TWRP).
  2. Activate the MagiskHide and Universal SafetyNet Fix modules.
  3. Restart your device and check the status in the SafetyNet Checker app.

πŸ’‘

After you have custom firmware, always check the basic functions: calls, mobile internet, Wi-Fi, camera and sensors. If something doesn't work, it's likely that the firmware is incompatible with your device.

7. The rollback to the official firmware: how to get everything back

If the custom firmware is unstable or you need to return the official firmware MIUI (For example, for warranty repairs, follow the following steps:

  1. Download the official firmware in.tgz or.zip format from en.miui.com.
  2. Unclose the file and find the file inside the folder flash_all.bat (for Fastboot or update.zip (for recovery).
  3. To install via Recovery: Copy update.zip Reboot to Stock Recovery and select Install update.zip.

Fastboot

fastboot flash all flash_all.bat

(This will completely re-interpret the device, including the bootloader).

After the rollback:

  • πŸ”’ The bootloader will remain unlocked (if you have unlocked it previously).
  • πŸ“± All data will be erased (including internal memory).
  • πŸ”„ To block the bootloader again, run the command: fastboot oem lock Attention: this will lead to a complete reset!

8. Frequently Asked Questions (FAQ)

❓ Can I flash Xiaomi through Recovery without unlocking the bootloader?
Yes, but only official updates in format ZIP through Stock Recovery, for custom firmware or TWRP unlocking is mandatory.
❓ Why the camera doesn’t work after the firmware?
This is a typical custom firmware problem on Xiaomi, as the manufacturer uses proprietary drivers.Solution: Install an alternative camera app (like GCam). MIUI Camera (special builds available) Return to the official MIUI.
❓ How to check if the bootloader is unlocked?
Turn off the phone and press the volume down. + Power to log into Fastboot. If you have Unlocked open-locked at the bottom of the screen, the bootloader is unlocked.
❓ Can I flash Xiaomi through Recovery from a computer?
No, the firmware through Recovery runs directly on the phone. Fastboot mode is used to run the firmware from the computer.
❓ What is an anti-rollback and why is the firmware not installed?
Anti-rollback is Xiaomi’s protection mechanism, which prohibits rollbacks to an older firmware version. If you try to install a firmware with a lower anti-rollback number than the current one, the device will lock (hard brick).