How to replace firmware with Xiaomi: from Mi Flash to TWRP

Replacing the operating system on a Xiaomi smartphone is not just a way to update the interface, but often the only way to get rid of intrusive advertising, access Googleโ€™s global services or bring the device back to life after a failed experiment. Owners of Redmi and Poco smartphones often face Chinese versions of firmware that lack familiar functionality, or with regional restrictions of MIUI. The process of flashing requires attention, but with the right approach it opens the full potential of your gadget.

Before you start taking action, you need to understand the difference between the types of software: Recovery (standard recovery mode) and Fastboot (low-level diagnostic mode), these two modes will be your main tools. Errors in the preparation stage can lead to a โ€œbrickโ€, so you can not ignore the theoretical basis.

โš ๏ธ Warning: Replacing the firmware voids the manufacturer's warranty. All actions you perform at your own risk, so double check the compatibility of the model and version of the software.

The first step should always be to identify your device. Not all models are the same: Xiaomi Mi 9 and Redmi Note 10 can have completely different processors and memory partitions. To determine the model accurately, go to Settings โ†’ About phone and find a string with a codename, such as davinci or mojito.

The critical thing is to create a full backup of your data. Even if you plan to just upgrade your system, the risk of losing contacts, photos and messaging in messengers remains high, use built-in sync with your Mi Cloud or Google account, and create a local copy on your computer. Backup is your insurance, which will save you hours of nerves in the event of a crash.

๐Ÿ’ก

Before starting any manipulations with the software, take screenshots of important settings (APN, Wi-Fi parameters), since after a clean installation they will have to be re-entered.

Unlocking the bootloader: the foundation for change

No custom firmware or even official Global ROM will stand on a locked bootloader. Xiaomi has implemented this protection to prevent device theft and malware installation, but for enthusiasts it is the first barrier.The unlocking process requires filing through the official Mi Unlock Tool app and waiting, which can last from 7 to 168 hours.

First, you need to link your Mi Account to your device. โ†’ The phone. โ†’ Version. MIUI and click a few times on the system logo to make it say, "You're a developer." Then go to Advanced Settings. โ†’ For developers and activate the items "Factory unlocking" and "Debugging by USBยป. After that, in the menu โ€œMi Unlock Statusโ€ click โ€œAdd Account and Deviceยป.

๐Ÿ“Š What is your experience with reflashing Xiaomi?
I don't know anything, I'm afraid to break:Menal only through Recovery:Unblocked Bootloader, put custom: Professionally engaged in repair

Once you have successfully linked your account, download Mi Unlock to your computer. Launch the program, log in to the same account you have on your phone, and put your smartphone into Fastboot mode (clamping both Down volume and power buttons at the same time). Connect the cable and press Unlock. If the wait time is not yet over, the program will report it, and you will have to wait.

  • ๐Ÿ”“ Full freedom: once unlocked, you can install any modifications to the system.
  • ๐Ÿ“‰ Security decline: some banking applications may stop working without further manipulation (Magisk, Hide My Applist).
  • ๐Ÿ”„ Data reset: The unlock process will automatically execute full Wipe Data by deleting all files from the device.

โš ๏ธ Note: Do not try to bypass the wait through third-party paid services. This often leads to the blocking of the account by the user. IMEI Or installing malicious drivers on your PC.

Select firmware version: Global, China or Custom?

The firmware world for Xiaomi is huge, and itโ€™s easy for a beginner to get confused in acronyms: The official versions are divided into China ROM (Chinese and English only, no Google Play by default), Global ROM (full localization, all services) and EEA (European version with stricter restrictions on advertising and frequency of updates).

If the official options donโ€™t suit you, there are custom builds like Xiaomi.eu. This is a modified version of Chinese firmware that has been cut out of ads, added language packs and optimized battery life. These firmwares often run stackier than stock ones, but require manual installation through Recovery. Itโ€™s important to understand that custom firmware doesnโ€™t have Google security certificates by default (although Xiaomi.eu usually includes them).

When selecting a file, pay attention to the type of archive. To update through the standard recovery menu, you need a file with the.zip extension (Recovery ROM). To run through a computer in Fastboot mode, you use the.tgz archive, which, after unpacking, contains many files and scripts. An error in choosing a file type will result in the installation simply not starting or ending in an error.

Type of firmwareLanguagesGoogle ServicesStability
China ROMChinese, EnglishNo (installation needed)Tall.
Global ROMMultilingualThere is.Tall.
Xiaomi.euMultilingualThere is.Very high.
LineageOSDepends on the build.Optionally.Medium
What is the difference between the Developer and Stable versions?
Stable is rarely released, goes through a long testing cycle and is intended for ordinary users. Developer is updated weekly, contains new features, but may have bugs and bugs. For everyday use, always choose Stable.

Tools and drivers preparation

To successfully replace software, you will need not only the firmware file itself, but also a properly configured workspace. The main tool for working in Fastboot mode is the Mi Flash Tool. It must be downloaded from the official website or trusted sources, since modified versions can contain viruses. Installing drivers is the most frequent stumbling block for Windows users.

The system must correctly identify the device in different modes. You will need Qualcomm drivers. HS-USB QDLoader 9008 (for emergency mode, Android Bootloader Interface (for Fastboot) and Android ADB Interface.The easiest way to install Xiaomi universal package ADB/Fastboot Tools or drivers that come with Mi Flash. Without them, the computer will see the device as "Unknown Device" and will not be able to send commands.

โ˜‘๏ธ Firmware readiness

Done: 0 / 1

Also check integrity USB-Cheap cables that come with power banks often only support charging and don't transmit data. Use the original cable or high-quality analogue with high-speed data. Connect the device directly to the motherboard ports on the back of the PC, avoiding USB-hubs that may not provide sufficient current.

  • ๐Ÿ’ป Path without spaces: unpack firmware files into the root of the disk (for example, C:\ROM\), so that there are no Cyrillic alphabets or gaps in the way that can cause a script error.
  • ๐Ÿ”Œ Port port USB: preferably use ports. USB 2.0, since with USB 3.0 Driver conflicts sometimes occur when you run old models.
  • ๐Ÿ“‚ Architecture: Make sure you download the firmware for your processor (Snapdragon or MediaTek), you can not confuse them.

Installation via Fastboot: a method for advanced

Fastboot is considered the most reliable and clean method, as it completely overwrites all memory partitions. This is the ideal way to go from the Chinese version to the global version or roll back to the older version of Android. This uses the Mi Flash program. After you start, select the mode in the lower right corner: "Clean all" (complete cleaning) or "Save user data" (data saving is not recommended when changing region).

The process is as follows: transfer the phone to Fastboot mode (power button). + Volume down, connect to your PC. In Mi Flash, press the Refresh button to make the device appear in the list. Then press Select and point the path to the folder with the unpacked firmware. Make sure mode is selected. clean_all, and press "Flash." The process will take from 200 before 600 seconds.

fastboot devices


fastboot flash recovery recovery.img




fastboot reboot

In some cases, especially when switching between Android versions (e.g. 11 to 12), you may need to manually clear partitions through the command line. The fastboot erase userdata and fastboot erase cache commands will help avoid cyclical reboots. However, use them carefully only if you understand which partition is responsible for what.

๐Ÿ’ก

Clear all mode is mandatory when changing the firmware region (China -> Global), otherwise the phone will go into an endless cycle of restarting (bootloop).

โš ๏ธ Note: During the firmware process (when the progress scale is filled), it is strictly forbidden to disconnect the cable.

Automatic Firmware through Recovery

If you donโ€™t need a full flash and cleanup, but only an update or a change of version within the same region, itโ€™s more convenient to use the built-in Recovery. ZIP-The firmware file (.zip) is downloaded and placed in the root of the internal memory or on the computer. SD-map.

To activate the hidden update menu, go to Settings โ†’ About Phone and click on the MIUI version. In the window that appears, click three dots in the corner and select "Select a firmware file." Specify the downloaded archive. The system will check the integrity of the file and suggest rebooting for updates. This method is safe, but does not allow you to downgrade (roll back to the old version) without additional utilities.

There is also a seven-finger method to activate additional Recovery features. 6-10 once-over MIUI, until you have a message to enable additional features, and then you can select the file selection menu. ZIP-If the file is damaged or not suitable for the model, the system will issue an error "Can't verify updateยป.

  • ๐Ÿ“ฒ PC-free: the whole process takes place on the smartphone itself, which is convenient on the road.
  • ๐Ÿ›ก๏ธ Security: Recovery will not allow you to install a corrupted file, protecting the system.
  • ๐Ÿšซ Restrictions: you canโ€™t switch from Global to China or vice versa, only within one region.

Installation of TWRP and custom firmware

For those who want to gain maximum control, TWRP (Team Win Recovery Project) is an indispensable tool, a custom recovery menu that allows you to make full system backups (Nandroid backup), install mods, patch system files and install any operating system, including LineageOS or Pixel Experience. TWRP installation is possible only on an unlocked bootloader.

Installation is done via Fastboot by the fastboot flash recovery team twrp_image.img. However, after the first reboot, Xiaomiโ€™s standard system may try to restore the original Recovery. TWRP You need to load into it (clamping Power and Volume Up) and install a patch that prohibits replacing Recovery, or flash it. ZIP-The firmware file itself immediately without downloading to Android.

Why can't TWRP see internal memory?
Once you have TWRP installed, internal memory can be displayed as 0MB. This is normal for newer versions of Android because of encryption. You have to go to Wipe โ†’ Format Data, type in "yes" and reboot. This will delete all data, but make the memory available.

Working with custom firmware requires understanding the concept of GApps (Google Apps). Google services are not built into pure firmware (AOSP) due to licensing restrictions. You will have to download the GApps package (for example, OpenGApps or NikGapps) of the corresponding version of Android and install it through TWRP immediately after installing the system itself, before the first download.

What if your phone is in Bootloop (Cyclical Reboot)?
If you're constantly restarting your phone after you've run it, try doing Wipe Data/Factory Reset with Recovery. If that doesn't work, you'll need to go back to Fastboot mode and reflash the device, making sure you choose "Clean all" mode, and at worst, you'll need to switch to EDL mode (9008) and firmware through an authorized Mi Account.
Can I flash a global version on a Chinese phone without unlocking it?
Officially, no. Trying to install Global ROM on a Chinese device through a standard Recovery will lead to an error. The only legal way is to unlock the bootloader (which requires waiting) and flash the device through the Fastboot. The bypasses of changing the region through the engineering menu are unstable and dangerous.
How to return the guarantee after unlocking the loader?
Formally, unlocking the bootloader violates the warranty, but if you return the original firmware and lock the bootloader again with the fastboot oem lock command, visually detecting the interference will be difficult, but service centers have methods for checking fusions, so the risk of remaining without warranty service remains.