Owners of Xiaomi, Redmi and Poco smartphones often face a situation where, after a regular system update or accidental reboot, the custom recovery disappears, giving way to the standard MI Recovery menu. This is due to a system protection mechanism that checks the integrity of the boot partition at each start. If the signature is different from the factory one, the system automatically restores the original image, erasing all traces of the modifications.
TWRP (Team Win Recovery Project) recovery requires not just re-installation, but also understanding why it happened. In most cases, the problem lies in the wrong course of action when updating the firmware or not having a system change blocker, you will need to re-open the bootloader if it was reset, or use special firmware techniques that bypass integrity checks.
This guide describes the current methods of returning recoveries to devices with Snapdragon and MediaTek processors. We will consider working with Fastboot, using ADB and the specific nuances for new versions of Android. It is important to understand that all actions you make at your own risk, as interference with system partitions always carries potential risks.
Why TWRP Flies After Update or Reboot
The main reason for the disappearance of the custom recavator is the verification mechanism of the AVB bootloader (Android Verified Boot). When you install an OTA update or reflash the device through Mi Flash in clean mode, the system updates the boot and recovery section. Since the TWRP does not have a digital manufacturer signature, the security algorithm marks it as damaged or changed.
The next time you bootload, the bootloader detects a hash mismatch and forcibly replaces the modified image in the factory. This is standard behavior for modern versions of MIUI and HyperOS. Even if you just rebooted to Recovery mode to obtain root rights, the system could have time to check and roll back the changes.
β οΈ Warning: Constant overwriting of the recovery can lead to a cyclic reboot (bootloop) if the system files have been changed by the Magisk patch and the recoveries are returned to the stock state.
It is also worth considering that on devices with dynamic partition scheme (A/B partition scheme), the situation is complicated. the update can affect only one slot, while the second will remain with the old version of TWRP. When switching the active slot, you can see the presence, then the absence of a custom menu.
Preparation of tools and drivers for firmware
Before you start to restore, you need to make sure that you have the latest tools. You need a package Platform Tools containing utilities adb and fastboot. Without them, interaction with the bootloader of the device is impossible, you can download them from the official Android developer site or through specialized repositories.
The critical step is to install the right drivers. Xiaomi devices need specific Qualcomm or MediaTek drivers, as well as the ADB Interface driver. The device manager when connecting a smartphone in Fastboot mode must display Android Bootloader Interface without exclamation points.
- π± Download the current image TWRP specifically for your device model (file with.img extension).
- π» Install the drivers. ADB and Fastboot on a computer with Windows operating system.
- π Make sure the bootloader is unlocked (Unlocked status in Fastboot).
- π Charge your smartphone to at least 60% to avoid power outages at a critical time.
Don't forget to turn on the debugging. USB If access to the system is limited, the transition to Fastboot mode is carried out by a combination of buttons Volume down. + Power when the device is off. Connect the phone with original or quality cable directly to the PC motherboard port, avoiding USB-hub.
βοΈ Testing of recovery preparedness
The process of installing TWRP via Fastboot
The most reliable and common method of retrieve is using Fastboot mode, which allows you to directly write images to memory sections, bypassing the operating system. Put your smartphone into this mode and connect to your computer. In the command line, enter fastboot devices to check the connection.
If the device is determined, you can go to the recording of the image. The command fastboot flash recovery twrp.img will write the file to the appropriate partition. However, on modern devices with A/B partitions, a simple recording may not be enough, since the system can overwrite the partition again on the first boot.
fastboot flash recovery_ab twrp.img
fastboot set_active aAfter completing the commands, it is extremely important to prevent normal booting in Android. Immediately use the button combination to log in to Recovery. + If you get on the menu TWRP, So, the first step is a success, and now you need to fix the result so that the system doesn't roll back the change.
β οΈ Attention: On devices with data encryption (FBE) post-installation TWRP You may not be able to access the internal memory. That's fine, you'll need to format the data.
In some cases, especially the new Poco and Redmi models, it is required to additionally stitch the patched boot image or use scripts to disable verification.
TWRP fixing and circumventing integrity check
To prevent TWRP from crashing after the first reboot, you need to disable the self-repair mechanism, often requiring a patch that modifies the bootloader or signature-checking system files, and without this step, all previous actions may be in vain.
There are several ways to anchor, and the first is to use backbone scripts, such as: Disable_Dm-Verity_ForceEncrypt. The second is the installation of the Magisk root rights manager, which, when installed correctly, can also modify the boot image, making it different from the stock image, which is in conjunction with the installation of the root rights manager. TWRP gives the right effect.
- π‘οΈ Download the zip archive patch for your version of Android.
- π² Load into the set. TWRP.
- π Through the Install menu, select the downloaded archive and flash it.
- π Restart the system using the Reboot System button.
Another effective method is to rename the stock image of recovery in the system so that it cannot find it for recovery, but this method requires superuser rights and can be dangerous for beginners. A safer way is to use specialized modules for Magisk that block the use of the OTA-Replacement of Recavers.
What is dm-verity?
Specificity of devices with partitions A/B and encryption
Modern Xiaomi smartphones use an A/B partition scheme that allows you to update in the background. This means that you have two sets of partitions: active and inactive. When installing TWRP, it is important to understand which slot you are writing an image into. If you write only to slot A and the system switches to B, the Recovery will become stock again.
Data Encryption is a particularly acute problem, because stock Android encrypts a data partition, and TWRP cannot read it without a special patch or password, and you will see an empty list of files or a message that the partition is encrypted.
| Parameter | Stock Recovery | TWRP (without patch) | TWRP (with patch) |
|---|---|---|---|
| Access to Data | Full (after password) | Missing (Read-only) | Full (Read/Write) |
| ZIP installation | Just the official firmware. | Possible. | Possible. |
| Verification of signature | On. | Disconnected. | Disconnected. |
| Risk of discharge | Low. | High-pitched | Medium. |
To solve the encryption problem, you often need to format the Data partition (Format Data command and enter the word yes).This action will completely delete all user data, photos and contacts, so be sure to make a backup before you start manipulating.
π‘
Before formatting Data, copy important photos and documents to your computer or the cloud, as it will be impossible to restore them after formatting.
Solving problems and errors in recovery
When returning TWRP, users often encounter errors, and one of the most common is FAILED (remote: device is locked), which means that the bootloader is locked, in which case custom recavator installation is impossible without official unlocking through the Mi Unlock service.
Another common problem is that the device is "bricking" when trying to flash an image from another model. Never use TWRP images intended for other devices, even if the processor names are the same. This can damage the persist or modem partitions, making communication and sensors impossible.
β οΈ Attention: If after installation TWRP phone stopped responding to buttons, try to pinch the combination Volume up + Loudness down + Meals for food 15-20 second-on-seconds.
If TWRP is installed but the touch screen is not working, it means that the recover version is incompatible with the drivers of your Android version, in which case you need to look for a specific TWRP build or an OrangeFox analog adapted specifically for your version of MIUI firmware.
π‘
The main reason for failure is the use of incompatible images and ignoring the A/B partition scheme. Always check compatibility before firmware.