Rooting Xiaomi Phone: The Complete Guide from Unlocking to Installing Magisk

Rooting a Xiaomi smartphone opens up access to hidden Android capabilities, but it requires caution. Without proper preparation, you risk turning the device into a brick or losing your warranty. This guide will help you understand the process from A to Z: from unlocking the bootloader to installing Magisk to manage root rights.

It is important to understand that the procedure is different for different models of Redmi, POCO and Mi. For example, on Xiaomi 13 Pro with MIUI 15 the algorithm will be different than on Redmi Note 10 with MIUI 12.

Before you start, check out: starting in 2023, Xiaomi has tightened its bootloader unlock policy โ€“ now requires a Mi Account to be linked to the device for a minimum of 168 hours (7 days) before applying.

What does rooting Xiaomi give and what are the risks?

Root rights allow:

  • ๐Ÿ”ง Remove system applications (MIUI Bloatware without consequences
  • ๐Ÿš€ Install custom firmware like LineageOS or Pixel Experience
  • ๐Ÿ”‹ Optimize battery life with Greenify or Battery Charge Limit
  • ๐ŸŽฎ Use game console emulators with full support
  • ๐Ÿ“ฑ Modify system fonts, animations and interface

But there's a downside.

  • โš ๏ธ Loss of warranty โ€“ official service centers will refuse repairs
  • ๐Ÿ›ก๏ธ Malware vulnerability (root access bypasses Google Play Protect protection)
  • ๐Ÿ”„ Problems with OTA-Updates (you will need to install the firmware manually)
  • ๐Ÿ“ต Banking applications inoperability (due to SafetyNet trigger)

โš ๏ธ Note: On devices with MediaTek processor (e.g. Redmi) 9A or POCO M3) Unlocking the bootloader can lead to hardware locking IMEI. Before the procedure, save a backup copy of the nvram partition via SP Flash Tool.

๐Ÿ“Š Why do you want to get root rights?
Removal of embedded applications
Installation of custom firmware
Game modifications
Optimizing the battery
Other

Preparation of the phone: unlocking the loader

The first step is unlocking the bootloader. Without that, you can't install custom recovery or firmware. Xiaomi uses its own unlock system through the Mi Unlock Tool app.

Algorithm of action:

  1. Activate Developer Mode: Go to Settings โ†’ About Phone and click on MIUI Version 7 times.
  2. Back to Settings โ†’ Additionally. โ†’ For developers and include: ๐Ÿ”“ Unlocking OEM (It may not be available on new models) ๐Ÿ”Œ Debugging by USB

Mi

Settings โ†’ Xiaomi Account โ†’ Mi Cloud

Mi Unlock Tool

Then connect your phone to your PC in Fastboot mode (click Volume Down + Power When the device is off) and start the Mi Unlock Tool. The program will check if you can unlock. If you see the message "Couldn't unlock. Wait 168 hours" - you will have to wait 7 days from the moment of the account's attachment.

โ˜‘๏ธ Checking before unlocking

Done: 0 / 5

โš ๏ธ Note: On HyperOS devices (e.g. Xiaomi 14 or Redmi) K70) The standard Mi Unlock Tool may not work, but alternative methods may be used. EDL-Mode (requires an authorized Xiaomi account).

Installation of TWRP Recovery: version selection and firmware

TWRP (Team Win Recovery Project) is a custom recovery required to install Magisk or custom firmware. For Xiaomi, there are official and informal builds.

Where to download the correct version:

  • ๐Ÿ“ฑ Official website: twrp.me (look for the exact model, for example, davinci for Redmi) K20 Pro)
  • ๐Ÿ”ง Informal assemblies: forum XDA Developers (check reviews!
  • ๐Ÿ“ฆ Telegram channels: @XiaomiTWRP or @MIUIUpdates

Installation instructions:

  1. Rename the downloaded.img file to twrp.img and place it in the folder with the platform-tools (where the fastboot is located).
  2. Connect your phone in Fastboot mode and execute the command: fastboot flash recovery twrp.img
  3. Immediately after the firmware, go to TWRP, holding Volume Up + Power. If the regular MIUI loads, recovery will restart!

For some models (e.g, POCO F5 Xiaomi 12T) patchy vendor_boot. In this case, use the command:

fastboot flash vendor_boot vendor_boot.img


fastboot flash boot magisk_patched.img

What to do if TWRP does not start?
If the phone is loaded into a standard recovery, then MIUI re-record TWRP. Decision: 1. Repeat the firmware. TWRP. 2. Right after the team. `fastboot flash recovery` execute `fastboot boot twrp.img` โ€” it'll load TWRP nonrecorded. 3. V TWRP cross over `Advanced โ†’ Flash Current TWRP` (if there is such a clause).

Installation of Magisk for root rights management

Magisk is a root-rights tool that allows you to bypass SafetyNet checks, which is important for banking applications.

Step-by-step:

  1. Download the latest Magisk ZIP (version 26.4+ for Android 13/14).
  2. Transfer the file to your phone or flash drive.
  3. Download to TWRP and click Install โ†’ select the downloaded file.
  4. After installation, run Wipe โ†’ Format Data (this will delete all data, but it is necessary for correct operation!).
  5. Reboot to the system. When you first start, install the Magisk App from the file (download the APK from the same GitHub).

To check root rights, install Root Checker from Google Play, and if you see the message "Root access is properly installed" - it was successful.

If banking applications (e.g. SberBank or Tinkoff) have stopped working after installing Magisk, activate the following settings in Magisk:

  • ๐Ÿ”’ MagiskHide (Hidden Root from Apps)
  • ๐Ÿ›ก๏ธ Zygisk (to bypass new checks)
  • ๐Ÿ“ฑ DenyList (add banking applications to exceptions)

1. Download to TWRP and reinstall Magisk.

2. delete the file `/data/adb/magisk.db` through the file manager in TWRP.

3. Sweep the original boot.img fastboot.-->

Solving Typical Problems After Rooting

Even with the right installation, there can be difficulties.

Problem.Reason.Decision
Phone not switched on (brick)Wrong firmware TWRP or MagiskSwipe the official firmware through the Mi Flash Tool in EDL mode
Banking applications are not workingSafetyNet or Play Integrity TriggerActivate Zygisk + MagiskHide and add the app to DenyList
No net (IMEI reset)Nvram section is damaged (relevant to MediaTek)Recover the nvram backup via the SP Flash Tool or Maui META
MIUI not updatedSystem partition changedUpdates only via TWRP (.zip files)

If Google Pay or Netflix stop working after rooting, check SafetyNet status in Magisk. If you see "CTS profile: fail," install modules:

  • ๐Ÿ”„ Universal SafetyNet Fix (by kdrag0n)
  • ๐Ÿ›ก๏ธ MagiskHide Props Config (to change the print of the device)

โš ๏ธ Note: On Dynamic Partition devices (all Android 10 models)+) You cannot change the size of the sections through TWRP. This will result in data loss and the need for a complete flashing through fastboot.

How to return the phone to its original state?

If you need to give up your phone under warranty or sell it, you need to remove all traces of rooting.

  1. Uninstall the Magisk menu (Uninstall โ†’ Complete Uninstall).
  2. Stitch the original boot.img Fastboot: Fastboot Flash boot boot.img
  3. Return standard recovery: fastboot flash recovery recovery.img
  4. Fastboot: fastboot erase userdata fastboot erase cache
  5. Lock the bootloader back (optional, but recommended for warranty): fastboot oem lock

For complete cleanliness, run the official firmware through the Mi Flash Tool with the clean all and lock option, which will return the phone to factory status, but delete all data.

๐Ÿ’ก

Even after removing Magisk, some banking apps can remember that the device has been rooted, in which case only a complete firmware reflash with the bootloader locked will help.

Alternative Rooting Methods Without TWRP

For some models (such as the Xiaomi 13 Ultra or POCO F5 Pro), TWRP installation may be difficult due to AVB 2.0 protection.

Method 1: Patch boot.img via Magisk

  1. Download the original boot.img for your firmware (can be extracted from the official ROM).
  2. Transfer it to your phone and open it in Magisk (Install โ†’ Select and Patch a File).
  3. Squeeze the result. magisk_patched.img fastboot.

Method 2: Root through ADB (Temporary)

For one-time tasks (for example, removing system applications), you can use a temporary root:

adb shell


su




mount -o rw,remount /system




rm /system/app/Analytics/Analytics.apk




mount -o ro,remount /system

This method does not require unlocking the bootloader, but the rights will disappear after the reboot.

FAQ: Answers to Frequent Questions

Can I get root on Xiaomi without unlocking the bootloader?
No, it's impossible. All current rooting methods (including Magisk) require an unlocked bootloader. The only exception is temporary root through vulnerabilities (like DirtyCOW), but it doesn't work on all devices and disappears once you reboot.
Why doesnโ€™t the NFC or camera work after rooting?
This is a typical problem when using unofficial TWRP or Magisk builds. Solutions: Scroll down the official vendor.img for your model. Install the NFC Fix for MIUI module in Magisk. For the camera, check for the file /vendor/lib/libarcore.so.
How to update MIUI after rooting?
Updates by air" (OTA) They won't work. Download the full ones. ZIP-firmware MIUI Download and install through TWRP. Before the update: Make a backup in TWRP. Remove Magisk (so you don't conflict with the new firmware). After the update, re-sweep Magisk.
Can you root Xiaomi on iOS or Mac?
Technically yes, but additional steps will be required: Install Android File Transfer to access files. Use homebrew to install adb and fastboot: brew install android-platform-tools.Mi Unlock Tool may require a Windows virtual machine (the program doesn't always work through Wine).
Which Xiaomi models canโ€™t be rooted?
Officially, rooting is possible on all models, but there are exceptions: Xiaomi Mi A1/A2/A3 (Android One) โ€“ require unlocking through Google, not Xiaomi. Devices for the Chinese market (China ROM) โ€“ may have additional restrictions. Models with HyperOS (2026) โ€“ there are no stable versions of TWRP for most devices. Before you start, check the information on XDA Developers for your model.