How to install Magisk on Xiaomi: a complete guide to unlocking the bootloader

Installing Magisk on Xiaomi smartphones opens up access to root rights, custom modules and advanced Android capabilities, but the process requires care. Unlike other brands, Xiaomi devices have a secure bootloader that must be unlocked before any manipulation of the system (TWRP, OrangeFox is simply impossible.

In this article, we will discuss three officially supported methods of installing Magisk on the Internet. Xiaomi/Redmi/POCO into 2026 year: through patching boot.img (recommended method), firmware custom Recovery, as well as an alternative method for devices with a locked loader (with restrictions). MIUI 14/15 Android 13/14, where standard instructions often fail.

We warn you that improper actions can lead to a β€œbrick” (complete failure) of the device or loss of warranty. If you are a beginner, follow the instructions carefully and do not miss the steps of the check.

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

Before starting the procedure, make sure your smartphone meets the minimum requirements:

  • πŸ“± Device model: All smartphones are supported Xiaomi/Redmi/POCO based on Qualcomm Snapdragon or MediaTek (except devices with A/B Partitions in Dynamic Partition mode, for example, Xiaomi 12T).
  • πŸ”§ Version. MIUI: Current firmware MIUI 14/15 (Global/EEA/China). For older versions (below) MIUI 12.5) Additional steps may be required.
  • πŸ”’ bootloader status: Unlocked bootloader (required!). Check status with fastboot oem device-info command - Device unlocked: true should be displayed.
  • πŸ“Ά Backup: Create a backup of important data through Settings β†’ Google β†’ Backup or Mi Cloud.Magisk's installation will reset some settings.

Also prepare:

  • πŸ’» Windows PC 10/11 Linux (macOS is not recommended due to driver issues) ADB/Fastboot).
  • πŸ”Œ Cable USB Type-C (original, undamaged) - the use of poor-quality cables is a common cause of firmware errors.
  • πŸ“¦ Archive with tools: Platform Tools (ADB/Fastboot) Google's latest version of Magisk (APK + ZIP). TWRP Or OrangeFox for your model (optional).

⚠️ Attention: On devices with MIUI 15 Android 14 (for example, Xiaomi 13 Ultra, Redmi Note 12 Pro+) standard-patching boot.img It may not work because of the changed partition structure. init_boot. In this case, you will need to patch. init_boot.img instead boot.img.

πŸ“Š What Xiaomi model do you use?
Redmi Note 11/12
POCO F4/F5
Xiaomi 12/13
Another model

2 Unlock bootloader on Xiaomi

Unlocking the bootloader is a must-have without which Magisk installation is impossible. Xiaomi officially allows unlocking, but the process requires a Mi Account and a wait (usually 7-15 days).

Steps to unlock:

  1. Activate Developer Mode: Go to Settings β†’ The phone. β†’ Version. MIUI And tap the build number 7 times. Go back to Settings. β†’ Additionally. β†’ For developers and include: πŸ”“ Unlocking OEM (It may not be available on some models). πŸ”Œ Debugging by USB.

Attach Mi Account to your device:

Go to Settings. β†’ Xiaomi account and log in. Make sure your account is verified by email/phone.

Download the Mi Unlock Tool and launch it on your PC. Sign in with the same Mi Account as your phone.

Connect your smartphone in Fastboot mode (turn off the device, then press Volume down). + In Mi Unlock Tool, press Unlock.

You have to wait to submit your request. You can check the unlock status in the same tool. On some models (for example, Xiaomi 13 Pro), the latency can be up to 30 days due to tightened security policies.

⚠️ Warning: If you see a "Couldn't unlock" or "Device not supported" error when unlocking, try: Use another cable/port USB. Disable the antivirus on your PC (it can block the Mi Unlock Tool). Try another Windows PC 10/11 (on Linux/macOS tool).

Linked to the Mi Account to the device|Debugging is on. USB|Drivers installed ADB/Fastboot|The smartphone is charged at least by 60%|Data backup created-->

3. Receiving the file boot.img patching

To install Magisk without custom recavator will require an original file boot.img (or init_boot.img Android 13/14). It can be extracted in two ways:

Method 1: From the official firmware (recommended)

  1. Download Fastboot firmware for your model (the version should match the one installed on the device!).
  2. Unpack the archive.tgz β†’ find the file boot.img picture-folder.

Method 2: From the current system (if there is no firmware)

  1. Install Magisk. APK on a smartphone (do not run it!).
  2. Connect the device to the PC and execute the commands: adb shell su dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/boot.img For Android. 13/14 Use: dd if=/dev/block/bootdevice/by-name/init_boot of=/sdcard/init_boot.img
  3. Copy the file from your phone to your PC: adb pull /sdcard/boot.img

If none of the methods worked, try using the Xiaomi BootIMG Extractor (for Windows).

Xiaomi modelPatching file typeNotes
Redmi Note 10 Pro, POCO X3 Proboot.imgStandard method, no features.
Xiaomi 12/13, Redmi K50 Proinit_boot.imgMagisk 26.0 required+ and patching through fastboot.
POCO F5, Redmi Note 12 Turboboot.img or init_boot.imgDepends on the version. MIUI. Check out the fastboot getvar all.

πŸ’‘

If, in the extraction boot.img If you get a β€œPermission denied” error, try first to get root rights through the Magisk temporary patch (the β€œDirect Install” method in Magisk). APK).

4. Patching. boot.img Magisk installation

When you have the original boot.img (or init_boot.img), It needs to be modified with Magisk, which is considered the safest method, because it doesn't require custom Recovery firmware.

Step-by-step:

  1. Copy the file. boot.img on your smartphone (in the root folder or Download).
  2. Open Magisk. APK, press Install β†’ Select and Patch a File and select the copied file. After processing, the new file will appear in the Download folder called magisk_patched_[random].img.
  3. Copy the patched file back to PC: adb pull /sdcard/Download/magisk_patched_*.img
  4. Reboot your smartphone in Fastboot and run the patched file: fastboot flash boot magisk_patched_*.img For Android 13/14: fastboot flash init_boot magisk_patched_*.img
  5. Reboot the device: fastboot reboot

After the reboot, check for root rights through Magisk APK If Magisk is not identified, repeat the process with another file. boot.img (You may not have downloaded the firmware for your version. MIUI).

⚠️ Note: On some devices (e.g. Xiaomi) 11T Pro) after patching boot.img Anti-Rollback protection leading to the brick may be triggered. Before you start, check the anti version via the command: fastboot getvar anti If the value is higher 3, Use the firmware with the same or newer version of the anti.

What if after the firmware Magisk device fixated on the logo?
If the smartphone does not load beyond the logo MI, Follow the following steps: Load to Fastboot (Loudness Down) + Meals. Please make the original boot.img Back: fastboot flash boot boot.img If it doesn’t work, reset via fastboot erase userdata (data will be deleted!).

5. Alternative method: installing Magisk through TWRP

If patching boot.img not working or you prefer to use custom Recovery, you can install Magisk through TWRP This method is suitable for advanced users, as it requires additional manipulation of partitions.

Advantages of the method:

  • πŸ”„ The ability to create a full backup system (Nandroid backup).
  • πŸ“¦ Convenient installation of custom firmware and modules.
  • πŸ› οΈ Easy recovery after failures.

Disadvantages:

  • ⚠️ Risk of data damage due to incorrect actions.
  • πŸ”’ On some Xiaomi models (e.g. Redmi) K60) TWRP may not support encryption /data.

Instructions:

  1. Download. TWRP For your model (.img format) Make sure that the recovery version is compatible with your firmware!
  2. Please. TWRP Fastboot: Fastboot Flash Recovery twrp-3.7.0-*.For devices with Dynamic Partition (e.g. Xiaomi) 12T) Use: Fastboot Flash recovery_ramdisk twrp-*.img
  3. Boot in. TWRP (Loudness up + Power on. If the recaveri requests a password, enter PIN-code of your device.
  4. V TWRP Go to Install. β†’ select the file Magisk-v26.4.zip (download it in advance!) β†’ run through.
  5. After installation, run the Reboot System. TWRP suggest disable_forceencrypt β€” Refuse (this could disrupt the job) MIUI).

If, after the reboot, TWRP It's replaced with a stock Recovery, re-sweeten it, and then immediately install Magisk without rebooting. TWRP, use of the module TWRP A/B Permanent Installer.

πŸ’‘

On devices with MIUI 15 Android 14 (for example, Xiaomi 14) Magisk installation through TWRP This may result in loss of data in the section /data. It is recommended to use the patching method init_boot.img.

6. Checking of efficiency and elimination of errors

After installing Magisk, you need to make sure everything works correctly.

  • πŸ” Magisk Status: Open the Magisk app β†’ Dashboard section: All lines must be green (Installed, Enabled).
  • πŸ“± Root Checker from Play Market and run the checker, you can also type in the terminal: su If you have a license request, Magisk works.
  • πŸ”„ Updates MIUI: After installing Magisk, do not update through OTA! This will result in the loss of root rights. Updates must be installed manually (see section below).

Common mistakes and their solutions:

Mistake.Reason.Decision
Magisk is not installedImproperly stitched boot.img or TWRP leftless.Repeat the firmware of the patched file or reinstall Magisk through TWRP.
The device is fixated on Mi LogoIncompatible version boot.img or.Sweep the original boot.img through fastboot.
This package is for "Xiaomi" devices; this is a "".Wrong firmware TWRP (not for your model).Download the correct version TWRP official website.
Loss of network after installation of MagiskSome Magisk modules conflict with the modem.Disable all modules in Magisk and restart.

If Google Pay, Banking Apps or SafetyNet stop working after installing Magisk, activate MagiskHide (newer versions – Configure DenyList) and add problematic apps to the list.

7.Update MIUI magisk-in-place

One of the main problems after installing Magisk is the inability to update. MIUI through OTA. If you try to upgrade in the standard way, you will get an error "Update failed" or lose root rights. To upgrade without losing Magisk, follow this instruction:

Method 1: Manual installation OTA Preserving Magisk (recommended)

  1. Download the full package OTA (Not incremental!) for your model from the Xiaomi Firmware website.
  2. Rename the file to update.zip and place it in the root of the device memory.
  3. Open Magisk. β†’ Install β†’ Install to Inactive Slot (After OTA). If this option is not available, select Select and Patch a File and patch update.zip.
  4. Reboot to TWRP (if installed) or stock recavers (Loudness upwards) + Nutrition).
  5. Install. update.zip (If you have patched, select the patched file).
  6. After the update, re-sweep Magisk: fastboot flash boot magisk_patched_*.img

Method 2: Fastboot (for power users)

If OTA-Update is not available, you can flash the full firmware through fastboot:

  1. Download the Fastboot firmware for your model.
  2. Unpack the archive and run the script flash_all.bat (Windows) or flash_all.sh (Linux).
  3. After firmware re-install Magisk via patching boot.img.

⚠️ Warning: When you update via fastboot, all data on the device will be erased! TWRP Mi Cloud.

8. Additional advice and recommendations

After successful installation of Magisk, you can expand the functionality of your Xiaomi with modules and tweaks.

  • 🎯 Magisk: SecureTask – Ad Blocking in the Internet MIUI. ViPER4Android β€” MagiskHide Props Config – Replacement of the device (for example, to bypass restrictions in games).
  • πŸ”’ Security: Do not install modules from unverified sources - they may contain malicious code.Regularly update Magisk through the app (Updates section).
  • πŸ”§ Warranty Recovery: To return the device to stock state, slick through the original boot.img and run fastboot erase userdata. To completely remove Magisk traces, use unMagisk script.

If you plan to use Magisk for game cheats (for example, in the PUBG Mobile or Genshin Impact, note that many games block root-right devices. In this case, the Hide My Applist module, which hides Magisk from the anticheat detector, will help.

πŸ’‘

To speed up charging on Xiaomi devices with Magisk, install the Fast Charge for module MIUI. He's turning off the restrictions. MIUI charge-current.

FAQ: Frequent questions about installing Magisk on Xiaomi

❓ Can you install Magisk on Xiaomi without unlocking the bootloader?
No, bootloader unlocking is mandatory. Without it, no Magisk installation method will work. The only exception is a temporary root through exploits (like DirtyPipe), but it doesn't give full access and only works until it's rebooted.
❓ Why Google Pay is not working after installing Magisk?
This is related to SafetyNet, the Android Integrity Checker. To fix: Turn on MagiskHide (newer versions of Configure DenyList), add Google Play Services and Google Pay to the hidden app list, install Universal SafetyNet Fix. Reboot your device. If it doesn't work, try MagiskHide Props Config and change the device fingerprint to a certified one.
❓ How to Upgrade Magisk to Xiaomi?
Magisk update comes through the app itself: Open Magisk β†’ Updates section. Press Download and wait for the download. Select Install β†’ Direct Install (Recommended). Reboot your device. If Magisk stops working after the update, repeat the patching process. boot.img newer.
❓ Can I install Magisk on Xiaomi with a MediaTek processor?
Yes, but there are nuances: On most MediaTek devices (like Redmi Note) 11, POCO M4 Pro) Magisk is installed in the standard way, through patching boot.img. On some models (e.g. Redmi) 10C) You may need to disconnect AVB 2.0 (Android Verified Boot via command: fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img For Dynamic Partition devices (e.g. Redmi Note) 12) use init_boot.img instead boot.img. Check the compatibility of your model on the XDA-Developers forum before you start.
❓ How to Remove Magisk and Return Stock Firmware?
To return the device to its original state: Download the official Fastboot firmware for your