Reflashing a Xiaomi smartphone via TWRP (Team Win Recovery Project) is one of the most popular ways to install custom firmware, cores or modified versions of MIUI. This method gives the user complete control over the system, allowing you to bypass the limitations of stock software, install informal updates or even restore bricks after unsuccessful experiments.
Unlike the standard Settings β About Phone β System Upgrade, TWRP firmware involves working with an unlocked bootloader, installing a third-party backup and manually downloading files. This is not an official method, so Xiaomi is not responsible for the possible consequences, but this approach opens up access to functions that are not in stock firmware: from removing embedded software to installing Google Camera with full functionality.
In this article, we will go into detail about the entire process, from preparing the device to the final configuration after the firmware, and focus on the typical errors that beginners make and how to avoid them. If you have never worked with ADB, Fastboot or TWRP, donβt worry: the manual is adapted for users of all levels.
1. Preparation of the smartphone: unlocking the bootloader
The first and most critical step is to unlock the bootloader, without which installing TWRP or custom firmware is impossible. Xiaomi officially allows you to unlock the bootloader, but the process takes time and meets several conditions:
- π± The device must be linked to your Mi Account (required to have a confirmed phone number).
- π On the smartphone should be included debugging on USB (Settings β The phone. β Version. MIUI β 7 times to tap, then additional settings β For developers β Debugging by USB).
- π Unlocking is possible only through the official Mi Unlock Tool (you can download it on the Xiaomi website).
- β³ After linking an account to a device, you need to wait 7 days (for new accounts) or 30 days (if the account was created less than 30 days ago).
The process of unlocking looks like this:
- Download and install Mi Unlock Tool on PC (Windows only).
- Launch the utility on behalf of the administrator and log in to your Mi Account.
- Connect your smartphone in Fastboot mode (turn off the device, then press Volume Down + Power).
- In the utility, press Unlock and wait for the process to complete (usually takes 1-2 minutes).
β οΈ Warning: Once the bootloader is unlocked, the smartphone will reset to factory settings. All data, including photos, contacts and apps, will be deleted without recovery. Backup in advance via Settings β Additional settings β Backup and Reset or Mi Cloud.
2. Install TWRP Recovery on Xiaomi
Once the bootloader is unlocked, you can start installing TWRP. This custom recavery will replace the standard MIUI recovery and allow you to install firmware, make backups and manage memory partitions. It is important to choose the right version of TWRP for your Xiaomi model - there are no universal builds!
A list of officially supported devices and current versions of TWRP can be found at twrp.me. For example, the Redmi Note 10 Pro (sweet) and Poco X3 Pro (vayu) use different builds. If your model is not on the list, look for unofficial ports on the XDA Developers or 4PDA forums.
Installation instructions:
- Download the.img file from TWRP for your model.
- Connect your smartphone to your PC in Fastboot mode (as when unlocking the bootloader).
- Open the command line (CMD) In the folder from fastboot and type the command: fastboot flash recovery twrp-3.7.0_12-0-sweet.img (substitute twrp-3.7.0_12-0-sweet.img in the name of your file).
- After successful installation, restart to TWRP, holding Volume Up + Power.
β οΈ Note: Some Xiaomi models (e.g. Redmi Note 8 Pro on Mediatek) require additional manipulation of the preloader partition or the use of patches to bypass protection. TWRP The smartphone does not load, check the current discussions on the 4PDA β They often provide solutions for specific devices.
βοΈ Preparation for installation TWRP
3. Backup (backup) creation in TWRP
Before you run your firmware, make sure to make a full backup of your current system. This will save your data if something goes wrong. TWRP allows you to save images of all partitions, including boot, system, data and vendor. Backup takes up a lot of space (usually 4-8 GB), so make sure that there is enough free space on the memory card or outside the memory.
How to make a backup:
- In the main TWRP menu, select Backup.
- Check the boxes: Boot, System, Data, Vendor (the rest can be skipped).
- Select a place of preservation (better to save) SD-map, if there is one).
- Swipe to start building the backup. 10-20 minute.
The saved backup can be restored at any time through the same Restore section in TWRP. If the smartphone does not boot after firmware, the backup is your only chance to return to work without losing data.
What if the backup is not created?
4. Selection and download of firmware for Xiaomi
Now you have to choose which firmware you want to install.
- π¦ Official. MIUI (Xiaomi stock firmware β suitable if you want to return the smartphone to the βfactoryβ state or upgrade to the latest version without waiting OTA.
- π§ Base-based castor firmware AOSP (LineageOS, Pixel Experience, Havoc-OS β give a βpureβ Android without a shell MIUI.
- β‘ Modified MIUI (for example, MIUI EU, MIUI Pro) β stock firmware without Chinese applications and with additional features.
- π οΈ Cores and patches (e.g. KernelSU for root rights) β installed on top of the main firmware.
Where to download:
| Type of firmware | Source | Example of model |
|---|---|---|
| Official MIUI | Official Xiaomi website | Redmi Note 11 Pro+ 5G (veux) |
| MIUI EU (no bloat) | Xiaomi.eu | Poco F4 GT (ingres) |
| LineageOS | LineageOS Downloads | Redmi Note 10 (mojito) |
| Pixel Experience | Pixel Experience | Poco X3 NFC (surya) |
Before downloading, check:
- π Compatibility of the firmware with the code name of your device (for example, Redmi Note 9 Pro is joyeuse, not curtana).
- π Build Date β Older versions may contain vulnerabilities.
- π Installation instructions (some firmware requires pre-cleaning of partitions).
π‘
If you are installing custom firmware for the first time, choose builds marked Stable or Official. Experimental versions (Beta, Nightly) may contain critical bugs.
5. The firmware process through TWRP: step-by-step instruction
When the firmware is downloaded and transferred to the smartphone (best for the SD-So, the map or the internal memory, you can start the installation:
- Boot to TWRP (hold Volume Up + Power when turned on).
- If the firmware is in.zip format, select Install, find the file and swipe for confirmation.
- For firmware in.img format (such as kernels), use Install β Install Image and select the appropriate section (boot, vendor_boot etc.).
- Once installed, run Wipe β Format Data (if required for your firmware) and restart.
Features for different types of firmware:
- π Official. MIUI: It does not usually require Format Data, but may require cache cleaning (Wipe) β Advanced Wipe β Dalvik / ART Cache, Cache).
- π§ Custom firmware (AOSP): Almost always need a complete data cleanup, otherwise there may be hang-ups and errors.
- β‘ MIUI EU: Sometimes you need to install before installation. fw_vendor (firmware file for the vendor section).
If you've got a smartphone stuck on the MI or Fastboot logo after you've run it, then something's gone wrong.
- Return to TWRP (Hold Volume Up + Power When Downloading).
- Try repeating the firmware or restoring the backup.
- If there is no backup, run the official MIUI through Fastboot (the instructions are on the Xiaomi website).
π‘
Never install firmware from other models, even if they are "similar." For example, the firmware for the Redmi Note 10 (mojito) will not work for the Redmi Note 10S (rosemary) - this is a guaranteed "brick".
6.Setting up the system after firmware
If the firmware is successful and the smartphone is loading, congratulations, but the work is not finished.
- Initial setup: Go through the initial setup process (selecting language, connecting to Wi-Fi, logging in to your Google/Mi Account).
- Functionality Check: Make sure the basic functions are working: πΆ Mobile network and calls. π· Camera (sometimes drivers need to be installed). π Sound and speakers. π Charging and determining the level of the battery.
Installation of Magisk (optional):
Magisk
.zip
TWRP
Data recovery:
TWRP
Typical problems after firmware and their solution:
| Problem. | Possible cause | Decision |
|---|---|---|
| The mobile network is not working | There is no IMEI or incorrect APN settings | Check it out. IMEI *#06#, if necessary, to re-establish QCN-file |
| Smartphone overheating | Incompatible core or background processes | Swipe another core or reset the settings |
| Google Pay is not working. | Installed by Magisk or modified boot | Hide the route via MagiskHide or flash Universal SafetyNet Fix |
If you have installed custom firmware based on AOSP, note that some MIUI features may not be available, such as:
- π No built-in ultrafast charging mode (single modules must be installed).
- πΈ There is no firmware for a wide-angle camera (solved by installing GCam with the correct config).
- π No uniformity of the sound Mi Sound Enhancer (can be replaced by a new one) ViPER4Android).
7.Typical mistakes and how to avoid them
Even experienced users sometimes make firmware errors through TWRP, and here are the most common ones and ways to prevent them:
- π« Firmware of the wrong version: For example, an attempt to install MIUI 14 for Redmi Note 9 on Redmi Note 9S. Always check the code name of the device through fastboot getvar product.
- π Interrupting: If your smartphone shuts off your PC or dies during firmware, you run a high risk of getting a brick. Charge your device at least 80% and use the original one. USB-cable.
- π Skip Format Data step: For custom firmware, this almost always leads to endless downloads. Always read the instructions for a specific build!
- π Locking the bootloader after firmware: On some models (for example, Xiaomi 12) after installing the unofficial firmware, the bootloader can lock. MIUI via Fastboot and repeat the unlock.
If your smartphone stops turning on (the "brick"), don't panic. In 90% of cases, it can be restored:
- Try booting up to Fastboot (Loudness Down + Power) and flashing the official firmware through the Mi Flash Tool.
- If the Fastboot is not responding, check if the device is detected in EDL-mode (needs a special cable or testpoints).
- In extreme cases, contact the service center β many workshops restore Xiaomi even after a βhardβ brick.
π‘
Before the firmware save the file persist.img backup TWRP. It contains unique device data (IMEI, MAC-Addresses, etc., which can be lost in case of a failed firmware.