How to Sweeten Xiaomi through TWRP: a detailed guide

Installing custom firmware through TWRP Recovery opens up unlimited customization options for Xiaomi, a method that not only allows you to install a pure Android, but also allows you to obtain super-user rights, remove system debris and even run the operating system on devices that are no longer officially supported.

Before you start, you need to clearly understand what you are doing and why. Xiaomi provides quite flexible tools for enthusiasts, but the standard procedure blocks the bootloader for security reasons. For successful firmware through TWRP, you must pre-unlock the bootloader through the official Mi Unlock website. Without this step, any attempts to write to the system partition will be blocked.

This guide describes a universal action algorithm applicable to most of the brandโ€™s models, from the old Redmi to the new Mi series flagships. We will look at tool preparation, the flashing process and solving typical problems.

Preparation of tools and files

The foundation of successful firmware is careful preparation of the workplace. You will need a personal computer with Windows operating system (less often Linux or macOS), a serviceable computer. USB-cable and smartphone with a battery charge of at least 60%, you also need to download the archive with platform tools. ADB and Fastboot, without which interaction with the device in bootloader mode is impossible.

Special attention should be paid to the choice of firmware itself. Files should be in.zip format and strictly conform to the model of your device. Using the wrong image can lead to inoperability of the sensor, camera or complete loss of communication. It is recommended to download software only from trusted sources, such as 4PDA or XDA Developers.

๐Ÿ’ก

Use the original. USB-Cheap charging cables often don't support data transmission, which will interrupt the firmware process at a critical stage.

Once you have downloaded all the files, create a separate folder on the root of the C disk so that the paths to them are short and Cyrillic-free, which will eliminate potential errors when you type commands into the console. Copy the firmware archives and TWRP into the same directory for easy access.

Unlocking the Bootloader bootloader

The most difficult and longest step is to unblock the bootloader. Mi Unlock Tool is the official utility that links the Xiaomi account to the device. SIM-map, enable mobile Internet and in the menu Settings โ†’ Advanced settings โ†’ For developers to activate the items "Factory unlocking" and "Debugging by USB".

Once you have accauenta, you have to wait a certain period, which is usually between 7 and 168 hours, which is a security measure that the manufacturer has put in place to protect users' data, during which time you can't log out of your phone account or reset your settings.

What to do if the timer is not going?
Sometimes the timer in the Mi Unlock app freezes. Try switching the internet from Wi-Fi to the mobile network, turning off the phone, turning it back on, and running the status check in the app.

When the wait time is up, put your smartphone into Fastboot mode, holding down the volume and power buttons at the same time. Connect the device to your PC, launch the unlock utility and press the Unlock button. The process will take a few minutes, after which the phone will automatically restart and clear all data.

Installation of TWRP Recovery on Xiaomi

Once successfully unlocked, you can move on to installing a custom recavery. twrp.img For your model, place it in a folder with ADB-Open the command line in this folder and type a command to go to bootloader mode:

adb reboot bootloader

After making sure that the phone is determined by the fastboot device command, follow the firmware command:

fastboot flash recovery twrp.img

โ˜‘๏ธ Checklist before installation TWRP

Done: 0 / 5

An important nuance: immediately after you type in the firmware command, you need to put the device in Recovery mode, and on many Xiaomi models, this is done by a combination of Volume Up + Power. If you do not, the regular Android system will overwrite the TWRP back to the stock recavereator on the first run.

The process of installing firmware through the TWRP menu

Once youโ€™re on the TWRP menu, select the interface language (usually available in English or Russian if youโ€™re russifier-plugged). Next, clear the partitions to avoid conflicts between the old and new system. Go to Wipe and select Advanced Wipe.

In the list of sections, mark Dalvik / ART Cache, Cache, System and Data. Internal Storage and USB-OTG sections can not be touched if you plan to borrow firmware from internal memory.

โš ๏ธ Note: Do not clear the Internal Storage if the firmware file is in the phone's internal memory, otherwise you will delete the installation archive and will not be able to complete the procedure.

Now go to the Install menu. Find the previously copied zip archive with firmware. You can configure additional settings before confirming the installation, such as disabling signature verification. Click on the Swipe to confirm Flash slider and wait for the installation to end.

Comparison of device firmware methods

There are several ways to update or restore Xiaomi software, depending on the state of the device and the userโ€™s goals, and the following is a comparison of the main approaches to system modification.

MethodDifficultyRisk of data lossNecessary rights
OTA UpdateLow.No.Not necessary.
Recovery (updater)MediumNo (usually)Not necessary.
Fastboot (MiFlash)Tall.Yeah (full clean-up)Unlocking BL
TWRP (Custom ROM)Tall.Yeah (full clean-up)Unlocking BL

The TWRP method is the most flexible, as it allows you to install modified versions of Android that are not officially supported by the manufacturer, while using Fastboot with MiFlash utility is preferable if you want to return the device to a fully stocked state for sale or warranty service.

๐Ÿ’ก

For everyday use and new Android features on older devices, TWRP is the best solution, giving you full control of the file system.

Possible mistakes and ways to solve them

There may be various bugs in the firmware process, most often due to version incompatibility or file corruption. If the installation is interrupted with an Error 7 or Status 1 error, then the install script cannot find the required partitions. TWRP lateral.

If your phone goes into an endless bootloop, try running Wipe Data/Factory Reset right from the Recovery menu. Sometimes cleaning the Dalvik Cache format helps. In critical situations, when the device does not respond to buttons, you will have to use EDL (Emergency Download Mode) mode for deep firmware.

๐Ÿ“Š What is Xiaomiโ€™s most difficult firmware stage for you?
Unlocking the loader
Finding the right firmware
Installation of ADB drivers
Working with the command line
It went smoothly.

Remember that custom firmware can have bugs. Always read a topic on the forum before installing it where the developer points out known problems, such as a broken VoLTE or (fingerprint scanner), which will help avoid disappointment after a long installation process.

FAQ: Frequently Asked Questions

Will the warranty be reset after firmware is run through TWRP?
Technically, software modification and unlocking the bootloader are grounds for denial of warranty service. However, you can always return the stock firmware and lock the bootloader back through Mi Flash in "Clean all and lock" mode, making the software traces of the interference invisible.
Can I update through OTA after installing custom firmware?
No, standard. OTA-Xiaomi updates wonโ€™t work on modified systems.Youโ€™ll have to download the full archive of the new firmware version and install it manually through the new software. TWRP, repeat the cleaning and installation process.
Is it safe to use bank apps on a stitched phone?
By default, banksโ€™ apps may not work due to root rights and unlocked bootloaders, but using Magic Hide, you can hide these changes from Google Payโ€™s banking apps and services, restoring their functionality.
What if TWRP doesnโ€™t see internal memory?
This happens if the firmware encrypts the data partition, and the TWRP doesn't have a decryption key, and the solution is to format the data in the Wipe menu by entering the word "yes," which will delete all the files, but make the memory available.