Modern Xiaomi smartphones offer users a wide range of customization options, but standard functionality is often limited. Installing a custom TWRP (Team Win Recovery Project) recapture system allows access to full file system management, full backups, and modified firmware installation, a process that requires careful attention because interfering with the system partition carries certain risks.
Before you start taking action, you need to be clear that unlocking the bootloader is a mandatory first step, without which further manipulation is impossible. The standard procedure from the manufacturer takes from 7 to 168 hours of waiting after submitting a request, ignoring this rule will only lead to errors when trying to write an image to the recovery section.
In this guide, we will look at current methods of installation via a computer using the Fastboot platform. You will learn how to properly prepare the device, avoid common driver errors and successfully run a modified recovery environment on your gadget.
Preparation of the device and necessary tools
The foundation of successful modification is the proper preparation of the workplace and software. You need a computer running Windows, Linux or macOS, a good one. USB-cable and the smartphone itself with a charged battery of at least 60%. ADB Fastboot tools, as older versions may not work properly with new Android security protocols.
You also need to download a specific twrp.img image file that is specifically for your model. Using universal files or images from other devices can lead to the "bricking" of the gadget.
βοΈ Checklist before start
Remember to make a full backup of all important data, as the process of unlocking the bootloader will inevitably lead to the complete removal of information from the internal drive.
Unlocking the Bootloader bootloader
The unlocking procedure is the gateway to obtaining superuser rights and installing third-party software. First, you need to activate the developer mode by clicking on the build number several times in the About Phone menu. USB-Debugging and Unlocking the Loader.
β οΈ Warning: Once unlock is enabled, the system will require you to link your Mi Account to your device, and from that point, the waiting time countdown begins, which can last up to a week.
To directly unlock, the official Mi Unlock Tool is used. Transfer the phone to Fastboot mode, holding the power and volume buttons at the same time, and connect it to the PC. The program will check the status of the device and, if the waiting period has expired, perform a reset.
What if Mi Unlock canβt see the phone?
It's important to understand that after this procedure, the encryption will be reset and the phone will return to factory settings, a security measure that prevents malicious users from accessing your data in the event of a device being stolen.
Installation of drivers and setting up ADB
Communication between the computer and the smartphone is via the debugging protocol. If the drivers are installed incorrectly, console commands will not be executed. Windows Device Manager, when connecting the phone in debugging mode, should display the Android ADB Interface device, and in Fastboot mode, Android Bootloader Interface.
To check the connection, open the command line in the tool folder and enter the status check command:
adb devicesYou'll see a request on your smartphone screen for debugging permission from that computer, you'll need to confirm the action, and then the console will display the serial number of the device, and if the number is not authorized, you've not received permission or the drivers are not working correctly.
A common problem is the conflicting versions of platform tools. Make sure you use the latest version of SDK Platform Tools, as older versions may not support the new hashing algorithms used in MIUI 14 or HyperOS.
The process of installing TWRP via Fastboot
Now, to the most critical stage, put your smartphone into Fastboot mode by squeezing down the power and volume buttons, connect the device to your computer, and make sure that the command line displays the status of the device when you type in the fastboot device command.
The flash command is used to record the recovery image. However, to prevent the TWRP from being overwritten by the system at the first boot, it is recommended to use the temporary boot method or immediately after the firmware is installed, the command to record is as follows:
fastboot flash recovery twrp.imgOnce you've successfully completed a command (Finished will appear), you need to quickly press the button combination to enter the Recovery. Usually this is a power and volume button. Hold them until the TWRP logo appears.
π‘
The main feature of the installation on Xiaomi is the need to immediately log into TWRP after firmware, otherwise the standard MIUI will overwrite the modified recovery partition back to stock.
If you missed the login and the phone booted into the normal system, you'll have to repeat the flash procedure. This is normal behavior of the system's defenses, not a mistake of your actions.
TWRP Configurement and Prevent Overwriting
Once you've logged in successfully, you'll see the custom recavator interface, and the first thing you need to do is allow modifications to the system partition by moving the slider at the bottom of the screen, and without that, you won't be able to install files or backup.
The next critical step is to install a patch to prevent the return of the stock backup. Devices with dm-verity encryption often require formatting the Data partition. In the Wipe menu, select Format Data and type in yes. This will delete all data, but it is necessary for the TWRP to work correctly.
| Action. | TWRP menu | The result |
|---|---|---|
| Permission of modifications | Main screen (Swipe) | Access to recording functions |
| Resetting encryption | Wipe -> Format Data | Password and encryption removal |
| Installation of the patch | Install -> Select Zip | Save TWRP after rebooting |
| Reboot. | Reboot -> System | Launch Android with root rights (if any) |
To consolidate the result is often required to establish ZIP-patch-box Disable_Dm-Verity Or similar to your version of Android, it's done through the Install button inside. TWRP, Selecting a pre-downloaded archive from a memory card or internal memory.
Possible mistakes and ways to solve them
During the modification process, users often encounter a Failed to boot boot loader error or cyclic reboot, which may mean that the TWRP version is incompatible with the Android version or damage to the boot partition, in which case you need to return the stock firmware through the Mi Flash Tool.
β οΈ Attention: If after installation TWRP phone stopped seeing SIM-The map or the camera is not working is probably damaged modem or persist partition.
Also a common problem is the inability to connect to a PC inside TWRP. Make sure that the settings of the recover (Settings) activated the item Use MTP or Enable MTP. Without this, the computer will not see the file system of the phone to transfer files.
π‘
Save a copy of the persist partition immediately after unlocking the bootloader, a unique sensor calibration identifier that is difficult to recover without special equipment.
If you encounter error 7 error during installation ZIP-In the archives, this means that the installation script cannot find the updater-binary file. Use current versions of the archives adapted to the new Updater script structure in Android 10 and higher.