Many Xiaomi smartphone users sooner or later face limitations of standard firmware MIUI or HyperOS. Built-in recovery menu, known as Stock Recovery, allows you to reset to factory or update the system through the official package. However, for full file system management, install custom firmware like Pixel Experience or LineageOS, as well as to create full backups, you need advanced functionality that provides modified recoveries.
The process of accessing the TWRP (Team Win Recovery Project) environment on Chinese brand devices requires not only the installation of the image itself, but also the pre-unlocking of the Bootloader. This is a critical step that makes it possible to make changes to the system partition. Without the unlocked bootloader, any attempts to sew through third-party software will lead to a signature verification error, and the phone will simply refuse to download the modified components.
In this guide, we will go through all the steps from tool preparation and obtaining rights to directly logging into the recovery menu. It is important to understand that unlocking a bootloader on Xiaomi is officially possible only after waiting 168 hours (7 days) from the moment you associate your Mi Account in the developer settings. Violation of the sequence of actions or interruption of the firmware process can lead to a software failure, so carefully follow each step of the instructions.
Preparation of a smartphone and tools
Before you start technical manipulation, you need to ensure a stable connection between the computer and the mobile device. USB-cable, preferably original, which comes with a complete, or certified analogue, capable of transmitting data, and not only charging the battery. Also make sure that the battery is at least 60%, as the unlocking and firmware process may take time and a sudden power outage is unacceptable.
On a Windows computer, you need to install the current ADB and Fastboot drivers. These components allow the operating system to recognize the phone in a special debugging mode. There are several ways to install them: you can download the official Platform Tools from Google's site or use ready-made driver assemblies such as Minimal ADB and Fastboot. Once you install the drivers, check their work by connecting the phone in debugging mode.
โ๏ธ Verification of readiness for modification
Special attention should be paid to backup. The bootloader unlock procedure completely cleans the internal memory of the device. All photos, contacts, messages and installed applications will be permanently deleted. Use the built-in MIUI tools to create a cloud copy or copy important files to an external hard drive. Once you return from Fastboot mode, it will be impossible to recover data from the cloud without a prior backup.
Unlocking the Bootloader bootloader
The first and most time-consuming step is to unlock the bootloader, and to do that, you need to activate the developer mode on your smartphone. โ On the phone and press quickly 7-10 once-point version MIUI (or OS), until you get a notification that you've become a developer. โ For developers, it is necessary to include the paragraphs โDebugging by USBยป and โUnlocking the loaderยป.
The bootloader unlock menu will require you to link the device to your Mi Account. Make sure the phone is installed SIM-A card with active mobile internet, because Wi-Fi may not be suitable for this procedure, and once linked successfully, the system will issue a warning that it must wait, which is usually 168 hours, but in some cases can be extended to 30 days for security reasons.
โ ๏ธ Warning: Do not try to reset or reflash your phone while you are waiting, otherwise the timer will reset and the binding procedure will have to start again. SMS, If you do not have access to this SIM-card, otherwise logging into the account on the PC will be difficult.
After the wait period, download the official Mi Unlock Tool to your computer. Launch the program, log in to your Mi Account and put the smartphone into Fastboot mode. To do this, you need to pinch the device turned off with a combination of Volume Down + Power keys. Connect the phone to your PC and press the Unlock button in the program. The process will take a few minutes, after which the device will restart and be cleaned.
What if the Mi Unlock Tool is 99% locked?
Find and download a compatible version of TWRP
After successful unlocking, you can proceed to search for the image of the Recaveri. TWRP It is not a universal solution for all models; every Xiaomi, Redmi or smartphone is not a universal solution. POCO It requires a strictly defined version that matches its hardware platform (Snapdragon or MediaTek processor), and using an image from another model is guaranteed to lead to a โbrickโ of the device, which will have to be restored through the device. EDL-pay-account.
The official website of the project twrp.me contains a database of supported devices. However, for popular Xiaomi models, informal builds on the 4PDA or XDA Developers forums are often more relevant. You need to look for a file with the.img extension. Also, some new devices with data encryption may require a special version of TWRP with support for a specific type of encryption, otherwise you will not be able to access internal memory after installation.
Rename the downloaded file to twrp.img for convenience and place it in the root folder on the computer where the ADB tools are installed. This will make it easier to enter commands into the console. Make sure the file is not corrupted when downloaded - its size is usually between 30 and 60 MB. If the file weighs several kilobytes, you downloaded the text description, not the image itself.
Install Recovery Image via Fastboot
To install the modified recavator, you need to reset the smartphone to Fastboot mode. Connect it to your computer and open the command prompt (CMD) or PowerShell in the folder with the ADB tools. Enter the command fastboot devices to make sure that the computer sees the device.
Next, the firmware command is executed. The syntax is as follows:
fastboot flash recovery twrp.imgOnce the command is successfully executed, the console will receive a Finished message indicating the time spent. However, you can not rush to restart. The standard MIUI boot procedure at start checks the integrity of the recovery partition and, when it detects changes, automatically replaces TWRP back to stock Recovery.
To prevent this replacement, you need to immediately after firmware execute the command to restart directly in recovery mode, bypassing the usual OS boot:
fastboot reboot recoveryIf you did all the actions correctly, the TWRP interface will appear on the smartphone screen. If the phone went into the usual MIUI boot, then the procedure failed, and the partition was overwritten by the system, in which case the procedure with the command fastboot flash and immediately switch to recovery will have to be repeated.
๐ก
After installation TWRP phone reboots into MIUI, Try the "fastboot boot" command. twrp.img". It'll run the Recovery temporarily, without a memory record, so it'll back up the stock Recovery or flash it. ZIP-archive TWRP-installer already inside the recovery menu, which more reliably fixes the result.
Navigation and basic features of the TWRP menu
Team Win Recovery Project's interface is very different from the stock interface and is sharpened to handle the sensor. The main buttons are large and intuitive. The top of the screen usually displays the current time and battery status. When you first start, the system can request confirmation of the system modification โ move the Swipe to Allow Modifications slider to allow for changes. Without this step, TWRP may not give access to some functions.
One of the main features is the Backup section, where you can immediately create a full copy of your current system (Boot, System, Data, Vendor sections), a lifeline that will return your phone to working condition if your firmware experiments go wrong, and you can also use a formatted reset on the Wipe menu, including cleaning Dalvik Cache and Android, which is necessary before installing custom firmware.
| Section | Function | Description of action |
|---|---|---|
| Install | Installation | Choice ZIP-Firmware file, Magisk patch or modifications for installation. |
| Wipe | Cleanup | Data reset, partition formatting (Data, Cache, Dalvik). |
| Backup | backup | Create a full copy of the current firmware for recovery. |
| Reboot | Reboot. | System, Recovery or Bootloader mode. |
Accessing phone files via computer to TWRP support implemented MTP. When connecting the cable, the device will be defined as a drive, and you will be able to copy the necessary ZIP-archives (firmware, cores, patches) in internal memory or on SD-It eliminates the need to use the map. ADB Sideload for file transfer, although Sideload is also available in the Advanced menu for advanced users.
Decision and possible errors
Owners of Xiaomi devices often face the problem of data encryption. Once installed, the TWRP partition Data can appear as empty or inaccessible (0MB). This is because the encryption keys of stock MIUI are incompatible with the keys of the custom recovery. To solve this problem, you need to perform format data by entering the word yes in the corresponding Wipe menu.
โ ๏ธ Note: After formatting Data and switching to custom recapaveri, return to stock firmware through OTA-Updating may not be possible without completely reflashing MiFlash, and some banking apps and Google Pay (Wallet) will stop working due to system integrity breaches until you install Magisk's patch to hide root rights.
Another common mistake is Error. 7 When you install firmware, it happens when you try to install it. ZIP-archive that is not intended for your model, or if the version of Android in the archive does not match the current database.Always check file compatibility before installing.Also make sure you are using the correct version TWRP: Android 11/12/13 Different recovery assemblies may be required with the corresponding core patches.
๐ก
The main difficulty when working with TWRP on Xiaomi is not the installation itself, but bypassing the mechanisms of protection of the bootloader and data encryption. Success depends on strict adherence to the procedure and use of files designed specifically for your device model.
If the phone went into a cyclic reboot after installing the modifications, don't panic. Go to TWRP, select the Wipe partition and make Advanced Wipe for the Dalvik, Cache and Data partitions. If that didn't work, you can try flashing the original backup you made earlier through the Install menu, or reflash the system clean by downloading the stable version of ROM beforehand.