Root rights to Xiaomi Mi 9: a complete guide from unlock to Magisk

Getting the root rights to the Xiaomi Mi 9 (codenamed cepheus) is a task that requires attention to detail. This smartphone, released in 2019, remains popular among customization enthusiasts thanks to its powerful hardware (Snapdragon 855) and active developer community.

In this article, we will discuss the current 2026 The method of obtaining root rights, taking into account all the pitfalls: from the official unlocking of the bootloader to the installation of Magisk and bypassing the antirollback. 9, β€” for example, Anti-4 Or a brick after a vendor fails to firmware. If you're a beginner, be prepared: the process will take time. 2–4 It takes an hour to get a computer ADB/Fastboot.

⚠️ Note: Unlocking the bootloader and obtaining root rights will void the Xiaomi warranty and may result in data loss or device failure. On some firmware (such as Chinese or global stable) Widevine will stop working after unlocking. L1, What reduces the quality of streaming in Netflix/Disney+ before 480p.

1.Preparation: What to do before unlocking

Before you start manipulating the bootloader, make sure that your Xiaomi Mi 9 meets the key requirements. First, check the version of MIUI in Settings β†’ About the phone. Any official firmware (stable or developer) will suit you for successful unlocking, but it is better to use the world or European one - on the Chinese versions, Xiaomi servers are more likely to have problems.

Secondly, it is imperative that:

  • πŸ”‹ Charge your phone to at least 60% – the unlocking process can take up to an hour.
  • πŸ“± Make a full backup of data through Mi Cloud or ADB Backup – After unlocking the phone will be reset.
  • πŸ’» Prepare a computer with Windows 10/11 Linux (macOS is not recommended due to problems with Fastboot drivers).
  • πŸ”Œ Use the original. USB-Cheap cables often cause waiting for device errors.

Also check if the bootloader has been unlocked before. To do this, turn off the phone, then press Volume Down + Power to log into Fastboot. If you see Unlocked at the bottom of the screen, the bootloader is already unlocked, and you can go to TWRP installation. If not, read on.

πŸ“Š What firmware are you using on Xiaomi Mi 9?
Official global stable
Official Chinese
LineageOS (Pixel Experience)
MIUI EU (xiaomi.eu)
other

2 Unlock the bootloader through the Mi Unlock Tool

Xiaomi officially lets you unlock the bootloader, but the process is complicated by account checks and waiting.

1. Link your Mi Account to your phone:

Go to Settings β†’ Xiaomi Account and log in.

- Enable Settings β†’ Additional β†’ For developers β†’ Linking Mi Account (if there is no item, tap 7 times on the MIUI version to activate the developer mode).

Connect your phone to the Internet via mobile data (Wi-Fi may not work!) and wait for SMS to confirm the binding.

2 Download the Mi Unlock Tool:

- Official utility: https://en.miui.com/unlock/ (version no lower than 5.5.224.30).

- Unpack the archive and launch it. miflash_unlock.exe on behalf of the administrator.

3. Launch unlock:

- Transfer the phone to Fastboot (Loudness down + Power).

- Connect to the PC and in the utility press Unlock.

If a Couldn’t unlock error appears, it means that the account is not tied or the phone has not passed the waiting check (usually 72-168 hours).

Linked to Mi Account on phone|Download the latest version of the Mi Unlock Tool|Phone in Fastboot mode|Antivirus on PC is disabled|Used by the original USB-cable-->

⚠️ Warning: If you see this device is locked.Connect this device to Mi Unlock with the same account, but it doesn't start unlocking, try changing your account region to China in the Mi Account settings.

3. Installation of custom TWRP Recovery

After unlocking the bootloader, you need to install TWRP - custom recavers, which will allow you to flash Magisk to obtain root rights. For Xiaomi Mi 9 (cepheus), an unofficial version of TWRP from the developer mauronofrio (it supports FBE encryption and dm-verity).

Download the latest release:

  • πŸ“₯ TWRP for Mi 9: XDA Developers (seek out the file) twrp-3.7.0_12-0-cepheus-mauronofrio.img).
  • πŸ“₯ Magisk (Last Version): GitHub (download) Magisk-v26.4.zip).

Install TWRP via Fastboot:

  1. Place the downloaded twrp.img in the folder with the platform-tools (where adb.exe and fastboot.exe lie).
  2. Open the command line in this folder and execute: fastboot flash recovery twrp-3.7.0_12-0-cepheus-mauronofrio.img fastboot boot twrp-3.7.0_12-0-cepheus-mauronofrio.img
  3. The phone will reboot to TWRP. Don't reboot to the system! Go straight to Magisk firmware.

πŸ’‘

If after the command fastboot boot phone is stuck on the MI logo - press Volume up + Power for 10 seconds for a forced reboot, then repeat the command.

4. Magisk firmware and obtaining root rights

In TWRP, follow the following steps:

  1. Click Install β†’ select downloaded Magisk-v26.4.zip β†’ swipe for firmware.
  2. Once completed, press Reboot System. If TWRP asks you to install the TWRP App, refuse (no need for it).
  3. The first download can take 5-10 minutes – do not interrupt the process!

After downloading the system, check for root rights:

  1. Install the Magisk app from the Play Market.
  2. Open it if you see a green tick and the words Installed: 26.4, root is successful.
  3. Check the operability through the terminal by entering the command: su If there is a request for rights, everything works.

⚠️ Attention: On some firmware MIUI 14/15 After Magisk is installed, the mobile network may disappear. RIL. Decision:

  • Install the Mi 9 RIL Fix module in Magisk (search for XDA).
  • Or run a vendor from the old version of MIUI through Fastboot: fastboot flash vendor.img

5. Solving common mistakes

The process of obtaining root rights to Xiaomi Mi 9 is often accompanied by errors.

Mistake.Reason.Decision
Anti-4 / Anti-rollbackFirmware of the newer version of MIUI over the old one without updating anti-flags.Swipe the full firmware package through the Mi Flash Tool with the clean all tick.
This package is for "cepheus" devices; this is a ""TWRP or Magisk are for a different model.Download files for cepheus (not for Mi 9 SE or Mi 9T!).
The phone does not boot after Magisk firmwareModule conflict or the wrong version of Magisk.Download to TWRP and swipe Magisk-uninstaller.zip, then re-install.
Fastboot: unknown command 'flash'An outdated version of platform-tools.Update ADB/Fastboot to the latest version from the official website.

If after unlocking the bootloader, the phone stopped seeing SIM-The map is likely damaged by the modem partition:

fastboot flash modem NON-HLOS.bin


fastboot flash fsg fsg.mbn

The NON-HLOS.bin and fsg.mbn files can be extracted from the full firmware for your model.

What if Mi Unlock Tool says β€œ50%” and freezes?
This error is caused by a conflict with drivers or antivirus. Solutions: 1. Disable antivirus (including Windows Defender). 2. Install drivers manually via the Mi Flash Tool (run it with administrator rights). 3. Try another one. USB-port USB 2.0 on the back of your PC. 4. If nothing helps, use Linux (on which the Mi Unlock Tool is more stable).

6. How to hide root from applications (SafetyNet)

Many apps (banking, gaming, streaming) block access on root devices, and to get around this, you need to pass SafetyNet.

1. Install modules in Magisk:

- Universal SafetyNet Fix (by kdrag0n).

MagiskHide Props Config (to change the print of the device)

2. Set up MagiskHide:

Open Magisk β†’ Settings β†’ turn on MagiskHide.

In the MagiskHide section, tick the apps that need to hide root (for example, Sberbank Online or Google Pay).

3. Check SafetyNet status:

Install the SafetyNet Test application.

If ctsProfile status is false, restart your phone and check again.

⚠️ Attention: MIUI 14/15 Android 13+ Some banking applications (such as Tinkoff) can detect root even with MagiskHide enabled, in which case only removing Magisk completely or using Work Profile (via Island app) will help).

πŸ’‘

Without going through SafetyNet, you won’t be able to use Google Pay, Netflix in HD, and most banking apps. MagiskHide is a must-have step after you get root rights.

7. Alternative methods of root production

If the standard method with TWRP and Magisk didn’t work, consider the alternatives:

  • πŸ”§ Patched Boot Image: Sweep through modified boot.img with already built-in Magisk (suitable for devices with a locked bootloader, but requires unlocking) OEM).
  • πŸ“¦ Custom firmware: Install firmware with pre-sewn root (like LineageOS or Pixel Experience). MIUI (for example, the themes of design).
  • πŸ”„ EDL Mode: Emergency Firmware Mode via Qualcomm 9008.A risky method, requires an authorized Xiaomi account and a special cable.

For the Xiaomi Mi 9, the most reliable alternative is OrangeFox Recovery firmware instead of TWRP. This recaveri has better FBE support and is less likely to cause errors when working with the vendor.

8 How to get it all back (reversed)

If you need to return your phone to its original state (for example, for warranty repairs), follow the following steps:

1. Delete Magisk:

In the Magisk app, click Delete β†’ Complete Delete.

Or run the Magisk-uninstaller.zip file through TWRP.

2. Restore the stock Recovery:

Download the official firmware for your model from the Xiaomi website.

- Remove the recovery.img file from the archive and run it through Fastboot:

fastboot flash recovery recovery.img

3. Lock the loader:

Go to Fastboot and do:

fastboot oem lock

- ⚠️ Warning: This command will completely reset the phone and delete all data! Once the bootloader is locked, it will be impossible to restore root without re-unlocking.

4. Sweep through the full stock firmware:

Use the Mi Flash Tool with the clean all and lock option to return to factory condition.

πŸ’‘

A rollback to stock firmware does not guarantee a warranty recovery. Xiaomi can determine whether a bootloader has been unlocked from the device’s logs even after locking.

FAQ: Frequent questions about root on Xiaomi Mi 9

Can I get root without unlocking the bootloader?
No, on the Xiaomi Mi 9 (as on all modern Xiaomi smartphones), unlocking the bootloader is mandatory.The only exception is exploits for older versions of Android (like DirtyCOW), but they don't work on MIUI 12+.
Why is the NFC or camera not working after unlocking?
This is a typical problem when running an incompatible vendor or modem version of the firmware.Solution: Download the full firmware for your model with Xiaomi Firmware Updater. vendor.img and modem.img. Fastboot: Fastboot Flash vendor vendor.img fastboot flash modem modem.img
How to update MIUI after getting root?
Update MIUI via Settings β†’ Update system can not β€” this will lead to root loss and possible error Anti-rollback. Instead: Download the full service pack (.tgz) for your model. Sweat it through TWRP (select Install β†’ Install Image β†’ system.img). After the update, re-sweep Magisk.
Can I get root on the Chinese version of Mi 9 (with China Stable firmware)?
Yes, but there are nuances: Chinese firmware often doesn't have Mi Account binding to unlock. The solution is to change the account region to Global in settings. Once unlocked, Widevine L1 (Netflix at 480p) may be lost. Some MIUI features (such as themes) may not work properly. We recommend that you flash MIUI EU (xiaomi.eu) after unlocking - it is optimized for global use and supports root.
What if after the firmware Magisk phone bootloop?
Causes and Solutions: Incompatible version of Magisk Magisk-uninstaller.zip through TWRP, Then install another version (for example, 25.2 instead 26.4). Damaged. boot.img: Restore Stock Boot with Fastboot: Fastboot Flash Boot boot.img Module conflict: Remove all Magisk modules in TWRP (folder /data/adb/modules).