How to put on Xiaomi pure Android: replacing MIUI with global firmware

Many Xiaomi smartphone owners, faced with an abundance of advertising, pre-installed garbage and aggressive optimization of MIUI or HyperOS, are thinking about switching to pure Android. This desire is understandable: a naked operating system runs faster, consumes fewer resources and gives the user full control over the device without unnecessary restrictions. However, the process of replacing the branded shell with a stock version requires a deep understanding of the Android architecture and risk preparedness.

Before you start taking action, you need to realize that Xiaomi does not provide official tools for installing third-party firmware.You will have to unlock the bootloader, which automatically cancels the warranty on the device in most service centers.In addition, replacing the system software can lead to the failure of banking applications unless special measures are taken to hide root rights and modifications of the system.

In this guide, we will take a look at all the steps in the transformation of your smartphone, not only at the technical aspects of flashing, but also at alternative, safer ways to clean up your system from garbage.

Preparation for flashing and unlocking the loader

The first and most critical step is unlocking the bootloader. Without this step, installing any custom firmware or even an official Global ROM on a Chinese device will be impossible. First, you need to register your Mi Account account and link it to the device through the settings menu, and then you need to download the official Mi Unlock Tool utility to your computer.

The waiting process is often a stumbling block for beginners. After applying for unlock, Xiaomiโ€™s security system may require waiting from 7 to 168 hours. During this period, it is strictly forbidden to leave your account on your phone or reset the settings, otherwise the timer will reset. Only after the successful expiration of the timer, the utility will allow you to unlock the device, completely clearing its internal memory.

โš ๏ธ Warning: Once the bootloader is unlocked, Androidโ€™s Verified Boot security system will mark the launch of the OS with a warning.This is normal for modified devices, but some banking applications may not work.

To successfully complete the preparation phase, make sure that the following conditions are met:

  • ๐Ÿ”‹ The battery charge of the smartphone is at least 60% so that the device does not turn off at a critical moment.
  • ๐Ÿ’พ All important data is copied to an external carrier, as the phone will be completely cleaned.
  • ๐Ÿ”Œ Used by the original USB-cable USB 2.0 on a computer.
  • ๐ŸŒ Current drivers installed ADB and Fastboot in Windows.

โ˜‘๏ธ Checklist before unlocking

Done: 0 / 1

It is important to understand that unlocking is a point of no return for warranty. If hardware problems arise in the future, the official service may refuse free repairs, citing software interference. So weigh the pros and cons before you type in the unlock command.

Firmware Choice: Global ROM vs Custom ROM

When the bootloader is unlocked, the user has a choice: install the official global firmware (Global). ROM) or third-party custom assembly (Custom) ROM). Global ROM โ€” This is the official version of Xiaomi's software, adapted for the international market, and it already has Google services, Russian, and no Chinese software, but the shell. MIUI/HyperOS It remains with all its features.

Custom ROMs (like LineageOS, Pixel Experience, ArrowOS) are enthusiastic projects that offer the same โ€œpure Androidโ€ that is similar to what Google Pixel smartphones offer.

Custom firmware, however, has its drawbacks: Stock builds often shoot worse than the original MIUI because of the lack of proprietary image processing algorithms, and there may be problems with NFC performance, autobrightness, or power consumption if the port was poor.

Compare the main characteristics of both options in the table below:

CharacteristicsGlobal ROM (Official)Custom ROM (Third Party)
StabilityHigh, Manufacturer TestingDepends on the developer, there may be bugs.
Camera.Original quality, all modesOften simplified, regimes may not work
SecurityRegular security patchesDepends on community activity
Interface.MIUI / HyperOSPure Android (AOSP)
๐Ÿ“Š What is more important to you in a smartphone?
Stable Camera Performance: Clean Ad-Free Interface: Maximum Performance: Long-Term Update Support

If you're not a power user and you're critical to camera quality, you might want to stop at Global ROM and just uninstall the extra apps, but if you're a geek and you want to make the most of the hardware, custom firmware is a great experiment.

Recovery Installation and Firmware Process

To install any firmware other than the factory one, you need to replace the standard Recovery menu with a custom one, most commonly using TWRP (Team Win Recovery Project), a specialized environment that allows you to install software, make full system backups and clear memory partitions. The installation process usually takes place via a computer using Fastboot commands.

After connecting the smartphone in Fastboot mode (clamping the volume button when turned on) and connecting to the PC, a command is entered in the command line to flash the recovery firmware. twrp_image_name.img. It is important not to restart the phone in the usual way after this command, but immediately clamping the combination of buttons to enter Recovery mode, otherwise the standard Xiaomi system will overwrite. TWRP backwards.

What if TWRP doesnโ€™t see internal memory?
If after installing TWRP, internal memory is displayed as 0 MB, you need to format the Data partition. To do this, go to the Wipe โ†’ Format Data menu, type the word "yes" and confirm the action. This will delete all data, including the password of the lock screen.

The actual firmware process is as follows: First, the Wipe menu needs to clear the Dalvik/ART Cache, System, Cache and Data sections. Then, the Install menu selects the pre-downloaded firmware archive (usually in the.zip format) and the installation process begins, the progress of which will be displayed in the log.

  • ๐Ÿ“‚ Download the correct firmware version corresponding to your deviceโ€™s code name.
  • ๐Ÿ”„ Do not interrupt the process or disconnect the cable until the message "Successful" appears".
  • ๐Ÿงน Make sure to make a full wipe (cleaning) when switching from MIUI Custom ROM.

Once the installation is complete, you need to clear the Data partition again if you havenโ€™t done so before to avoid encryption issues, and then you can reboot the system. The first run can take up to 5-10 minutes, as the system optimizes applications.

Alternative: Cleaning MIUI without flashing

If the prospect of unlocking the bootloader and the risk of breakdown scares you, there is a less radical way to make the system cleaner.You can use the ADB (Android Debug Bridge) tool to remove system applications that normally cannot be uninstall-in-the-settings.This method is secure, does not require unlocking the bootloader and retains a warranty.

To start, you need to activate USB debugging mode. Go to Settings โ†’ About Phone and click 7 times on the build number to become a developer. Then, in the Advanced Settings menu โ†’ For developers, turn on โ€œDebugging by USB.โ€ By connecting the phone to your PC, you will access the file system via the command line.

adb shell pm uninstall -k --user 0 com.miui.analytics

This command, for example, will remove the system analytics service, which often collects user data. There are many such packages responsible for advertising, unnecessary Xiaomi services and pre-installed games. However, it is important to be careful here: removing critical system components can lead to a cyclical restart (bootloop).

๐Ÿ’ก

Use the Universal Android Debloater app for PC โ€“ it has a graphical interface and marks safe to remove packets in green and system packets in red.

In addition to removing software, you can significantly reduce the amount of advertising in the system. In the Security settings, find the Privacy section and disable all items related to sending data and personalizing advertising.

Solving problems with Google Pay and banking applications

Once custom firmware is installed or the bootloader is unlocked, contactless payments and banking applications will stop working, because Google Play Protect and banking services see that the integrity of the system is compromised, and additional manipulation will be required to return functionality.

The most effective solution is to install the Magisk root rights manager (or its modern KernelSU analogue), even if you do not plan to actively use root access. Magisk allows you to hide the fact that you have superuser rights and system modifications from the verification applications.

โš ๏ธ Note: After the Google Play Services update, the root rights detection mechanism may change.You may need to use the Play Integrity Fix module for Magisk to emulate a certified device.

To DenyList, you add Google Play Services, Google Play Store and all banking apps. Once you add them, you don't have to tick them, just have them on the list, and you also need to clear the Google Play Store and Google Play services. If done correctly, Google Play will show "Device certified" on the app.

  • ๐Ÿ›ก๏ธ Install MagiskHide Props Config to change your deviceโ€™s fingerprint.
  • ๐Ÿšซ Do not root applications from unknown sources.
  • ๐Ÿ”„ Regularly update Magisk and modules to bypass detection.

It's a cat-and-mouse game, and banking app developers are constantly improving detection methods, so one day payment may stop working before a new patch comes out, and the official Global ROM is much less likely to have such problems.

Return to the official firmware (Unbrick)

If the experiments with pure Android went wrong, the phone stopped turning on or you just decided to go back to the beginning, there is a procedure for full recovery. For Xiaomi devices, it is called firmware through the Mi Flash Tool in Fastboot mode. This method allows you to completely overwrite all memory partitions, including the bootloader, returning the device to the state of โ€œfrom the storeโ€.

You will need to download Fastboot firmware for your model (it is important not to confuse the region: Global, China, EU) and expand it. In the Mi Flash Tool, you need to select Clean all mode, which guarantees deletion of all data and unlocking (if any).

๐Ÿ’ก

The Clean all + Lock mode in the Mi Flash Tool will lock the bootloader back, but you can use it ONLY if you flash a region that matches the device region (e.g. Global on Global).

If the phone is not in Fastboot mode (black screen, charging only reaction), you may need to use EDL (Emergency Download Mode) mode. Entering this mode often requires disassembling the smartphone and closing special contacts on the board, and the firmware itself is only possible through an authorized Mi Account, which makes this method difficult for the average user.

So before you install a pure Android, always have a link to your model's official Fastboot firmware on hand.This is your only chance to quickly resuscitate the device in the event of a critical failure. Store a copy of the firmware on an external hard drive in case Xiaomi servers are unavailable.

Can I update the custom firmware by air (OTA)?
Most of the time, no. Castom firmware rarely supports automatic OTA updates, because the modified system partition blocks signature verification. Usually, the user has to download a new firmware zip archive manually, toss it into the phone's memory and install it through Recovery, having previously made a backup of the data. Some projects, such as LineageOS, have their own OTA mechanism, but it requires additional configuration.
Is the phone heating up on pure Android?
Paradoxically, it's often the other way around. MIUI is known for its background processes and services that can load the processor. Pure Android (AOSP) is usually more optimized and lighter. However, if the firmware port is poor-quality (especially camera or modem drivers), the phone can warm up more than usual. It all depends on the particular builder.
Will the wide-angle camera survive after the flashing?
If you put a Custom ROM, the quality of the photo often falls, because developers do not have access to Xiaomiโ€™s closed algorithms. However, this problem can be solved by installing a Google Camera (GCam) with the right configuration for your model. In skilled hands, the GCam on pure Android can shoot even better than a standard camera in MIUI.
Do I need to re-unblock the bootloader after returning to the runoff?
No, the bootloader status is retained. If you unlock it, cast it, and then return to the official firmware, the bootloader will remain unlocked (unless you specifically blocked it through the Mi Flash Tool), which means that the alert will appear again when you turn on the phone.