Modifying Xiaomiโs operating system is a powerful tool for those who want to gain full control of their device. Users often look for ways to bypass the limitations of the standard MIUI or HyperOS shell to introduce new features, improve autonomy, or simply install a pure Android. The process of flashing through a personal computer is considered the most reliable method, since it minimizes the risks of the phone hanging during critical operations.
However, interfering with the system partition requires high concentration and precise algorithm follow-up, and any error when working with the bootloader or partition recovery can turn the smartphone into a โbrickโ. In this material, we will discuss in detail how to safely prepare the gadget, unlock the bootloader and install custom software using only a PC and a computer. USB-cable.
Preparation of equipment and software
Before you start any manipulation, you need to make sure that your computer and smartphone are fully ready for work. You need a stable connection and a set of specialized slits, without which the process is impossible. USB-cable is not just an accessory, but a critical element of the chain; the use of cheap analogues often leads to a communication interruption at the most inopportune time, which is fraught with fatal consequences for the system.
The computer must have Windows installed (versions 10 or 11 provide better driver compatibility), and you will also need to download and install the ADB and Fastboot package, which serves as a bridge between the computer's OS and the phone bootloader mode, without these drivers, the computer simply will not see the device in the desired mode.
The battery charge should be at least 60-70% charged, because the firmware process is energy intensive, and if the phone turns off while it's being stored, it's going to be extremely difficult to recover it even through the engineering port.
โ๏ธ Firmware readiness
Make sure that there is enough free space on your PC hard drive and antivirus software does not block the system utilities. Sometimes Windows defenders mistakenly label tools for working with the bootloader as a threat, so it is better to temporarily disable them during the procedure.
Unlocking the Bootloader bootloader
The first and mandatory step is to unlock the bootloader. Xiaomi specifically restricts access to the system partition for security purposes, so standard custom recavator installation is impossible without this step. First, you need to link your Mi Account account to the device in the developer settings menu.
Once tied, youโll have to wait 7 to 168 hours (depending on your region and account status), which is the time it takes for the companyโs servers to verify the request. After the wait period, you can run the Mi Unlock Tool on your computer, put your smartphone into Fastboot mode (clamp down volume and power buttons) and unlock it.
โ ๏ธ Warning: The bootloader unlock process automatically performs a full Wipe Data reset. All photos, contacts and apps will be deleted, so back up important information in advance.
It is important to understand that once unlocked, some security features, such as Google Pay or banking apps, may stop working as standard, and that restoring them will require additional root rights manipulation or concealment of system modifications.
Why is Xiaomi introducing wait?
Installation of custom TWRP Recovery
The Recovery Recovery Recovery Recovery Menu is a trimmed-down service that doesn't allow third-party firmware installations, and uses TWRP, the most popular custom environment, to make full partition backups, clear cache, and install zip archives with modifications.
The installation process is as follows: the downloaded image.img is renamed to twrp.img And it's put in a tool folder. ADB. The phone is then switched to Fastboot mode and a command is executed via the command line to fastboot flash recovery. twrp.img. Immediately after that, you need to pinch the button combination to enter the recovery menu to prevent the system from rebooting to standard mode.
๐ก
Use the fastboot boot twrp.img command to temporarily run the TWRP without writing to memory, which will allow you to check the performance of the Recovery before it is permanently installed.
Some new models with dynamic partitions may have different procedures, requiring both slots (A and B) to be installed at once, or special installer scripts that are tailored to a particular Snapdragon or MediaTek processor model.
Custom firmware installation process
Once a TWRP is successfully installed, you can move to the main part, the operating system installation. The firmware file (usually a.zip archive) must be copied to the phone's internal memory or to the connected microSD card. Launch the recovery menu, select Install, and specify the path to the file.
A critical step is Wipe Cleanup, which requires either Full Wipe or Format Data to be installed before installing a new system to remove the remnants of the old firmware and avoid file conflicts, and skipping this step often leads to an endless bootloop or unstable touchscreen.
| Type of cleaning | What's removed | When to apply |
|---|---|---|
| Dalvik / ART Cache | Cash compilation applications | When updating the firmware version |
| Cache | System cache | With each update |
| Data | All user data | When changing the firmware type (from MIUI to AOSP) |
| System | Operating system files | With complete flashing of the device |
Once you have selected the firmware file, swipe it, confirm the action, take 2 to 10 minutes, depending on the memory rate and system size, and you will see progress in the installation log; Successful signifies successful completion.
Don't interrupt the process or turn off the cable until the progress indicator reaches 100%. Even if it seems that the phone is getting stuck, wait a few minutes - writing large amounts of data can take time.
Install Google Apps and Root Rights
Many custom firmware, especially based on AOSP (Android Open Source Project, which comes without Google services preinstalled, requires you to install GApps immediately after you have installed the Play Market, YouTube and maps without restarting the system. Select the version that matches your firmwareโs Android version (like Android 13 or 14) and processor architecture (usually). arm64).
For users who need full access to the system, setting superuser rights is relevant. Today, the de facto standard is Magisk. The Magisk installer file is also stitched through the Install menu in TWRP immediately after the main firmware and GApps.
โ ๏ธ Attention: Rootright installation can disrupt high-security applications (banks, government services) and be prepared for the additional root hiding configuration required to operate them.
The TWRP procedure must be strictly followed: first, the OS firmware, then GApps, then Magisk, and only at the very end, clearing the Dalvik/ART cache and restarting. Sequence disruption can lead to rights not being applied or Google services not working properly.
Possible errors and methods of their elimination
Even with the exact instructions, there can be unexpected situations. One of the most common problems is Bootloop. If the phone is constantly rebooting, try logging in to TWRP and running Wipe Data again, making sure the formatting was successful.
If your computer stopped seeing your phone in Fastboot mode, the problem could be in the drivers. USB-switch the device to another port (preferably) USB 2.0) or reinstall Qualcomm or MediaTek drivers manually through Device Manager.
๐ก
90% of problems with firmware are associated with poor quality USB-cable or battery failure, use only proven accessories.
In the case of critical errors, when TWRP does not start, you may need to return to the stock firmware through EDL (Emergency Download Mode) mode, which allows you to restore the phone even when the bootloader is damaged, but it often requires disassembling the device to close contacts on the board or having an authorized Mi Account.