Install Magisk on Xiaomi: from unlocking the bootloader to obtaining root rights

Getting root rights through Magisk on Xiaomi smartphones opens up access to advanced system features, from removing embedded software to fine-tuning performance. However, the installation process requires care – errors at any stage can lead to a device β€œbrick” or loss of warranty. In this guide, we will discuss the current way to install Magisk on Xiaomi in 2026, taking into account the latest changes in MIUI policy and SafetyNet requirements.

It is important to understand that the procedure is different for different models of Xiaomi/Redmi/POCO – there is no universal solution. For example, for Xiaomi 13 Pro with Android 14, you will need a different approach than for Redmi Note 10 on Android 12. We will look at the general algorithm with nuances for modern devices, and also tell you how to circumvent the limitations of MIUI and keep banking applications working.

1. Device Preparation: What to Do Before Installation of Magisk

Before you start unlocking the bootloader and running the TWRP firmware, you need to follow several critical steps, and skipping any of them can make it impossible to restore the system.

First, check your device’s CPU model. For Qualcomm Snapdragon smartphones (like Xiaomi 12T or POCO F5), the installation process will be easier than for MediaTek devices (like Redmi Note 12), where additional drivers are often required. You can find out the chipset model from the Settings menu β†’ About phone β†’ Full Specification.

  • πŸ“± Create a backup of all data (photos, contacts, messages) through MIUI Backup or third-party services like Google Drive. Once the bootloader is unlocked, all data will be erased!
  • πŸ”‹ The battery must be at least 70% charged, and interruption of the process due to discharge can render the device inoperable.
  • πŸ–₯️ Install. ADB For Windows, download Google's Platform Tools, for Linux, use Android-tools-adb.
  • πŸ”‘ Activate debugging on USB In the developer settings, click on the version 7 times. MIUI In the About phone menu, then turn on the option in Settings β†’ Additionally. β†’ For developers.

Pay special attention to the MIUI version. On some devices (e.g. Xiaomi 14), the bootloader can only be unlocked on Chinese or global firmware, but not on Russian. Check the current version in Settings β†’ About Phone β†’ MIUI version. If you have MIUI RU, you may need to flash it to MIUI EU or Global.

πŸ“Š What Xiaomi model do you use?
Redmi Note 12/Pro
POCO F5/X5
Xiaomi 13/14
Another model

2. Unlock the bootloader on Xiaomi: the official way

Since 2023, Xiaomi has tightened the rules for unlocking a bootloader, requiring you to link your Mi Account to your device and get permission through the official Mi Unlock Tool app, which can take anywhere from 7 to 30 days to combat device theft.

Here's the step-by-step instruction:

  1. Download Mi Unlock Tool from the official website and install it on PC.
  2. Log in to Mi Account on your phone and enable data synchronization.
  3. Connect your phone to your PC in Fastboot mode (clip Volume Down + Power when the device is off).
  4. Start the Mi Unlock Tool and follow the instructions. During the device check phase, the program may give a "Couldn't unlock" error, which means you have to wait (usually 168 hours).

If you see a message saying β€œThis device is locked” even after you wait, try:

  • πŸ”„ Reconnect the device to another USB-port (preferably) USB 2.0).
  • πŸ“΅ Disable antivirus on PC – it can block drivers.
  • πŸ”§ Use a different version of the Mi Unlock Tool (e.g. 5.5.224.30 instead of the last one).

Link Mi Account to your device|Enable debugging on USB|Install ADB/Fastboot PC-only|Download Mi Unlock Tool|Wait 168 hours (if required)-->

⚠️ Warning: Unlocking the bootloader resets the device to factory settings and cancels the warranty. On some models (for example, Xiaomi 13 Ultra) after unlocking, Widevine may stop working. L1 (drop down L3), What will make streaming on Netflix and Disney worse?+.

3. Installation of custom TWRP Recovery

Once you unlock the bootloader, the next step is to get the TWRP firmware (TeamWin Recovery Project) -- this custom recovery will allow you to install Magisk and other modifications -- and it's important to use a version of TWRP that's compatible with your Xiaomi model.

A list of officially supported devices can be found at twrp.me. Popular models like the Redmi Note 11 Pro+ or POCO X4 Pro are usually available stable builds. New devices (such as Xiaomi 14) may require an unofficial version from developer telegram chats.

Installation instructions:

fastboot flash recovery twrp-3.7.0_12-0-xiaomi.img


fastboot boot twrp-3.7.0_12-0-xiaomi.img

If you load the device into a standard MIUI backup after you've firmware, you've overwritten it.

  • πŸ› οΈ After the first loading in TWRP go straight through disable_forceencrypt.zip (If your device is using FBE β€” file-encryption).
  • πŸ”„ Reboot back to the TWRP via the fastboot boot command recovery.img.
  • πŸ“ Copy Magisk files and other files ZIP-Archives for Internal Memory through MTP into TWRP.
Xiaomi modelSupported version of TWRPFeatures
Redmi Note 12 Pro+3.7.0_12-0Required to disable forceencrypt
POCO F53.7.2_12-0Supports Android 13/14
Xiaomi 13Informal (A13)You need to patch boot.img manually
Redmi 10C3.6.2_11-0It works without additional fixings.

⚠️ Note: On devices with dynamic partitions (dynamic_partitions, for example, Xiaomi 12S Ultra) standard TWRP In this case, you need to use OrangeFox Recovery or patch it. boot.img via Magisk without installing a Recovery.

4. Magisk Installation: Two Ways (via TWRP and patching boot.img)

There are two main methods of installing Magisk on Xiaomi:

  1. TWRP is an easy way for most devices.
  2. Patching. boot.img β€” mandatory for devices with dynamic_partitions or off-duty TWRP.

Method 1: Installation via TWRP

  1. Download the latest Magisk ZIP (e.g. Magisk-v26.4.zip).
  2. Reboot to TWRP (Loudness Up + Power).
  3. Click Install β†’ select the downloaded ZIP β†’ swipe for confirmation.
  4. After installation, reboot to the system.

Method 2: Patching boot.img (for devices without TWRP)

  1. Download Magisk APK and install it as a regular app.
  2. Remove boot.img from your device’s firmware (you can download from Xiaomi Firmware Updater).
  3. In Magisk, click Install β†’ Select and Patch a File β†’ select boot.img.
  4. Patch file (magisk_patched.img) Copy it on PC and run through Fastboot:
fastboot flash boot magisk_patched.img


fastboot reboot

πŸ’‘

If after Magisk firmware the device loads into bootloop (cyclical reboot), try flashing the original boot.img back, and then repeat the patching with the MagiskDelta module disabled (if it was activated).

5. Root-rights check and SafetyNet bypass

Once Magisk is installed, you need to check the functionality of the root rights and the status of SafetyNet, which depends on whether banking applications (Sberbank, Tinkoff) and services like Google Pay will work.

To verify:

  1. Open the Magisk app and make sure the status says "Installed."
  2. Set up SafetyNet Test and check the status of ctsProfile. If it's false, you need to use camouflage.

To bypass SafetyNet:

  • 🎭 In Magisk, go to Settings. β†’ Mask masking and enable the option.
  • πŸ”„ Install Universal SafetyNet Fix and MagiskHide Props Config via Magisk β†’ Modules. β†’ Download from the repository.
  • πŸ“± Restart the device and re-check SafetyNet.

If the banking applications still do not work, try:

  • 🏦 Add the app to the masking list (MagiskHide).
  • πŸ”„ Reinstall the application after obtaining root rights.
  • πŸ“± Use alternative versions of applications (for example, Sberbank Online for Android 8)+).
What if SafetyNet doesn’t go away even after all the fixes?
In some cases (especially on Xiaomi). 13/14 Android 14) You may need to roll back to an older version of Magisk (for example, the same as the previous version, v25.2 instead v26.4). Also check if conflicting modules like Xiaomi are installed. EU Patch or Disable Flag Secure. If the problem persists, try flashing Magisk into the recovery section instead of boot (you need to patch it for this). recovery.img similarly boot.img).

Possible problems and solutions

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

Problem.Possible causeDecision
The device does not load (bootloop)Incompatible version of Magisk or TWRPSwitch the original boot.img through Fastboot
Magisk does not define root rightsIncorrectly patched boot.imgRepeat patching with disabled modules
Google Pay is not working.SafetyNet does not passInstall Universal SafetyNet Fix and enable masking
TWRP does not see internal memoryFBE encryption is enabledSweep disable_forceencrypt.zip

If Magisk has stopped working after installation OTA-updates, that's okay -- custom recavery blocks them:

  1. Download the full firmware package (.zip) for your model with Xiaomi Firmware Updater.
  2. Write it through TWRP (no wiping!).
  3. After the update, re-sweep Magisk.

πŸ’‘

On devices with Android 13/14 and MIUI 14/15, it is recommended to use Magisk Delta (the fork of the original Magisk) - it better supports new versions of MIUI and has additional features to bypass restrictions.

7.How to remove Magisk and return the device to its original state

If you need to return the warranty or sell the device, you must completely remove Magisk and traces of root rights.

  1. Open the Magisk app and click Delete β†’ Complete Delete.
  2. If the device doesn’t boot, run the original boot.img through Fastboot:
fastboot flash boot stock_boot.img


fastboot reboot

For a complete reset to factory settings:

  • πŸ”„ Reboot to MIUI Recovery (Loudness up) + Nutrition).
  • 🧹 Choose Wipe Data β†’ Wipe All Data.
  • πŸ”„ Reset the device.

After that, all the data will be erased and the bootloader will remain unlocked. To block it back, use the command:

fastboot oem lock

⚠️ Attention: Locking the bootloader after installing custom firmware can lead to a "brick".Before this operation, make sure that the device is official firmware Xiaomi without modifications.

FAQ: Frequent questions about installing Magisk on Xiaomi

Can I install Magisk without unlocking the bootloader?
No, on all modern Xiaomi devices (starting in 2018), unlocking the bootloader is mandatory.The only exception is the use of vulnerabilities like DirtyPipe, but they are closed in the latest versions of Android 13/14.
Why are banking applications not working after Magisk is installed?
Banking applications check system integrity through SafetyNet and Play Integrity API. If ctsProfile returns false, applications block access. Solution: Install Universal SafetyNet Fix and MagiskHide Props Config. Include cloaking in Magisk settings. Add a banking app to the MagiskHide list. If it doesn't work, try using the bank's web version or alternative applications (e.g. Tinkoff Business instead of the main one).
How to upgrade Magisk to Xiaomi?
Magisk update comes through the app itself: Open Magisk β†’ Click on the update icon at the top. Download the new version (.apk or.zip). If you update with.zip, run it through the new version. TWRP or Magisk (Install section) β†’ Install to Inactive Slot. After the update, restart the device. boot.img, It needs to be repainted.
Can I install Magisk on Xiaomi? MIUI for Russia (MIUI RU)?
On most MIUI RU devices, unlocking the bootloader is possible, but there are nuances: Some models (for example, the Redmi Note 11 for Russia) have additional limitations. Once unlocked, you may need to firmware the global or European version of MIUI for the correct operation of the TWRP. MIUI RU often disabled some functions (for example, Google Apps), which may interfere with the work of Magisk. It is recommended to reflash MIUI Global or MIUI EU before installing Magisk.
What if the camera or sensors stopped working after Magisk was installed?
This problem is typical for Android 12+ devices and is associated with a violation of the integrity of the vendor or odm partitions. Solutions: Sweat the original vendor.img and odm.img through Fastboot. Remove conflicting Magisk modules (for example, Xiaomi Camera Patch). Try another version of Magisk (for example, v25.2 instead of v26.4). If the problem remains, perhaps your Xiaomi model requires a special patch for the camera (for example, Xiaomi 13 Pro needs a LeicaCameraFix module).