Owning a Xiaomi smartphone is a huge opportunity, not only because of the standard MIUI or HyperOS interface, but also because of the huge community of developers. Many users sooner or later think about expanding the functionality of their device, removing embedded advertising and gaining superuser rights, and for this purpose, custom firmware is created that replaces factory software with a modified version of Android.
The process of replacing the operating system requires careful and strict adherence to the algorithm of actions, since interference in the system partition can lead to the inoperability of the gadget. However, if done correctly, you will get a device with a clean Android system without unnecessary applications, improved autonomy and the latest security versions. In this guide, we will discuss all the steps from unlocking the bootloader to the first boot to the new system.
Before you start taking action, you need to understand the risks and prepare the workplace. You need a stable Internet connection, a good one. USB-cable and computer running Windows, macOS or Linux. The most critical mistake of beginners is interrupting the firmware process or using an unoriginal cable, which can lead to data loss or a brick-in of the device.
Preparation of the device and collection of necessary tools
The beginning of customization is always through careful preparation, you need to download and install specialized software on your computer that will provide communication between the PC and the smartphone, primarily ADB and Fastboot, debugging tools, without which you can not interact with system partitions, and you will need Mi Unlock Tool to officially unlock the bootloader.
In addition to software, you need to take care of the firmware files, and on specialized forums such as 4PDA or XDA Developers, you should find the current version of recovery (most often TWRP) and the firmware itself, adapted specifically for your model.
- π± Xiaomi smartphone with a battery charge of at least 60%
- π» Computer with drivers installed ADB and Fastboot
- π Original or qualitative USB-data-line
- π Downloaded custom firmware and file recaveri (img format)
β οΈ Attention: All actions to install third-party software are performed at your own risk.The author is not responsible for possible data loss or device failure.
Remember to back up all important data, as the process of unlocking the bootloader involves a complete reset of the device, photos, contacts and documents are better transferred in advance to the cloud service or external drive, this is a mandatory step, ignoring which can lead to permanent loss of personal information.
Unlocking the bootloader (Unlock Bootloader)
Bootloader is a program that starts when you turn on your phone and loads the operating system. By default, it is locked in Xiaomi devices, which prevents the installation of unofficial software. To start, you need to link your Mi Account account to the device and obtain permission to unlock through the official security application.
After submitting an application via the Settings β About Phone β All settings β MIUI version (you need to press 7 times) and enabling debugging over USB, you should transfer the phone to Fastboot mode. To do this, the device you need to press with a volume button and connect to the computer. In this mode, a rabbit in a hat-eared will appear on the screen.
Launch the Mi Unlock Tool on your computer and log in to your Mi Account acca. The program will detect the device in Fastboot mode and check the unlock status. If all conditions are met, it will prompt you to unlock the bootloader. The process can take from a few minutes to 168 hours (7 days), depending on Xiaomi's security policy at the time of application.
- π Unlocking removes the warranty from the software part of the device
- β³ The wait can be from 0 to 168 hours.
- π§Ή All data on the phone will be deleted completely.
Once successfully unlocked, the phone will automatically restart and you will see a message that the device is unlocked. From now on, there will be no way back to factory settings without flashing the stock version, since data protection has been reset. Now your Xiaomi is ready to install the modified backup.
Installation of custom TWRP Recovery
The standard recovery menu is limited in features and does not allow you to install third-party zip archives. TWRP (Team Win Recovery Project) is the gold standard custom recovery, providing a touch interface and full access to the file system. To install you will need an image file with the.img extension that matches your model.
Put your smartphone into Fastboot mode (down volume button + cable connection) and connect it to your PC. Open the command line or terminal in the folder with ADB tools. The installation command is as follows:
fastboot flash recovery twrp-name file.imgAn important nuance for Xiaomi devices: after firmware TWRP can not immediately boot into the system, otherwise the stock recavery will overwrite custom. You must immediately press the combination of buttons to enter recovery mode (usually this is the volume button + cable connection or hold the power button after flashing).
βοΈ Checklist before installation TWRP
If you see a TWRP menu with touchscreen controls and a logo, it's a success. In some cases, you may need a decryption patch to be able to see files in internal memory, not just encrypted debris. This is especially true for newer versions of Android 12, 13 and is 14.
Custom firmware installation process
Now that you have a working person TWRP, You can go to the installation of the operating system itself. The firmware file (usually a zip archive) must be copied to the internal memory of the phone or to the computer. SD-In the Recavator menu, select Wipe and format Dalvik partitions / ART Cache, System, Cache and Data.
β οΈ Note: Do not format the Internal Storage section if you store the firmware file in the phoneβs internal memory, otherwise the installer will not be able to find it.
Once the partitions are cleared, go back to the main menu and select Install. Find the firmware zip file and confirm the swipe installation. The process will take a few minutes, during which time the log of the operations performed will be displayed on the screen. If the firmware requires additional components (GApps, Magisk), they should be installed immediately, without restarting the system, through the Add more Zips button.
| Section | Clean installation operation | Risk of error |
|---|---|---|
| Dalvik / ART | Wipe (Cleaning) | Low. |
| System | Wipe (Cleaning) | Medium. |
| Data | Wipe (Cleaning) | High (data loss) |
| Internal Storage | Don't touch it. | Critical (file loss) |
When you have completed installing all the necessary components, press the Reboot System button. The first download can take 5 to 15 minutes, as the system is optimizing applications. If the phone is stuck on the logo for more than 20 minutes, it may be incompatible firmware or was done during partition cleaning.
What to do if the phone goes into a bootloop?
System setting and obtaining Root rights
After a successful download, you will see a clean Android desktop. Castom firmware often does not contain Google services by default (unless it is a version marked GApps), so the first thing you may need to install Google Play Services. For users who want to gain full control of the device, the question of obtaining SuperUser (Root) rights is relevant.
The most modern and secure way to get root access is to use Magisk. The Magisk installer file needs to be downloaded in APK format, rename the extension to ZIP (or select the APK in the TWRP installer if the version allows) and flash through the receptacles. An alternative method is to patch the boot image through the Magisk application on an already running system.
- π‘οΈ Root access allows you to remove system applications
- π¨ Deep customization of the interface and core is possible
- π° Some banking applications may be blocked
Remember, root rights reduce device security, and applications with access to finance may require no system modifications, and Magisk has Zygisk and exception lists to circumvent this limitation, which hide the fact that superuser rights are available from specific applications.
π‘
Use the MagiskHide Props Config module to hide root access from Google Pay banking apps and services.
Possible problems and ways to solve them
The custom firmware world is not without bugs and bugs. Even stable builds can have problems with a particular hardware or configuration. A common problem is a broken VoLTE or camera. In such cases, it is worth checking the firmware developer forum, there are often fixes or patches that fix specific flaws.
If the phone stopped responding to commands and is not in Fastboot mode, it may have gone into the Hard Brick state. For Xiaomi, the rescue is often the Mi Flash Tool utility and the firmware of the stock version through EDL (Emergency Download Mode) mode, which is activated by disassembling the case and closing contacts on the board or special ADB commands.
β οΈ Attention: Entering mode EDL On new models, Xiaomi may require an authorized Mi Flash Pro account, which makes recovery payable through service centers.
Users may also experience the loss of Widevine L1, which will make it impossible to view HD/4K content on streaming services like Netflix, such as flashing devices with MediaTek processors or unlocking the bootloader on some Snapdragon models, which is extremely difficult, if not impossible, to return certification.
π‘
Always keep stock firmware and recovery tools before experimenting β this is your insurance against critical errors.