Install Magisk on Xiaomi: unlock, TWRP and root rights without errors

Why Magisk is the Best Choice for Root Rights on Xiaomi

Getting root rights on Xiaomi smartphones opens up access to hidden system functions, but standard methods (like SuperSU) are long outdated. Magisk has become the de facto standard due to two key advantages: the ability to hide root from applications (such as banking or games) and a modular architecture that allows you to modify the system without changing the system partition. This is especially true for Xiaomi devices, where the manufacturer actively blocks informal changes through Mi Anti-Rollback and bootloader protection.

In this article, we will look at the only working method for installing Magisk on modern Xiaomi smartphones (2022-2026 release), including models with Snapdragon 8 Gen 2/3 and Dimensity 9000+. Importantly, the procedure is different from the old instructions for the Redmi Note 4/5 or Mi A1/A2 – here the latest security policy updates Xiaomi and the requirements of Magisk Delta (fork for new Android versions).

Before you start, answer three questions:

  • πŸ”“ Why do you want to root? Without a clear purpose (for example, removing embedded applications, nuclear modification or working with the Internet). ADB) The procedure is meaningless – the risks outweigh the benefits.
  • πŸ“± Does your model support? HyperOS devices (e.g. Xiaomi) 14 or Redmi K70) It requires a different approach than smartphones. MIUI 13/14.
  • πŸ”‹ Are you prepared for the consequences? Ruth cancels the warranty, could cause problems with the OTA-Updates and blocking certain features (e.g. Widevine) L1 for Netflix 4K).
πŸ“Š Your goal of getting a root license?
Removing Bloatware (Inline Garbage)
Install custom firmware (LineageOS, Pixel Experience)
Modification of system files (hosts, build.prop)
Working with ADB/Termux
Other

Step 1: Unlock the bootloader on Xiaomi

Without a bootloader, Magisk cannot be installed. Xiaomi made it harder in 2023 by making it mandatory to link a Mi Account to the device and increasing the wait time to unlock to 72 to 168 hours (depending on the model).

  1. Link your Mi Account to your device: Go to Settings β†’ Xiaomi Account β†’ Mi Cloud and enable sync. Make sure the device is linked to your account (check in Settings β†’ About Phone β†’ Mi Unlock Status).
  2. Put the debugging on. USB and OEM-Unlock: Activate Developer Mode by pressing the Version 7 times MIUI In Settings β†’ About the phone. Then go to Settings. β†’ Additionally. β†’ For developers and include: πŸ”Œ Debugging by USB πŸ”“ Unlocking OEM (It may disappear after restarting – turn it on immediately before unlocking!).

Download the Mi Unlock Tool

The official utility is available on the Xiaomi website. Use a version at least 5.5.224.31 (older versions do not support new models).

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. Log in to the same Mi Account as your phone. If you see the message "Couldn't unlock. Wait for 72 hours" - wait for the specified time (track status in the application).

⚠️ Note: On HyperOS devices (e.g. Xiaomi) 13T Or the Redmi Note 12 Pro.+) Unlocking may require additional confirmation through SMS Or email. Don't use it. VPN When using Mi Unlock Tool, this will result in a 30-day account suspension.

Link Mi Account to your device|Enable debugging on USB and OEM-unlock|Download the latest version of the Mi Unlock Tool|Connect your phone to Fastboot mode|Sign in to Mi Unlock with the same account as your phone-->

Step 2: Install custom Recovery (TWRP or OrangeFox)

Once the bootloader is unlocked, you need to install an alternative recovery, since the standard Xiaomi Recovery does not allow you to flash modified images.

Recovery.PlusesConsSupport for HyperOS
TWRPWide compatibility, frequent updatesThey may not support new models.❌ Partially (requires patches)
OrangeFoxFBE support, built-in Magisk ManagerFewer manuals in Russianβœ… Yes, for most devices)
PitchBlackMinimalist interface, fast workLimited support for Xiaomi❌ No.

For most Xiaomi devices (2020-2026), we recommend OrangeFox – it works better with File-Based Encryption (FBE) and has built-in support for Magisk. Download the image for your model from the official website:

  • 🌐 OrangeFox Recovery
  • 🌐 TWRP (website)

Installation via fastboot:

fastboot flash recovery orangefox.img


fastboot reboot recovery

If you see a standard Xiaomi menu after rebooting in the Recovery, then the image did not pass. Repeat the command by disabling the signature check beforehand:

fastboot flash recovery orangefox.img


fastboot oem reboot-recovery

⚠️ Note: On devices with Dynamic Partition (e.g. Xiaomi) 12 pro POCO F5) An additional step may be required – vbmeta firmware to disable integrity check: fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img Download vbmeta.img You can use the scaling of your model.

Step 3: Patching a boot image through Magisk

Modern versions of Magisk (including the Magisk Delta fork) do not require firmware ZIP-Instead, we use the stock image patching method. boot.img or init_boot.img (Android 13+). Here's how to do it:

  1. Download stock firmware: Use Xiaomi Firmware Updater or the official Xiaomi website. Choose the version that matches your current firmware (check in Settings β†’ About Phone β†’ MIUI version).
  2. Extract. boot.img or init_boot.img: Unpack the downloaded archive with firmware (usually a.tz or.zip file). 12 and below: image folder β†’ file boot.img. For Android. 13+: picture-folder β†’ file init_boot.img (substitute boot.img).

Patching through Magisk:

Copy the extracted material. boot.img/init_boot.img Install the latest version of Magisk Delta (recommended for new devices) or Magisk Canary. β†’ Select and patch the file and specify the downloaded image.

After patching in the folder Download will appear file magisk_patched-[random_string].Copy it on a PC - you'll need it for firmware.

πŸ’‘

If Magisk doesn't see the boot.img file, rename it boot.img.bak and try again. Also make sure the file isn't corrupted (check its hash via SHA-256).

Step 4: Firmware patch image and obtain root rights

Now, run the patch image through fastboot. init_boot.img (Android 13+), Use the command to init_boot, not boot!

Connect your phone to your PC in Fastboot mode and do:

  • For Android. 12 and below: fastboot flash boot magisk_patched.img fastboot reboot
  • For Android. 13+: fastboot flash init_boot magisk_patched.img fastboot reboot

After the reboot, install Magisk Delta (if not already installed) and check the root rights status in the Superuser section. If you see a message "Magisk not installed", repeat the firmware of the patched image.

⚠️ Note: On HyperOS devices (e.g. Xiaomi) 14 or Redmi K70 Pro) after the patched image firmware is patched, a bootloop (cyclic reboot) may occur, in which case: Reboot to Fastboot. boot.img/init_boot.img Repeat the patching, but this time in Magisk Delta, turn off the option "AVB 2.0" before creating a patch. 5: After successful installation of Magisk, perform several checks to avoid problems in the future: πŸ” Root rights check: Install Root Checker and run the test. If the root is not found, reinstall Magisk over the Recovery. πŸ”’ Hiding Roots from Apps: In Magisk Delta, Go to Settings β†’ Configuration β†’ Enable Zygisk and add apps (such as banking) to the exclusion list through the Universal SafetyNet Fix module. πŸ“± Widevine Check: Install DRM Info. If the Widevine level is L3 (instead L1), This means losing support. HD/4K Netflix and Disney+. The solution is to flash the Widevine module L1 Certifier from Magisk repository.Typical problems and their solutions: Problem Cause Solution Phone not turned on after firmware Incorrect boot.img or interrupted process to re-enact the original boot.img via fastboot Magisk not updated Installed outdated Magisk Manager Remove old application and install Magisk Delta Apps detect root Not enabled by Zygisk or missing Universal SafetyNet Fix Activate Zygisk and add application in exceptions No network after root Damaged modemst1/modemst2 When firmware Swipe stock modem through fastboot What to do if Magisk does not see a patched image? boot.img Magisk has an error called "Invalid boot image", the reasons may be as follows: 1. File corrupted – download the firmware again and check the hash. 2. The Wrong Version of Magisk for Android 13+ Use Magisk Delta 25.2+. 3. The image is compressed - some firmware contains boot.img format.img.lz4 Or.img.gz. Unpack it with tools like this. lz4 gzip. 4. Dynamic partitions – on some devices (e.g, POCO X5 Pro) boot.img It's dynamically generated. In this case, use the direct install method in Magisk (requires a temporary root via fastboot boot). 6: Update Magisk and systems with root rights With root rights Update MIUI or HyperOS through OTA It becomes risky, and the system may lose root or stop booting altogether. Here's a secure algorithm: Magisk Update: Launch Magisk Delta, go to Settings β†’ Update. If a new version is available, select Direct Installation (this is temporarily patched in ramdisk). MIUI/HyperOS: Download the full firmware package (.tz or.zip) with Xiaomi Firmware Updater.Do not use incremental updates (OTA)! Squeeze the firmware through OrangeFox/TWRP, But don't restart immediately after installation. First: Select Install Magisk. β†’ Direct installation. Scroll through the Disable Force Encryption module (if you use custom Recovery). Dalvik/ART If the root disappears after the update, repeat the patching of the new one. boot.img/init_boot.img fresh-stitched. πŸ’‘Never upgrade to the standard. OTA-This will result in the loss of the root or bootloop, always use full firmware packages and stitch them through the custom Recovery. FAQ: Frequent questions about Magisk on Xiaomi ❓ Can you get a root on Xiaomi without unlocking the bootloader? No. All modern Xiaomi devices (starting with Snapdragon) 660 Helio G90T) The only exception is some models for the Chinese market (for example, Redmi). K60 Ultra, where unlocking is not required but they are not officially sold in Russia/Europe. Alternative methods (such as DirtyCOW exploits or other similar ones) CVE-2023-21036) They only work on older versions of Android and close with each security update. ❓ Why does Magisk not hide root from banking applications? Modern banking applications (Sberbank, Tinkoff, VTB) use a comprehensive check, including: Integrity Check /system SafetyNet and Play Integrity API. Memory scan for magiskd or zygisk processes. Verify Widevine certificates and bootloader status. Solution: Enable Zygisk in Magisk settings. Install Universal SafetyNet Fix and Play Integrity Fix modules. Add the banking app to DenyList's exclusion list. Use Hide My Applist to hide Magisk from the system. ❓ How to remove Magisk and return the phone to stock state? To completely remove the root and return the device to its original state: Download the stock firmware for your model from the official Xiaomi website. boot.img fastboot flash system system.img fastboot flash vendor vendor.img fastboot -w Lock the bootloader back (optional, but recommended for warranty): fastboot oem lock ⚠️ After this command, the device will perform a reset to factory settings! If you just need to remove Magisk but leave the unlocked bootloader, swipe through the original one. boot.img/init_boot.img data-free. ❓ Does Magisk work on Xiaomi with HyperOS? Yes, but with reservations: βœ… Supported models on HyperOS 1.0 (for example, Xiaomi 14, Redmi K70) Using Magisk Delta 25.2+. ⚠️ On certain devices (e.g, POCO X6 Pro) required to be deactivated AVB 2.0 in Magisk settings before patching. ❌ It does not work on beta versions of HyperOS (due to dynamic partitions and a new signature verification mechanism). For HyperOS, we recommend using the fastboot boot method for temporary root (without firmware in boot): fastboot boot magisk_patched.img This will allow you to test the root without the risk of bootloop. ❓ Can you install Magisk on Xiaomi without a PC? Theoretically, yes, but in practice, it's extremely unreliable. There are methods using: Patch Boot Image Apps (requires a temporary root through an exploit), Termux with dd commands (risk of brick if you make a mistake). Custom recavers stitched through ADB sideload problems with these methods: ❌ No way to unlock the bootloader without a PC (Mi Unlock Tool required). ❌ High risk of errors in working with boot.img terminal. ❌ Most exploits don’t work on Android 13+. If you don’t have access to a PC, consider alternatives to rut: πŸ”§ ADB Shell rights (does not require root for many tasks). πŸ“¦ Island or Shelter to isolate applications. πŸš€ Shizuku for remote control through ADB.