Many users of Xiaomi, Redmi and other devices POCO Sooner or later, people think about returning to factory settings after experimenting with custom firmware. Often the main obstacle to returning a stock system or receiving official updates is a modified bootloader and installed hardware. TWRP Recovery.Having a third-party recovery menu blocks work OTA-updates and may cause errors in the system integrity verification by banks and payment services.
Recovery replacement does not require a deep knowledge of Linux, but requires careful and rigorous algorithmic action. Errors at this stage can lead to the inability to boot the operating system or loss of data. In this article, we will discuss in detail the safe methods of returning Stock Recovery using both automated tools and manual methods through Fastboot.
Before taking action, you need to be aware of the risks. Any interference in the system partition of the device is a potential threat to the stability of the gadget. A critical condition for a successful replacement is the exact match of the firmware version for which the Recovery is recorded with the current or target version of Android. Version mismatch can lead to a cyclical reboot or complete failure of the device to respond to commands.
Why you should remove TWRP before returning the drain
Installing custom recavators such as TWRP or OrangeFox changes the system partition of recovery.These changes violate the digital signature of the bootloader, which is one of the triggers for blocking the work of protected applications. Banking programs, Google Pay (now Google Wallet), and various corporate customers often refuse to run on devices with an unlocked bootloader or modified recovery partition.
In addition to security issues, the presence of TWRP makes it impossible to receive updates βover the air.β OTA mechanism from Xiaomi checks the integrity of system files before installation. If a modification is detected in the recovery section, the update process is interrupted during the verification phase, and the user receives an error message. Return of the stock recavereation eliminates this problem, allowing you to receive again official security patches and new versions of MIUI or HyperOS.
β οΈ Note: Recovery replacement will result in a reset of all user data if you use the full flashing method.Even when using methods without losing data, it is strongly advised to back up important information.
Also worth mentioning is the Anti-Rollback feature. Some Xiaomi smartphones (especially Snapdragon-based ones) have rollback protection. Trying to flash the old version of the backpack or firmware can permanently lock the device. So always use files that match the current or newer version of the software for your particular model.
Preparation of the device and computer for the procedure
The success of the operation depends on 90% of the correct preparation of the workplace and software. You will need a computer running Windows, macOS or Linux, which is working properly. USB-cable (preferably original or high-quality analogue) and a charged smartphone. battery charge should be at least 60% so that the device does not turn off at the most critical time of recording system partitions.
The first step is to install the necessary drivers. Fastboot requires ADB and Fastboot drivers, as well as Qualcomm or MediaTek drivers depending on the processor of your device. Without properly installed drivers, the computer will not be able to recognize the smartphone in bootloader mode, and commands will simply not be sent.
Remember to activate the developer mode on the smartphone itself. You need to click on the build number several times in the About Phone section, and then the option Additional or Advanced Settings will appear in the menu. You need to enable USB debugging. Although this is not always necessary for Fastboot mode, for some unlock methods and working with ADB this is critical.
βοΈ Checklist of preparations
Search and download the original Recovery image
The hardest part is finding the right recovery.img file. Simply downloading a file from the Internet called "recovery" is not enough. The file must strictly match the model of your device (codename, for example, mojito, vayu, cepheus) and, ideally, the firmware version. Using an image from another model is guaranteed to turn the smartphone into a "brick".
The best source for file search is the official Xiaomi firmware site or verified archives like XiaomiFirmwareUpdater. You need to download the full firmware (Fastboot ROM) for your model. Inside the firmware archive, usually in the images folder, there is the desired recovery.img file. It is safer to extract it from the firmware than to download it separately.
There is also a method of using Xiaomi ADB/Fastboot Tools, which can pull images from official packages on its own. However, manual extraction gives you more control and understanding of what you are doing. Make sure that the downloaded firmware is for your region (Global, EEA, Russia recovery, China), although this is less critical for the partition than for the system partition.
| File type | Appointment | Where to find | The importance of coincidence |
|---|---|---|---|
| recovery.img | Section of the reconstruction section | Inside the Fastboot ROM archive | Critical (model) |
| boot.img | Boot partition (core) | Inside the Fastboot ROM archive | High (Android version) |
| vbmeta.img | Integrity verification | Inside the Fastboot ROM archive | Medium (for unlocking) |
| system.img | System section | Inside the Fastboot ROM archive | Critical (full firmware) |
Where can I find the code name of the device?
Method 1: Replacement by Fastboot (Manual Method)
This method is the most reliable and versatile for all Xiaomi devices with an unlocked bootloader. It involves directly writing an image to a memory partition via the command line. You don't need to refashion the entire phone, we will only touch one partition.
First, turn your smartphone into Fastboot mode. To do this, turn off the device, and then press the volume down and power button at the same time. The screen will show an image of a rabbit repairing an android, or the inscription FASTBOOT. Connect the phone to the computer.
Open the Command Prompt (CMD) or PowerShell in the folder where the recovery.img file and platform tools (ADB/Fastboot) are located. Enter the connection check command:
fastboot devicesIf you see the serial number of the device, you've got the connection, and then you type in the command to record the stock image.
fastboot flash recovery recovery.imgAfter a successful command (Finished. Total time: X.XXs will appear), you can not just turn on the phone. You need to immediately reboot to the new recaveri so that it is not overwritten by the system at a normal start.
π‘
After the flash recovery command, you can not do the usual reboot, only reboot recovery, otherwise the stock system can again replace the recovery with TWRP if it is sewn into the boot.
Method 2: Complete flashing with the Mi Flash Tool
If the manual method seems too complicated or causes errors, you can use the official Mi Flash Tool, which is guaranteed to return the device to a completely stock state, including the recovery, the bootloader (if you close it), and all system partitions.
To start, download and install the Mi Flash Tool, as well as unpack the previously downloaded Fastboot firmware. Firmware folder should not contain Cyrillic characters in the way, it is better to place it in the root of the disk, for example, C:\ROM\. Launch the program on behalf of the administrator.
In the program interface, press the Refresh button and make sure your device is identified (its ID will be displayed). Select the Clean all firmware mode. This mode completely erases data and puts a clean system with a stock recovery. Clean all and lock mode is not recommended if you are not sure about the firmware region, as this can lead to a bootloom.
β οΈ Note: Using the βClean all and lockβ option with the wrong region firmware (e.g. Global on Chinese) will block the bootloader and may make the device unusable without a service center.
Once you select the mode, press the Flash button. It takes 300 to 600 seconds. It automatically reboots when it's finished. At this point, you'll have a fully factory-built device with the original Recovery.
Possible mistakes and ways to solve them
When you replace a recover, you often have a problem, and one of the most common is a problem (FAILED: remote: device is locked), which means that the bootloader is locked. To write partitions through Fastboot, the bootloader must be unlocked. If it's locked, you'll have to go through the official Mi Unlock process first.
Another common problem is the FAILED: remote: partition flashing is not allowed. This is Anti-Rollback protection, which occurs if you try to flash a version of the back or firmware older than the one installed now, or if the protection index has been raised, in which case only the firmware of the current or newer version of the software will help.
It is also possible that after the recovery is replaced, the phone goes into a cyclic reboot (Bootloop), often solved by a data reset (Wipe Data) through a new stock recovery menu. If the phone doesnβt turn on at all (black screen, but there is vibration), the boot partition may be damaged and you will need to flash through the phone. EDL-a mode that already requires an authorized Mi Account or paid services.
π‘
If no updates come after you run the stock recovery, try selecting Wipe Data from the Recovery menu, and then force the updates to be checked in the phone settings. Sometimes the update cache needs to be manually cleaned.