How to root Xiaomi: A deep guide to getting superuser rights

Obtaining superuser rights, or root access, on Xiaomi smartphones opens up a truly limitless opportunity for customization. Unlike many other manufacturers, the Chinese giant is quite loyal to software modifications, providing official tools to unlock the bootloader. However, the process itself requires a clear understanding of the structure of Android and the risks associated with tampering with system files.

Before you ask how to root Xiaomi, you need to realize that you are going to change the fundamental security of the device.The Mi Unlock Tool is the official gateway, but it is only the first step on the road to complete freedom.Modern methods like using Magisk allow you not only to get rights, but also to hide them from banking applications and Google Pay, which was previously a serious problem for enthusiasts.

In this article, we will take a look at the whole process from start to finish, focusing on the nuances of working with the bootloader and installing a patched boot image. We will not use outdated methods like KingRoot, as they are ineffective on new versions of Android and can pose a threat to the security of your data.

Preparation of the device and unlocking the loader

The foundation for obtaining superuser rights is the unlocked bootloader. Without this step, any attempts to modify the system partition or boot image will be blocked at the hardware level. Xiaomi requires linking the Mi Account account to the device and waiting for a certain time, usually between 7 and 168 hours.

To start, you need to activate the developer mode. Go to Settings β†’ About phone and quickly click 7 times on the version of MIUI or HyperOS. After you notice that you have become a developer, go to the advanced settings and find the item "For developers." Here you need to activate the option "OEM Unlocking" and add your account.

⚠️ Warning: The process of unlocking the bootloader through the Mi Unlock Tool will result in the complete removal of all data from the internal drive. be sure to back up photos, contacts and documents before starting the procedure.

After waiting for Xiaomi server, you can start unlocking. You will need a Windows PC, USB-You can use a good data cable and a Mi Unlock utility. Enter your phone in Fastboot mode, holding both the power and volume buttons, then plug it into your computer.

  • πŸ”‘ Download the official Mi Unlock utility from the site en.miui.com/unlock.
  • πŸ”Œ Connect your smartphone in Fastboot mode and log in to the program under the same Mi Account.
  • ⏳ Wait for the countdown timer to end if it hasn’t expired yet.
  • πŸš€ Press the Unlock button and confirm the action, after which the phone will restart and clean.

β˜‘οΈ Checklist before unlocking

Done: 0 / 5

Selecting a rooting method: Magisk vs. old utilities

The era of apps like KingRoot or OneClickRoot is gone forever. On today's Xiaomi devices running Android 10, 11, 12 and later, the only sure and safe way to do this is to use Magisk. It works on a systemless root, meaning it doesn't make changes to the system partition directly, but patches the boot image in the memory when the system starts.

Magisk's main advantage is the ability to control root access for each application separately and, critically, in the root hiding function. Banking apps and anti-cheat games often block work on rooted devices, but Magisk allows you to bypass these checks through its interface and additional modules. Old methods, embedding the su binary directly into /system/bin, are easily detected and violate the integrity of the system.

πŸ“Š What is your experience with rooting?
First time, I'm afraid to make a mistake.
Ruthed old Android 4-6
I use Magisk regularly.
I use Custom ROM with built-in root.

Magisk also supports a modular system that allows you to install system modifications without flashing the entire device, so you can change fonts, emojis, system sounds, and even kernel settings on the fly, making the rooting process not just a license, but an entry into Xiaomi’s deep customization ecosystem.

  • πŸ›‘οΈ Systemless approach does not violate the integrity of the system partition.
  • πŸ™ˆ Ability to hide the root from banking applications and SafetyNet/Play Integrity.
  • 🧩 Support for modules to expand functionality without flashing.
  • πŸ”„ Convenient management of superuser rights through the application.

Install Magisk via boot.img patch

The most reliable way to root Xiaomi is to patch the original boot image, which requires an exact copy of the stock firmware currently installed on your phone, and using an image from another version of the software can result in a bootloop or inoperability of individual modules, such as a camera or Wi-Fi.

First, download the full Fastboot ROM for your model from the official website or verified sources like xiaomirom.com. The firmware file will have the.tgz extension. Unpack the archive, find the images inside the folder and extract the boot.img file from there. This is the file we will modify.

1. Install the Magisk app (apk) on your phone.


2. Copy the boot.img file to the memory of the smartphone.




3. Open Magisk and click "Install" next to the Magisk version.




4. Select "Select and patch file" and select boot.img.




5 Wait until the process is over, magisk_patched.img will appear in the Download folder.

File received magisk_patched.img You need to move back to the computer in a pack with tools. ADB And then the phone goes to Fastboot mode and connects to the PC. The command line is used to run the firmware command of the modified image in the bootloader section.

fastboot flash boot magisk_patched.img


fastboot reboot

What to do if the phone goes into a bootloop?
If the Mi logo appears after the reboot and it doesn't go any further, try pressing the power and volume button up to enter Recovery. If you have access to Fastboot, try flashing the stock boot.img back with the command: fastboot flash boot.img (original file). If nothing helps, you will need to completely reflash through the Mi Flash Tool in Clean All mode.> Magisk setting up and bypassing the root detection After successful reboot and the Magisk icon appears in the application menu, the process of obtaining rights can be considered complete, but not finished. To use the civilization, you need to switch on the right to the "Zysk" to switch on the top of the device, you need to switch on the "to the device to the device to the right to switch on the "open the device, you need to switch on the "Change" (to the device, you need to switch on the device to the right to the device to switch to the "Change the device to the right to switch on the "Change the "Change" (Zgisk" button. In the settings menu, look for the DenyList and click on Set up Exclusion Lists, and you can find all the banking apps, Google Pay, Google Wallet and various games, and check the boxes against them and all their processes. This will tell Magisk which apps to hide root rights for. ⚠️ Note: After updating Magisk or changing the settings of Zygisk, some applications may stop seeing the hidden.In such cases, cleaning the data of the Google Play Services application and rechecking through the Internet helps. YASNAC Also worth paying attention to the module "Universal SafetyNet Fix" (or its modern counterparts for Play Integrity), which is often necessary to pass security checks on new Xiaomi devices. Without it, the device status in Google Play Console can be displayed as β€œNot certified”, which will limit the operation of some streaming services in the Internet. HD-quality. πŸ” Enable Zygisk in the Magisk settings. πŸ“ Set up DenyList for all banking and important applications. 🧹 Clear the cache and data of Google Play Services after setting up. βœ… Check the security status through the Momo app or YASNAC. Compatibility and Risk Table for Different Models Not all Xiaomi models root in the same way. There are differences in processor types (Snapdragon, MediaTek, Exynos) and bootloader versions. Some devices, especially those released for the Chinese market with China preinstalled ROM, These may have additional protections or require specific actions. The table below shows the main characteristics and risks for popular series of devices. It is important to understand that having a Snapdragon processor usually makes it easier to find ready-made solutions and custom recavers, while MediaTek requires a more careful work with the boot image. Series of devices Processor Type Root Complexity Risks Xiaomi / Redmi (Global) Snapdragon / MediaTek Low Data Reset, loss of warranty Xiaomi (China) ROM) Snapdragon Average Notification Problems, Language POCO (Global) Snapdragon Low Similar to Xiaomi Global Black Shark Snapdragon High Complex unlock, risk of brick Possible problems and ways to solve them In the process of system modification, users often face a number of typical problems. One of the most common is the loss of broadband connectivity (Widevine). L1), Netflix and other services only broadcast content in low resolution (480p). This is due to a breach of the chain of trust when unlocking the bootloader. Another common problem is a broken fingerprint or face, and some Xiaomi models store biometric data in a secure partition that can be compromised by incorrect patching. In such cases, it often helps to reinstall the stock firmware through the Mi Flash Tool in "Clean All and Lock" mode, but this will require unlocking again. NFC. Once you have root rights and installed Magisk, contactless payment may stop working even when hidden is enabled, in which case it helps to delete the cache of the Security app and re-assign cards to Google Wallet again. πŸ“‰ Widevine L1: Often lost forever on an unlocked bootloader, saves only a stock return BL (not always). πŸ“± Camera: Could be worse due to changes in system libraries, GCam installation helps. πŸ”‹ Battery: In the first days, increased charge consumption is possible due to background optimization of the system. ⚠️ Attention: If you get a Verifying boot error when booting, it's normal for an unlocked device. Press the power button to continue booting. Don't try to lock the boot boot boot back on custom firmware - it's a guaranteed brick. Frequently asked questions (FAQ) Will banking applications reset after rooting? The apps themselves won't be deleted, but they may stop running or show a security bug. + DenyList) and possibly install additional modules to bypass detection. Can you get root without unlocking the bootloader? On modern Xiaomi smartphones with Android 6.0 and higher, no. Exploiting vulnerabilities to obtain rights without unlocking the bootloader. BL closed. The only legal and working way is to officially unlock through Mi Unlock. Will the warranty disappear after rooting? Formally unlocking the bootloader and obtaining root rights void the manufacturer's warranty. However, if you return the device to the stock state (lock the bootloader and sew the official firmware), the service center may not detect interference, although traces in the logs may remain. It's a safe and effective method if you set the exceptions right, but there's a constant arms race between Magisk developers and the root detectors, so the settings may need to be updated. πŸ’‘Keep the original. boot.img Your current firmware in a secure location (cloud, PC). This is your lifeline, which will allow you to return the phone to working condition in the event of a failed experiment.