Removing custom firmware on Xiaomi: return stock MIUI without risks

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.

πŸ“Š What custom firmware you installed on Xiaomi?
LineageOS
Pixel Experience
Havoc OS
ArrowOS
Another.
No one.

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:

MethodWhen to usePlusesConsDifficulty
Through TWRPIf you have a custom recavator and the phone is turned onStores data (with the right backup), does not require a PCNot all stock firmware supports installation via TWRPMedium
Fastboot (Mi Flash)For "bricks" or if TWRP is not availableIt works even on non-functioning devices, 100% returns the runoffDeletes all data, requires an unlocked bootloaderTall.
EDL-regimeIf the bootloader is locked and the phone is not turned onIt also restores dead devices.Requires an authorized Xiaomi account or boxingVery 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:

  1. Download the Mi Unlock Tool and install it on PC.
  2. Turn on your phone to USB Debug and OEM Unlock in Settings β†’ For developers.
  3. Link the device to your Mi Account in Settings β†’ Xiaomi Account.
  4. Connect your phone to your PC in fastboot mode (turn off your phone, then press Power + Volume down).
  5. 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.

  1. Go to the downloads page.
  2. Select your model (e.g. Redmi Note 11 Pro+ 5G β†’ veux).
  3. Download the latest stable version of MIUI (.tgz or.zip format).
  4. 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?
The code name (e.g., veux for Redmi Note 11 Pro+) can be found: 1. In the phone settings: Settings β†’ About Phone β†’ MIUI version (click a few times on "Kornel Version"). 2. On the Xiaomi Firmware Updater website by model name. 3. Through the command in ADB: adb shell getprop ro.product.device.

Step 3: Install firmware through Mi Flash Tool

Now let's try this again.

  1. Download and install the Mi Flash Tool.
  2. Turn off the phone and turn it into fastboot (clip Power + Volume down).
  3. Connect your phone to your PC. Make sure the drivers are installed (Android Bootloader Interface should be displayed in Device Manager).
  4. Launch the Mi Flash Tool, press Select and specify the folder with the unpacked firmware.
  5. At the bottom, select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
  6. 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:

  1. Install the MTK Engineering Mode app (yes, it works on Qualcomm too).
  2. Open it, go to MTK Settings β†’ Connectivity β†’ CDS Information β†’ Radio Information.
  3. 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).
  4. Reboot the phone.

Method 2: Through QCN-file (requires) EDL)

If the first method does not work, you will need:

  1. Download QCN Rebuilder and original QCN-file for your model (see forums) 4PDA or XDA).
  2. Transfer the phone to EDL-Mode (close testpoints or via adb reboot edl if root is available).
  3. 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.

FAQ: Frequent questions about removing custom firmware on Xiaomi

Can I remove custom firmware without a computer?
Yes, if you have TWRP installed and your phone turns on. Download the official firmware in.zip (not.tgz!), move it to your phone, boot it to TWRP and install it as a regular ZIP. However, this method does not work for all models β€” some Xiaomi stock firmware requires installation via fastboot.
Why is the phone not turned on after running through Mi Flash?
There are several reasons: The firmware was wrong (for example, for another modification of the device); the bootloader was locked (clean all and lock), but the firmware is incompatible with the locked state; memory is damaged (EMMC), especially if the firmware was interrupted; Solution: repeat the firmware with clean all mode (without locking the bootloader); if it does not help, try flashing through EDL.
How to return root after returning to stock firmware?
If you want to keep root access but return stock MIUI: Fly stock firmware through fastboot with clean all mode (don’t block the bootloader!). Install Magisk via TWRP or boot.img patch. Hide root with MagiskHide or SafetyNet Fix module. Importantly, some banking applications (e.g. Sberbank Online) can detect even hidden root. In this case, you have to choose either root or full compatibility with financial services.
Can I remove the custom firmware on the blocked bootloader?
No, if the bootloader is locked and the phone is not turning on, you will need to: Unlock the bootloader via EDL (requires an authorized Xiaomi account or box). Use the official Xiaomi service (but this voids the warranty and can cost a lot). If the phone turns on, unlock the bootloader through the Mi Unlock Tool (as described above), then flash the stock firmware.
Where to get the official firmware for the old Xiaomi model?
For devices older than 2-3 years (e.g. Redmi 4X, Mi A1), official firmware can be removed from the Xiaomi website. Alternative sources: Xiaomi Firmware Updater β€” firmware archive for all models. 4PDA β€” themes with firmware and instructions for specific devices. XDA Developers β€” partition of your model (see by encoding name). Pay attention to the version of MIUI (Global/China/EEA) β€” a region mismatch can lead to problems with the language or network.