Installing alternative firmware on Xiaomi smartphones is a process that opens up new opportunities for device owners, from getting rid of advertising in MIUI to getting the latest versions of Android on outdated models. However, this process requires carefulness and understanding of each step, since the wrong actions can lead to a βbrickβ (inoperability) of the device. In this article, we will examine all the nuances from preparing the phone to choosing the optimal firmware and installing it.
It is important to understand that replacing the regular firmware will void the warranty and may affect the stability of the device. Xiaomi does not officially support the installation of third-party firmware, so all actions you perform at your own risk. However, with the right approach, the risks are minimal, and the benefits β from advanced features to improved performance β outweigh the potential difficulties.
We will consider two main scenarios: installing a global / stable MIUI (if your device originally worked on the Chinese version) and installing custom firmware like LineageOS, Pixel Experience or ArrowOS. Particular attention will be paid to unlocking the bootloader - a key step, without which further manipulation is impossible.
1. Device Preparation: What to Do Before Firmware
Before you start replacing a firmware, there are several critical steps that need to be taken, and neglecting them can result in data loss, inability to complete the process, or even physical damage to the device.
The first and most obvious is to back up all your data. Use Settings β Google β Backup to sync your contacts, photos and apps, and copy important files to your computer or cloud. Keep in mind that once you have firmware, your deviceβs internal memory will be completely cleared.
Next, check your deviceβs model and codename. You can do this in Settings β About Phone β Model or using the adb shell command getprop ro.product.device. For example, Redmi Note 10 Pro has the code name sweet, and Poco X3 Pro is vayu. This information will be needed to select the right firmware.
- π Charge the phone to at least 70% β the process can take several hours, and battery drain in the middle of the firmware will lead to a failure.
- π§ Install it on the computer. ADB and Fastboot (part of Android) SDK Platform Tools. You can download from the official Google website.
- π Put the debugging on. USB In Settings β The phone. β Version. MIUI (Press 7 times, then return to Settings β Additionally. β For developers β Debugging by USB.
- π₯ Download Mi Unlock Tool from the official Xiaomi website - this is a program to unlock the bootloader.
β οΈ Note: If your device was purchased in China, there is a high probability that it is a locked bootloader with a link to the Mi Account. In this case, before unlocking, you need to link the device to the Mi Account and wait 72-168 hours (depending on the model) before allowing unlock. This timer is reset with each new connection to the account!
2 Unlocking the bootloader: the most important stage
The bootloader on Xiaomi devices is locked by default, and unlocking it is a prerequisite for installing any unofficial firmware, which is officially supported by the company, but has a number of limitations.
First, connect your phone to your computer in Fastboot mode (turn off the device, then press Power + Volume down). Make sure the drivers are installed correctly - Android Bootloader Interface should be displayed in Device Manager.
Run the Mi Unlock Tool, log in to the same Mi Account that's attached to your phone, and follow the instructions of the program. If the waiting timer hasn't expired, you'll see a message telling you to wait. In some cases (especially on newer models), you may need to link. SIM-card-to-account.
- π After successful unlocking, the phone will automatically reset to factory settings.
- β οΈ Some models (such as the Redmi Note 12 Series) may require additional steps, such as confirmation via a new model. SMS.
- π If the process is stuck at 99%, donβt turn off the device β wait 10-15 minutes, then restart it manually.
| Xiaomi model | Waiting time to unlock | Features |
|---|---|---|
| Redmi Note 11/11 Pro | 72 hours | Requires a tie-up. SIM-card-to-account |
| Poco F4/F4 GT | 168 hours | Supports unlocking without waiting when using EDL-regime (risky) |
| Xiaomi 12/12 Pro | 7 days | Possible Unlocking Problems on Chinese Versions |
| Redmi 10C/10A | 48 hours. | You may need to roll back to an older version of MIUI before unlocking. |
β οΈ Note: After unlocking the bootloader on some models (Xiaomi 13, Redmi) K60) Widevine is no longer working L1, This leads to a decrease in streaming quality on Netflix, Disney+ and other services before 480p. It is incorrigible without re-locking the bootloader!
Linked to Mi Account on the phone|Debugging is on. USB|Installed ADB/Fastboot driver|Data backup made.|Battery charge > 70%-->
3. firmware choice: official MIUI vs custom ROM
Once you unlock the bootloader, you need to decide on the type of firmware. Each option has its pros and cons, and the choice depends on your goals.
The official MIUI (global/stable) is suitable if you are satisfied with the functionality of stock firmware, but you want to get rid of Chinese restrictions (no Google services, censorship, etc.) You can download it on the official Xiaomi website.
- Stable is a stable version with minimal bugs, but no latest features.
- Developer β weekly builds with new features, but errors are possible.
Custom firmware (e.g. LineageOS, Pixel Experience, ArrowOS) offers:
- π± Clean Android without imposed apps and ads.
- π Longer support for older devices.
- β‘ Ability to fine-tune the interface and performance.
However, they may lose some of the Xiaomi brand features, such as IR-blaster.
To search for custom firmware, use resources:
- XDA Developers is the largest firmware and instruction community.
- LineageOS is the official website with support for many Xiaomi devices.
- Pixel Experience is a firmware with an interface, like on Google Pixel.
What is the danger of firmware from unknown sources?
4. Install firmware via Fastboot or Recovery
The installation method depends on the firmware type. Official versions of MIUI are usually installed via Fastboot, and custom versions are installed via Custom Recovery (for example, TWRP or OrangeFox).
Install the official MIUI via Fastboot:
- Download the firmware in.tgz format and unpack it into a folder with platform-tools.
- Connect your phone in Fastboot mode and launch the file flash_all.bat (Windows or flash_all.sh (Linux/Mac).
- Wait until the process is complete (the phone will reboot automatically).
Install custom firmware through TWRP:
- Install TWRP Recovery for your model (instructions are available on the official website).
- Download the firmware (.zip format) and place it on the external SD-card.
- Boot to TWRP (clip Power + Volume up), run Wipe β Format Data (this will delete everything, including internal memory!), then install the firmware through Install.
fastboot flash recovery twrp.img
fastboot boot twrp.imgOnce custom firmware is installed, you may need to flash GApps (Google services) and Magisk (root rights), which are also installed via TWRP.
β οΈ Note: On some models (Xiaomi) 11T, Redmi K40) Installation of custom Recovery leads to data loss in the data partition due to encryption FBE. To avoid this, before the firmware TWRP Data must be formatted in F2FS or ext4 via fastboot command format:ext4 userdata.
π‘
If you have your phone stuck on the MI logo after you have firmware, try booting up to Recovery and running Wipe Dalvik/Cache. If that doesn't work, reflash the device by formatting all partitions except internal storage.
5. Solving common firmware errors
Even with strict adherence to instructions, errors can occur, and let's look at the most common ones and how to fix them.
| Mistake. | Reason. | Decision |
|---|---|---|
| Anti-rollback check | Trying to install firmware is older than the current version of Anti-Rollback. | Find a firmware with a newer build date or use it EDL-regime (risky). |
| Invalid sparse file format at header | A damaged firmware file or an incompatible version of TWRP. | Download the firmware and check the Recovery version. |
| The phone does not turn on after the firmware | Incorrectly selected firmware or interrupted process. | Try flashing the official MIUI for your model through Fastboot. |
| E: Unknown command [log] in TWRP | An outdated version of Recovery. | Update TWRP to the latest version for your device. |
If you encounter an error This package is for "sweet" devices; this is a" means that the firmware is not designed for your model. Double check the code name of the device! TWRP Go to Advanced. β Terminal and enter:
getprop ro.product.deviceIf the device is not detected by the computer in Fastboot mode, try:
- π Use the other USB-cable (preferably original).
- π₯οΈ Reinstall drivers ADB manually through Device Manager.
- π Reboot your phone in Fastboot again.
π‘
If none of the methods helped, and the device does not turn on, the last option remains - firmware through the EDL-Mode (9008) This method requires an authorized Xiaomi account and a special cable, but restores the device even in cases of full "brick".
6. System optimization after firmware
After successfully installing a new firmware, it is recommended to follow several steps to improve performance and stability:
- π Make a cache reset in Recovery (Wipe) β Dalvik/Cache).
- π Turn off interface animation in Settings β The phone. β Build number (click 7 times to activate developer mode), then in Settings β System system β For developers, set all the animation values on 0.5x.
- π Calibrate the battery: completely discharge the phone, then charge to 100% without interruptions.
- π‘οΈ Install Magisk to manage root rights and modules (e.g, ViPER4Android sound-enhancing).
If you have installed custom firmware based on AOSP, you may need to manually configure:
- πΆ Mobile Network: Check out APN-settings for your operator.
- π Sound: Some firmware has microphone problems in calls (solved by installing the Perseus or FrancoKernel kernel).
- π· Camera: GCam may require additional libraries to function (libpatche).
To check the stability of the system, use the following tests:
- AnTuTu Benchmark β for performance evaluation.
- Geekbench β for checking the CPU and GPU.
- AccuBattery β to monitor battery consumption.
π‘
If navigation gestures stop working after firmware, try resetting Lawnchair settings (if installed) or returning the standard launcher via Settings β Applications β By default.
7 How to return the official firmware if something went wrong
If custom firmware is unstable or you want to return the warranty, you can roll back to the official MIUI.
- Download Fastboot firmware for your model from the official website.
- Unpack the archive and launch it. flash_all.bat (Windows or flash_all.sh (Linux/Mac).
- If the process ends with an error, use the fastboot-w command to clear the data before the firmware.
For complete "purity" of the device (for example, before selling), follow the following additional steps:
- π Lock the bootloader back with the Mi Unlock Tool (Lock option).
- π Make a complete reset through Settings β Additionally. β Recovery and discharge.
- π± Check the status of Widevine in the application DRM Info - if displayed L1, it's okay.
β οΈ Note: On some models (Xiaomi) 12S Ultra, Redmi K50 Pro) locking the bootloader after installing the custom firmware may result in loss IMEI! Before blocking, make sure that the device is official firmware, and the modem and persist partitions have not been modified.
8. Security and data protection advice
Installing unofficial firmware increases the risk of data leakage or malware infection. Follow these guidelines to minimize threats:
- π Use encrypted storage (included in Settings) β Security β Encryption).
- π‘οΈ Install Magisk with SafetyNet Fix to pass checks in banking applications.
- π Regularly check your system for viruses with Malwarebytes or Bitdefender.
- π Update the firmware and kernel through OTA manually (watch for updates on the forum) XDA).
If you use root rights, avoid:
- π« Install applications from unknown sources (even if they are βverified").
- π« Log in to banking apps or payment systems (use Island or Shelter for isolation).
- π« Modifications to system files without backup (e.g., via Root Explorer).
For additional protection:
- π Set up hardware authentication (fingerprint) + PIN) In Settings β Security.
- π‘ Turn it off. ADB Wi-Fi in the developer settings if you donβt use it constantly.
- π Check application permissions through AppOps (hidden menu, available via adb shell).
π‘
Even custom firmware can maintain a high level of security if you follow the basic rules: do not install unnecessary Magisk modules, regularly update the system and use proven sources to download software.