Installing custom firmware on Xiaomi smartphones is a popular way to expand the functionality of the device, get root rights or get rid of advertising in MIUI. However, often users are faced with the need to return the original firmware: due to unstable work, loss of warranty, problems with banking applications or simply the desire to sell the phone in a βcleanβ form. The process of removing custom firmware requires care, since improper actions can lead to a βbrickβ (complete inoperability) of the device.
In this article, we will look at all the steps of returning to the stock MIUI: from preparing and unlocking the bootloader to choosing the right version of the firmware and solving possible errors. Particular attention will be paid to the nuances for different Xiaomi models (for example, Redmi Note 10 Pro, POCO F3, Mi 11), as well as the current tools of 2026. If you have previously installed TWRP, LineageOS or other custom builds, this guide will help return the phone to the factory state without losing IMEI or data (with the right backup).
Why you may need to remove the custom firmware
Castom firmware gives you freedom, but it often comes with hidden problems, and here are the most common reasons for returning to MIUI:
- π Unstable operation: accidental reboots, freezes or overheating of the device, especially for firmware based AOSP, Not always optimized for Xiaomi iron.
- π³ Problems with banking applications: many custom firmware do not pass SafetyNet, which is why Sberbank Online, Tinkoff or Google Pay refuse to work.
- π¦ Loss of functionality: gestures do not work MIUI, camera (due to lack of libcamera drivers), NFC or IR-blaster.
- π Blocking the Mi Account: when installing custom firmware without unlocking the bootloader, the device can be blocked at the activation stage.
- π° Sale or warranty repair: Xiaomi service centers refuse to accept devices with modified software.
It is important to understand that some problems (for example, with SafetyNet) can be solved without a full return to the drain - just hide the root with Magisk or Universal SafetyNet Fix module. However, if the firmware is not working correctly or you are planning to sell, a full rollback is the only reliable option.
Preparing for the removal of custom firmware: what to do in advance
Before you start the procedure, make sure you follow all the critical steps. Missing at least one item can lead to data loss or inability to restore the device.
Backup all data (photos, contacts, messages)
Check the device model and MIUI version (in Settings β About Phone)
Download the official firmware for your model from the Xiaomi website
Make sure that the battery charge is β₯ 60%
Prepare. USB-cable (preferably original) and computer with Windows/Linux
Disable OEM lock and enable USB debugging (if the phone is still on)
-->
Pay special attention to backup, and even if you plan to use fastboot, which doesn't theoretically affect user data, the risk of losing it remains.
- π± Save. IMEI (Type *#06# and write down both numbers).
- π Export data from Google Authenticator or other 2FA-applications.
- π Copy folders. DCIM, Downloads and WhatsApp on PC.
β οΈ Note: If your device is blocked by Mi Account (after reset requires a login / password), be sure to link it to the account before the procedure. After installing the stock firmware, you may need authorization, and without a binding, the phone will turn into a brick".
Methods of removing custom firmware: which to choose
There are three main methods of returning to the MIUI, depending on the current state of the device and your technical skills:
| Method | When to use | Pluses | Cons | Difficulty |
|---|---|---|---|---|
| Through TWRP | If you have a custom recavator and the phone is turned on | Stores data (with the right backup), does not require a PC | Not all stock firmware supports installation via TWRP | Medium |
| Fastboot (Mi Flash) | For "bricks" or if TWRP is not available | It works even on non-functioning devices, 100% returns the runoff | Deletes all data, requires an unlocked bootloader | Tall. |
| EDL-regime | If the bootloader is locked and the phone is not turned on | It also restores dead devices. | Requires an authorized Xiaomi account or boxing | Very high. |
For most users, the best option is the Mi Flash Tool (fastboot), which is suitable even if you have never worked with firmware, but requires pre-unlocking the bootloader. If the bootloader is locked and the phone does not turn on, you will need EDL, but this method is more complex and risky.
π‘
If you are not sure which method to choose, check the bootloader status with the command fastboot oem device-info. If the answer has the line Device unlocked: true, you can use the Mi Flash Tool.
Step-by-step: remove custom firmware through the Mi Flash Tool
This method is suitable for most Xiaomi models (including Redmi, POCO, Mi) and guarantees a complete return to the runoff state. Follow the instructions carefully - skipping steps can lead to errors.
Step 1: Unlock the bootloader
If the bootloader is already unlocked (you installed custom firmware), skip this step. If not, follow:
- Download the Mi Unlock Tool and install it on PC.
- Turn on your phone to USB Debug and OEM Unlock in Settings β For developers.
- Link the device to your Mi Account in Settings β Xiaomi Account.
- Connect your phone to your PC in fastboot mode (turn off your phone, then press Power + Volume down).
- Launch the Mi Unlock Tool, log in to your account and follow the instructions.
Step 2: Download the official firmware
Use only firmware from the official Xiaomi website.
- Go to the downloads page.
- Select your model (e.g. Redmi Note 11 Pro+ 5G β veux).
- Download the latest stable version of MIUI (.tgz or.zip format).
- Unpack the archive in a folder without Cyrillic characters (for example, C:\MIUI\veux_global_images...).
How to find out the coded name of the model?
Step 3: Install firmware through Mi Flash Tool
Now let's try this again.
- Download and install the Mi Flash Tool.
- Turn off the phone and turn it into fastboot (clip Power + Volume down).
- Connect your phone to your PC. Make sure the drivers are installed (Android Bootloader Interface should be displayed in Device Manager).
- Launch the Mi Flash Tool, press Select and specify the folder with the unpacked firmware.
- At the bottom, select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
- Press Flash and wait for completion (5-10 minutes). the phone will reboot automatically.
β οΈ Note: If after firmware the phone is stuck on the logo MI If you're not doing it for 15 minutes, don't panic. Try to force it to restart. If that doesn't work, repeat the firmware by choosing a different mode (clean all instead of clean all and lock).
π‘
Clean all and lock mode will block the bootloader, making it impossible to install custom firmware in the future without re-unlocking. Use it only if you plan to stay on the MIUI drain.
Solving common mistakes when removing custom firmware
Even with the correct following of the instructions, there can be problems, and here are the most common mistakes and ways to correct them:
- π¨ Anti-rollback error: occurs when you try to install firmware older than the one you used to install. MIUI use EDL.
- π Phone is not defined in Mi Flash: check the cable (try the original), install drivers ADB, try another USB-port (preferably) USB 2.0).
- π Bootloop: Try flashing again with a clean all mark. If it doesn't work, install the firmware through TWRP (if the Recovery are preserved).
- π Requires a Mi Account after firmware: it's normal if the phone was linked to the account. Enter the data from the Mi Account that was used when unlocking.
- π΅ No network after firmware: check IMEI (dial *#06# if IMEI No, no, restore it through SN Write Tool in the EDL-mode.
If none of the methods worked and the phone didn't turn on, it could be damaged. EMMC-Memory or boot section: This will require professional equipment (such as a UFi Box or EasyJTAG) or a service center.
π‘
If the sound is gone or the camera is not working after the firmware, you probably installed the firmware for another device modification (for example, for the Redmi Note 10 Pro instead of the Redmi Note 10 Pro Max).
Recovery of IMEI and other critical data after firmware
One of the most frustrating problems after returning to stock firmware is loss. IMEI, MAC-Wi-Fi addresses or serial numbers, this is because of partition clearing. modemst1 and modemst2, And there are a number of ways that you can recover that data:
Method 1: Engineering Mode (for Qualcomm)
Suitable for most Xiaomi smartphones on Snapdragon processors:
- Install the MTK Engineering Mode app (yes, it works on Qualcomm too).
- Open it, go to MTK Settings β Connectivity β CDS Information β Radio Information.
- Choose a Phone. 1 (first SIM), command: AT +EGMR=1,7,"IMEI_1" AT +EGMR=1,10,"IMEI_2" (substitute IMEI_1 and IMEI_2 on your numbers).
- Reboot the phone.
Method 2: Through QCN-file (requires) EDL)
If the first method does not work, you will need:
- Download QCN Rebuilder and original QCN-file for your model (see forums) 4PDA or XDA).
- Transfer the phone to EDL-Mode (close testpoints or via adb reboot edl if root is available).
- Switch QCN via QPST or QFil.
β οΈ Attention: Wrong QCN-Use only files that are designed for your exact model and region (e.g. Redmi Note 10 Pro Global, not Redmi Note 10 Pro India).
What to do after successful removal of custom firmware
After returning to the MIUI drain, it is recommended to follow several steps to ensure the stability of the system and avoid problems in the future:
- π Reset settings through Settings β Additionally. β Recovery and reset. This will delete the residual custom firmware files.
- π Update. MIUI Up to the latest version through Settings β Update the system, which will fix any bugs from the old firmware.
- π‘οΈ Check SafetyNet with the SafetyNet Test app. If the test fails, install Magisk and the Universal SafetyNet Fix module.
- π± Set up a Mi Account: link your phone to your account, enable Find Device and Sync.
- π Check the battery: custom firmware sometimes knocks the battery calibration. Reset the stats to Settings β Battery β Three points. β Calibration of the battery.
If you plan to sell the phone, do a full reset again and untie your Mi Account in Settings β Xiaomi Account β Sign out. The buyer should be able to activate the device on their account.