Xiaomi smartphone users often install custom TWRP recavators to gain advanced rights, install modified firmware or create full backups of the system. However, over time, there is a need to return the device to its original state, this may be due to the desire to sell the gadget, the need for an official service or the desire to get stable work without the risk of software failures.
The process of removing Team Win Recovery Project is not as simple as uninstalling an application as it is a system partition. Wrong actions can cause the phone to stop booting into the operating system. It is important to understand that we will work with low-level partitions of memory, so the accuracy of each step is critical to the success of the operation.
In this article, we will discuss in detail how to safely return stock Recovery. We will look at computer use, command line work and automatic scripts. You will learn how to check the status of the bootloader and make sure that the device is ready for the flashing procedure without losing functionality.
Why you may need to remove the custom recavator
The main reason for returning factory software is the need for an official update. MIUI HyperOS often blocks installation OTA-updates if it detects a modified recovery partition. TWRP It can prevent you from switching to a new version of Android, leaving the device vulnerable to security holes.
Many users also face a requirement to remove root rights before contacting a service center. Xiaomi engineers can refuse warranty repairs when they see a modified bootloader or third-party menu, in which case removing TWRP becomes a prerequisite for restoring warranty.
β οΈ Warning: The stock recavery return procedure on some models with the loader unlocked may cause an Orange State error during boot, warning of unlocking.
Also, custom menus can run unstable after major security updates. If you notice that the phone is consuming more power or running faster in standby mode, the old version of TWRP may be in conflict with the new version of the system kernel.
Preparation of the device and computer for firmware
Before any manipulations, you need to ensure a stable connection between the smartphone and the PC. USB-cable, because cheap analogues may not provide sufficient current or data transfer, the computer must be charged, and the laptop should be connected to the power supply network, to eliminate the risk of a power outage at a critical moment.
On your smartphone, you need to activate the USB debugging mode. To do this, go to Settings β About Phone and quickly click on the MIUI build number seven times. After the message βYou became a developerβ, open the Advanced Settings menu β For developers and turn on the Debugging by USB item.
βοΈ Checking readiness
It is important to back up all personal data. The process of firmware storage may require a complete cleanup of the data partition, especially if you are switching from custom firmware to official firmware.
Make sure your computer has the current ADB and Fastboot drivers installed. Without them, your computer wonβt be able to recognize your phone in a special mode. Xiaomi devices may also require specific Qualcomm or MediaTek drivers, depending on your deviceβs processor.
Method One: Using Fastboot and Flash Commands
The most reliable way to remove TWRP is to flash the recovery partition through Fastboot mode. To do this, turn off your phone and press the power and volume buttons down. When the bunny appears on the screen in the ear hat, the device is ready to go. Connect it to the computer with a cable.
Open the command line or terminal on your computer in the folder with the ADB tools. Enter the connection check command:
fastboot devicesIf you see the serial number of the device, the connection is established, you now need to download the image of the stock recave, corresponding to your model and firmware version, you need to download images only from trusted sources, for example, from the site xiaomirom.com or the official base Xiaomi Firmware Updater.
After downloading the recovery.img file, run the firmware command:
fastboot flash recovery recovery.imgβ οΈ Warning: Do not use a recovery image from another phone model! this can lead to the "bricking" of the device, which will have to be restored through the phone. EDL-Authorized account mode.
Once you have successfully recorded an image, you should immediately reboot it to the new menu so that it is not overwritten by the system when you first start.
fastboot boot recoveryOr press the volume and power button at the same time, holding them until the Mi logo appears. If you saw a menu with the Mi logo and a suggestion to choose a language (Chinese / English) or a menu with an android and an exclamation mark - then TWRP has successfully removed and returned to the factory section.
What if Fastboot canβt see the phone?
Method Two: Installation with Mi Flash Tool
If manual command entry seems difficult, you can use the official Mi Flash Tool. This method is safer for beginners, since the program itself controls the process of writing partitions. You will need to download the Fastboot version of the firmware for your model (the archive should end in.tgz, not.zip).
Unpack the firmware archive to the root of the C disk so that the path to the folder is short and Cyrillic free. Launch the Mi Flash Tool on behalf of the administrator. Put the phone to Fastboot mode and connect to the PC. Press the Refresh button in the program, the device serial number should appear.
Choose the path to the unpacked firmware. At the bottom of the window, select the option "clean_all". This option will completely clean the phone and set all partitions, including recovery, to factory status. 200 before 600 seconds.
| Parameter | Description | Impact on data |
|---|---|---|
| clean_all | Complete cleaning and firmware | All data is deleted |
| save_user_data | Preserve firmware | Data is stored (not recommended for changing regions) |
| clean_all_and_lock | Cleaning, firmware and locking | All data is deleted, the loader is blocked |
Once completed, the phone will automatically restart. The first run can last up to 10 minutes as the system optimizes applications, at which point TWRP has already been completely removed from the device's memory.
π‘
Using Mi Flash with Mode clean_all β The most guaranteed way to return the phone to the state of βout of the boxβ, completely removing traces of modifications.
Block the bootloader after removing the TWRP
Many users want to not only remove the TWRP, but also block the bootloader to hide the fact of interference in the system, which can only be done on global versions of firmware and only if you did not change the region of your Xiaomi account after unlocking.
You need to be in Fastboot mode to lock.
fastboot oem lockA warning will appear on the phone screen that the device will be reset. Confirm the action with the volume button. The process will take a few minutes, after which the phone will restart and start setting up as new.
It is important to understand the risks: if the phone is not installed on the global firmware (for example, Chinese CN with a global language), blocking the bootloader will lead to the inability to boot the system (bootloop), in which case you will have to unlock the bootloader again and reflash the device.
Also, you can't block if you have modified system files or non-original components installed on the system. The integrity check utility can block the process. So make sure that you have a clean official firmware before blocking.
Possible mistakes and ways to solve them
There are a number of errors that can occur when you uninstall TWRP, and one of the most common is "Partition is not allowed to flash." This means you're trying to flash a partition that's protected from writing in the current bootloader state. Solution is one: flash it completely through Mi Flash.
Another common problem is that the phone goes into an endless bootloop after installing the stock recovery on top of the custom firmware, which is due to the incompatibility of the old system's encrypted data with the new recovery, in which case you need to format the Data partition through the Recovery menu (Wipe Data β Format Data).
β οΈ Note: Format Data is different from Wipe All Data, which removes encryption but completely destroys all files in internal memory.
If the phone stopped responding to buttons and didnβt turn on, it may have fallen into EDL (Emergency Download) mode, which on the screen looks like just a black screen with a cable connected, in which case only flashing through Mi Flash with an authorized account or contacting the service will help.
Sometimes the antivirus on your computer can block the Fastboot drivers. Try temporarily disabling protection or running the command line on behalf of the administrator. Also check if you are not on the way to the firmware files Russian letters - Xiaomi tools often incorrectly handle Cyrillic in the paths.
π‘
If your phone says "System has been destroyed" or a similar error after you run it, try Wipe All Data in the Recovery menu (if available) and then Reboot. If it doesn't, just re-running through Fastboot.
Verification of the result and final recommendations
To make sure that TWRP is removed, turn off your phone and try to enter recovery mode (press the power and volume up).If you see a standard three-point Mi-Recovery menu (Reboot, Wipe Data, Connect with Assistant) or a menu with an android lying on your back, then the operation was successful.
You can also check the status through applications such as Device Info HW or through the terminal command getprop ro.boot.flash.locked. If the bootloader is blocked, the value will be 1 if unlocked - 0. The presence of a stock recovery guarantees the possibility of receiving official updates "over the air".
Remember to update your system regularly. Once you return to factory settings, your phone may suggest you install an available update, and agree to it to close security vulnerabilities that may have been opened during your TWRP experiments.
Now your Xiaomi device looks new again, with a factory-made software shell, so you can sell it, transfer it to another user, or just use a stable version of the OS without unnecessary modifications.
π‘
Successful login to the standard Recovery menu and the lack of root rights in the bankβs applications are the main signs that the TWRP is completely removed and the phone is ready for use.