How to Set Up Root Access on Xiaomi: A Complete Guide from Unlocking to Magisk

Getting root rights on Xiaomi smartphones opens up access to hidden Android features, allows you to remove system applications, optimize performance and install modified firmware. However, the process requires care: improper actions can turn a device into a brick or take away warranties. In this guide, we will analyze all the steps from unlocking the bootloader to installing Magisk, while maintaining the possibility of OTA updates.

It’s important to understand that Xiaomi is actively blocking unofficial modifications: since 2023, the company has tightened the requirements for unlocking the bootloader, and in new models (for example, Xiaomi 14 or Redmi Note 13 Pro+) used hardware protection Anti-Rollback. However, workarounds exist β€” and we will describe them in detail. If your goal is to simply remove ads in MIUI, consider alternatives like disabling personalized advertising in the settings: root is not necessary for this.

1.Preparation of the device: what to do before unlocking

Before you start unlocking, make sure your smartphone meets the key requirements:

  • πŸ“± Device model: check support on Xiaomi's official website.New flagships (e.g. Xiaomi) 13T or POCO F5) They may require additional steps.
  • πŸ”„ Version. MIUI: Update your firmware to the latest stable version via Settings β†’ The phone. β†’ System updates: Some models require Global ROM (China ROM).
  • πŸ”‹ Battery charge: at least 60%. Unlocking process can take up to 30 minutes, and interruption due to discharge will lead to failure.
  • πŸ’» Computer: Windows 7/10/11 (for Mi Unlock Tool or Linux/macOS (Virtual machines are not recommended due to driver problems.

Back up your data via Settings β†’ Additional β†’ Backup and Reset or via Xiaomi Cloud. Once the bootloader is unlocked, all data will be erased – a prerequisite for Xiaomi to protect user data.

  • πŸ”‘ Mi Account: Link it to your device in advance (in your account settings) and make sure it is free of restrictions (e.g., blocking for suspicious activity).
  • πŸ“‘ Internet connection: stable Wi-Fi or mobile internet (for downloading tools).
  • πŸ› οΈ Drivers: Install Mi PC Suite or drivers ADB manually.

⚠️ Note: If your device was purchased in China (China version) ROM), Unblocking may require waiting 168 hours (7 days) after the Mi Account is linked.

πŸ“Š What Xiaomi model do you use?
Redmi Note 12/13
POCO X5/F5
Xiaomi 13/14
Another model
I don't know.

2 Unlocking the bootloader: official and informal ways

The bootloader on Xiaomi is locked by default, and unlocking it is a must before getting root. The official method involves using the Mi Unlock Tool utility, but it has limitations:

  1. Download the Mi Unlock Tool (version for your region).
  2. Launch the utility on behalf of the administrator and log in to your Mi Account.
  3. Transfer the smartphone to Fastboot mode: turn off the device, then press Volume down + Power.
  4. Connect your phone to your PC through USB-cable (preferably original).
  5. In the utility, press Unlock and confirm the action.

If the utility is running a "Couldn't unlock" or "Wait 168 hours" error, it means:

  • πŸ•’ You recently linked your Mi Account to your device (wait for 7 days).
  • πŸ“΅ The device is not officially supported (e.g., Redmi). 10A or some regional models).
  • πŸ”Œ Driver problems (try reinstalling them through Device Manager).

To circumvent restrictions, use informal methods:

An alternative way to unlock without waiting 168 hours
1. Install TWRP for your model via fastboot (for example, for POCO X3 Pro use the command fastboot flash recovery twrp.img). 2. In TWRP, go to Advanced β†’ Flash Current TWRP (this will prevent replacement of recovery with stock). 3. Scroll a modified boot image with boot boot boot boot check disabled. 4. Return to Mi Unlock Tool - now unlock will pass without waiting.

Unlocking methodAdvantagesDeficienciesSuitable for
Official (Mi Unlock Tool)Safe, supported by Xiaomi168 hours waiting time, not working on all modelsNewcomers, owners of global versions
Through TWRP+ patchBypasses the time limitRisk of the breeze requires knowledgeAdvanced users
EDL-regimen (Qualcomm)It works even on locked devices.Requires an authorized Xiaomi account or paid servicesRebuilding the bricks

⚠️ Warning: Once the bootloader is unlocked, the smartphone will automatically reset to factory settings. Do not try to interrupt the process - this may damage the userdata partition.

Installation of custom recovery (TWRP)

TWRP (Team Win Recovery Project is an alternative recovery project that allows you to stitch through the ZIP-files (such as Magisk or custom firmware) for installation:

Download the official TWRP for your model from twrp.me

Check the firmware version (e.g. MIUI 14.0.5) – TWRP must match it

Unclose the twrp.img file to a folder with fastboot

Disable signature verification in developer settings (Settings) β†’ The phone. β†’ Version. MIUI (7 times) β†’ For developers β†’ Permission. OEM-unlock)

-->

Next, execute commands in the terminal (pre-translate the phone to fastboot):

fastboot devices # Check the connection


fastboot flash recovery twrp.img #TWRP firmware




fastboot boot twrp.img # Download to TWRP (without constant firmware)

If after the reboot, TWRP is replaced by stock recovery, use the command:

fastboot flash recovery twrp.img


fastboot flash vbmeta vbmeta.img # Disables recovery check (requires to download vbmeta for your model)

For models with Dynamic Partition (such as Xiaomi 12 or Redmi K50), the process is more complicated:

  1. Download the full Fastboot ROM image for your model.
  2. Remove the recovery.img and vbmeta.img files.
  3. Fly them through fastboot with a flag --disable-verity.

πŸ’‘

If TWRP doesn’t see internal memory, go to Mount β†’ Enable MTP and connect your phone to your PC.

4. Getting root rights through Magisk

Magisk is a root-rights tool that allows you to hide root from applications (such as banking) and update OTA firmware. The latest stable version as of 2026 is Magisk v26.4.

Installation instructions:

  1. Download Magisk APK and install it on your phone (don't run it).
  2. Download the same Magisk file, but in.zip format (e.g. Magisk-v26.4.zip).
  3. Reboot to TWRP (via adb reboot recovery or button combination).
  4. In TWRP, select Install β†’ specify the path to Magisk-v26.4.zip β†’ swipe for confirmation.
  5. After installation, reboot to the system.

To verify root rights:

  • Open the Magisk app – if it shows Installed status, root is obtained.
  • Install Root Checker from Google Play.
  • Start the terminal and type the su command – if a rights request appears, root works.

If after installing Magisk, the phone is fixated on booting:

⚠️ Attention: This means that boot.img Solution: Refuse the original boot.img via fastboot flash boot boot.img. Install Magisk via patch boot.img (guideline).

πŸ’‘

Use boot.img patching if your model does not support direct firmware Magisk.zip (e.g. Xiaomi 13 Ultra or POCO F5 Pro).

5. Patching boot.img (alternative method for new models)

On Android 12+ and MIUI 13/14 devices, Magisk.zip’s direct firmware may not work, and you need to manually patch boot.img:

  1. Download Magisk APK and install it.
  2. Remove boot.img from the firmware for your model (can be found in Fastboot ROM or download separately).
  3. Copy boot.img in your phone memory.
  4. In Magisk, click Install β†’ Select and Patch a File and select boot.img.
  5. After patching, copy the received file magisk_patched.img PC-only.
  6. Fastboot: Fastboot Flash Boot magisk_patched.img fastboot reboot

For devices with init_boot (for example, Xiaomi 14 Android 14) The process is similar, but both files need to be patched:

fastboot flash init_boot magisk_patched_init_boot.img


fastboot flash boot magisk_patched_boot.img

If the phone doesn’t boot after patching, try:

  • πŸ”„ Use it. boot.img from another version of the firmware (for example, an older version).
  • πŸ› οΈ Shut down. AVB 2.0 via fastboot command --disable-verity flash vbmeta vbmeta.img.
  • πŸ“₯ Sweep the full Fastboot ROM repeat.

6. Hiding root from applications (MagiskHide and Universal SafetyNet Fix)

Many apps (banking, gaming, Google Pay) block work on root devices.

  1. In Magisk, go to Settings β†’ MagiskHide and turn on the option.
  2. Add problematic apps to the MagiskHide list (like SberBank Online or PokΓ©mon GO).
  3. Install Universal SafetyNet Fix via Magisk β†’ Modules.
  4. Reset the device.

To check the availability:

  • Install SafetyNet Test.
  • Run the test – if ctsProfile: true, then SafetyNet is passed.
  • For Google Pay, additionally install the MagiskHide Props Config module and configure the props (instructions in XDA).

⚠️ Google has tightened checks through Play Integrity since 2023 API. If the app still detects root, try: Use Island or Shelter to isolate applications in your work profile, v25.2).

7. Update firmware with root: how not to lose access

Once rooted, the MIUI update over OTA can result in a loss of root or even a "brick" to update securely:

  • πŸ“₯ Method 1: Hand-held firmware through TWRP Download the full service pack (.zip) for your model. TWRP (No Wipes!! After the update, re-sweep. Magisk.zip.
  • πŸ”„ Method 2: Update with patch boot.img Update through OTA, But don't reboot. Remove a new one. boot.img You patch it up with Magisk and you sew it back.
  • 🚫 Method 3: Shutdown OTA-Update Remove the Updater App via ADB: adb shell pm uninstall --user 0 com.miui.updater Or freeze it with Magisk (App Systemizer module).

For models with Anti-Rollback (such as Xiaomi 11T or Redmi K40), an update via TWRP can block the bootloader.

What if the phone doesn’t turn on after the upgrade?
1. Transfer the device to EDL-Mode (close testpoints or use the command adb reboot edl). 2. Scroll the full Fastboot ROM via Mi Flash Tool with clean all and lock option. 3. Repeat the process of unlocking and obtaining root.

Type of updateIs root still there?Risks.Recommendations
OTA (over the air)❌ No.Loss of root, possible bootloopPatch boot.img after update
Manual via TWRPβœ… Yes (with the right firmware)Risk of "brike" in an errorRemove the backup before the firmware
Fastboot ROM❌ No.Full reset, loader lockdownRe-unblock after the firmware

8. Problem Solving: Frequent Mistakes and Solutions

Even if you follow the instructions accurately, you can get errors.

  • πŸ”΄ Mi Unlock Tool: Check that your Mi Account is logged in for more than 7 days. Turn off two-factor authentication in your Mi Account. VPN servers in China (sometimes with a help).
  • πŸ”΄ The phone is stuck on the logo MI After the firmware Magisk Solution: Sweat the original boot.img If it doesn't work, reset it through fastboot. TWRP (Wipe β†’ Format Data).
  • πŸ”΄ Magisk not installed: "Installation failed" error Solution: Check version TWRP β€” It must be Android version. Turn off signature verification in settings TWRP. Try installing Magisk Canary (experimental version).
  • πŸ”΄ SafetyNet (ctsProfile: false) Solution: Remove all Magisk modules and install only Universal SafetyNet Fix. Check that MagiskHide has added all Google applications. Change the device's print using MagiskHide Props Config.