Installation of Magisk on Xiaomi through TWRP: Complete guide with unlocking the bootloader and solving errors

Getting root rights on Xiaomi smartphones through Magisk remains one of the most popular ways to expand the functionality of the device, from removing embedded software to fine-tuning performance. TWRP It requires not only technical training, but also taking into account the nuances of specific Xiaomi models – especially with the release of the new model. MIUI 14/15 In this article, we'll go all the way from unlocking the bootloader to the final root-right check, with a focus on common mistakes and their solutions.

It’s important to understand that the procedure is different for devices on Qualcomm Snapdragon and MediaTek, and also depends on the firmware version.+ Android 14: The bootloader unlock algorithm has changed compared to Poco F3 We'll look at the universal steps and point out the critical differences between the chipsets. If you're a beginner, don't skip the preparation section: the wrong version. TWRP or a missed backup may lead to a "brick" of the device.

According to the Forum's statistics XDA Developers, about 30 percent of the errors in Magisk installation are due to the incompatibility of recovery and firmware versions, and another 20 percent to the incorrect unlocking of the bootloader, and to minimize the risks, we structured the instructions into logical blocks with verification at each step. Also in the article you will find current links to official and alternative sources of files (at the time of 2026).

1.Preparation of the device: what to do before installation

Before you start unlocking the bootloader and installing Magisk, there are a number of mandatory steps that you need to follow, and ignoring them can lead to data loss, firmware failure, or even device failure, starting with compatibility testing.

First, make sure your Xiaomi model officially supports bootloader unlocking.A list of compatible devices can be found on the Mi Unlock website.For example, Xiaomi 13 Ultra and Redmi K60 Pro is supported, but some regional versions (e.g. India) may have limitations. MIUI: For stable builds, the unlocking process is easier than for Developer ROM.

Second, prepare the necessary tools and files:

  • πŸ“± Xiaomi smartphone with a battery charge of at least 70% (to avoid shutdown during the process).
  • πŸ’» Computer running Windows 10/11 (Mi Unlock Tool is required for Windows).
  • πŸ”Œ Original. USB-cable (better to use the one that came with the device).
  • πŸ“ Files: Mi Unlock Tool (last version from official website). TWRP for your model (only download from trusted sources, such as twrp.me or thematic branches) XDA). Magisk (up-to-date.zip with GitHub). Full ROM For your model (in case of recovery).

The third step is to back up data, data, some applications (such as banking) may stop working on a rooted device.

  • πŸ”„ Mi Cloud for synchronizing contacts, notes and photos.
  • πŸ“‚ Local copying of important files to a PC or external drive.
  • πŸ“‹ Exports SMS and call logs through applications like SMS Backup & Restore.

⚠️ Note: If your device has enabled data encryption (Settings) β†’ Additionally. β†’ Encryption, be sure to disable it before installation TWRP. Otherwise, recovery will not be able to mount the partition. /data, And you lose access to the files.

πŸ“Š What Xiaomi model do you use?
Redmi Note Series Series Series
Poco F/XT series
Xiaomi 11/12/13 series
Redmi K Series Series
Another model

2. Unlocking the bootloader: step-by-step instructions

Unlocking the bootloader is the most important step, as it irreversibly resets the device to factory settings. Xiaomi has introduced additional security measures, so the process can take up to 7 days (depending on the Mi Account policy).

Step 1: Link your Mi Account to your device.

  1. Go to Settings β†’ Xiaomi Account and log in.
  2. Turn on data synchronization and wait for the process to be completed.
  3. Go to Settings β†’ About Phone β†’ MIUI version and tap 7 times on the line to activate Developer Mode.
  4. Return to Settings β†’ More β†’ For developers and enable: Debugging by USB Unlock OEM (an important item!)

Step 2: Connect your device to your PC and launch the Mi Unlock Tool, and the program will automatically check if your account is linked to your device, and if it is not, the message "Add account and device" will appear.

  • Disconnect the device from the PC.
  • Reboot it.
  • Connect to a mobile network or Wi-Fi (required!).
  • Re-sign in to your Mi Account and wait. SMS or push-based binding notifications (may take up to 24 hours).

Step. 3: Reconnect the device to your PC, launch the Mi Unlock Tool, and press Unlock. 5-10 When completed, the device will automatically restart and reset to factory settings.

⚠️ Note: If the Mi Unlock Tool gives you a "Couldn't unlock" error with code 86006 or 86012, this means that the account is not tied to the device. Solution: wait 72 hours (for new accounts) or 7 days (if you previously unlocked another device). β†’ Xiaomi account β†’ Security enabled option "Search for device".

Mi Account is tied to the device|Debugging is on. USB|Unlocking enabled OEM|The device is connected to the Internet|Data backup made.-->

Installation TWRP: versioning and firmware

After unlocking the loader, you need to install custom recovery β€” TWRP. The main thing is to choose the right version for your model and version. MIUI. For example, the Redmi Note 11 Pro+ 5G (MediaTek Dimensity 920 requires a special build TWRP, As standard does not support chipsets MediaTek.

Step 1: Download the correct version TWRP. Verified sources:

  • πŸ”— Official website: twrp.me (see model code, for example, vili for Xiaomi 12 Pro).

Step 2: Install TWRP It's a fastboot:

  1. Unpack the archives with TWRP and rename the file to twrp.img.
  2. Transfer the device to fastboot mode: turn it off, then press Volume down + Nutrition.
  3. Connect to your PC and execute the command: fastboot flash recovery twrp.img
  4. After a successful firmware immediately go to TWRP, holding up + Power (otherwise the system will re-write recovery!).

Step 3: B TWRP perform the following actions:

  • πŸ”§ Go to Wipe. β†’ Format Data, enter yes and confirm (this will remove encryption and allow partition mounting). /data).
  • πŸ”„ Reboot back to the TWRP (off-the-shelf!).
  • πŸ“ Copy the Magisk file (Magisk-v26.4.zip) device MTP (into TWRP Choose Mount β†’ Enable MTP).

⚠️ Attention: On Android devices 13/14 and MIUI 14/15 standard method of firmware Magisk via Install in TWRP It might not work because of the bootloader's signature check. boot.img (described in the following section).

What if TWRP doesn’t see internal memory?
After installation TWRP section /data It's not mounted, it means encryption is enabled: 1. V TWRP Choose the Wipe β†’ Format Data (this will delete all data!). 2. Reboot to TWRP and check the mounting. 3. If the problem persists, download the alternative version. TWRP supportive FBE (File-Based Encryption for your model.

4. Magisk installation: two methods (classic and via patched boot)

There are two main ways to install Magisk on Xiaomi: classic (via firmware). ZIP into TWRP) and alternative (through the stained) boot.img). The second method is more reliable for new versions. MIUI, Bypassing the integrity of the system.

Method 1: Classical installation through TWRP

  1. V TWRP Click Install and select the file Magisk-v26.4.zip.
  2. Swipe to confirm the firmware.
  3. After completion, press Reboot System.

If the device loads normally, the root rights are installed. Check this with the Magisk Manager app (should appear in the app menu).

Method 2: Installation via patched boot.img (recommended MIUI 14/15)

  1. Download the full firmware (Fastboot) ROM) For your model from the Xiaomi website.
  2. Remove the boot.img file from the archive (located in the image folder).
  3. Copy. boot.img On the device and in Magisk Manager, select Install β†’ Select and Patch a File.
  4. After patching, copy the received file magisk_patched.img PC-only.
  5. Fastboot: Fastboot Flash Boot magisk_patched.img
  6. Reset the device.

The advantage of the second method is that it does not affect the recovery section, which reduces the risk of conflicts with updates. MIUI. However, after each update, the patching procedure will have to be repeated. boot.img.

πŸ’‘

If after installing Magisk device fixated on the Xiaomi logo, try flashing the original boot.img You can use fastboot, and then you can do it again with the patch, and it often solves the problem.

5. Root-Rights Check and Solving Typical Errors

After installing Magisk, you need to make sure that the root rights work correctly.

  1. Open the Magisk Manager app (should appear automatically).
  2. Check the status at the top of the screen: it should be written "Installed" and the version specified.
  3. Click Check SafetyNet (if the test fails, install the Universal SafetyNet Fix module in the Modules section).

If there is no root license or the device does not boot, use the table of typical errors and their solutions:

Mistake.Reason.Decision
Magisk not installedWrong firmware ZIP or reset after installationRepeat installation through TWRP, Then restart the system immediately (not in recovery!).
The device is locked in the loading.Patch conflict boot.img or an incompatible version of MagiskStitch the original boot.img via fastboot, then repatch with another version of Magisk.
SafetyNet failedChanges to the system section are detectedInstall Universal SafetyNet Fix and enable Enforce DenyList in Magisk settings.
TWRP asks for password when mounting /dataResidual encryption after formattingEnter the old screen lock password or run Format Data again.

If none of the solutions worked, try:

  • πŸ”„ Sweep the full Fastboot ROM The Mi Flash Tool (Clean All Option).
  • πŸ“± Install another version TWRP (For example, an unofficial build with support for Android 14).
  • πŸ› οΈ Contact the forum XDA or in a thematic chat (specify the device model and version) MIUI).

πŸ’‘

If banking applications (such as SberBank or Tinkoff) have stopped working after installing Magisk, turn on the β€œDenyList” option in Magisk and add these applications to the exclusion list.

6. Update system with Magisk: how not to lose root rights

One of the main problems after obtaining root rights is updating MIUI. Standard Update through Settings β†’ Updating the system will cause the loss of Magisk, because it overwrites the boot partition. To save the root rights, follow this algorithm:

Method 1: Update through TWRP (recommended)

  1. Download the full update package (Recovery) ROM) for your model.
  2. Reboot to TWRP and set ZIP-update.
  3. Don't reboot! Slice Magisk right away (if you use the method with the boot.img, first patch the new one boot.img revamped).
  4. Clear the cache (Wipe) β†’ Cache/Dalvik) and reboot.

Method 2: Update via Fastboot (for power users)

  1. Download Fastboot ROM and unpack it.
  2. Remove the image file from the folder boot.img (so as not to overwrite the patched).
  3. Sweep through the Mi Flash Tool with the clean all and lock option (no bootloader lock!).
  4. After the update, re-sweep the patched boot.img.

Important: After the update MIUI You may need to re-activate DenyList in Magisk and reinstall modules (such as SafetyNet Fix.

7.Optimization and security after installation of Magisk

Getting root rights opens up a lot of options for Xiaomi to set up, but it also requires attention to security.

Optimizing productivity:

  • πŸš€ Install Magisk module for management CPU/GPU (For example, KernelSU or PowerHALT).
  • πŸ—‘οΈ Remove the embedded software (bloatware) with Debloater or ADB (Careful – Removing system applications can disrupt stability!).
  • πŸ”‹ Optimize battery consumption with Greenify or Battery Charge Limit (to limit charge to 80%).

Safety:

  • πŸ”’ Include DenyList in Magisk and add banking apps, security games (e.g., scalables, PokΓ©mon GO), and applications DRM (like Netflix).
  • πŸ›‘οΈ Install MagiskHide Props Config to mask root rights for certain devices (useful for bypassing locks).
  • πŸ”„ Update Magisk and modules regularly through Magisk Manager (Updates).

Backup:

  • πŸ“¦ Use it. TWRP to create a full backup section /data (In the Backup menu, select Data, Boot, System).
  • πŸ”§ Keep a copy of the patched boot.img original recovery.img PC-only.
  • πŸ“ Keep a log of installed Magisk modules (name and version) to quickly restore them after resetting.

⚠️ Note: If you use Xiaomi with unlocked bootloader and root rights, avoid installing updates through the OTA (They may contain system integrity checks that lead to bootloop. Always update manually through TWRP or fastboot.

FAQ: Frequent questions about installing Magisk on Xiaomi

Can I get a root right on Xiaomi without unlocking the bootloader?
No, on modern Xiaomi devices (starting with the MIUI 12) Unlocking the bootloader is mandatory. There used to be exploits to bypass (like DirtyCOW), but they are closed in newer versions of Android. ADB (For example, for some models on MediaTek, but it disappears after a reboot.
Why Magisk doesn't stitch through TWRP on MIUI 14?
V MIUI 14 Xiaomi has introduced additional proof of the bootloader signature (dm-verity). TWRP Solution: Use the patch method. boot.img (described in section 4). Also make sure you have the latest version. TWRP Android-enabled 13/14.
How to return the device to its original state (unroot)?
To completely remove Magisk and return the device to factory state: Download the full Fastboot ROM For your model, run it through the Mi Flash Tool with the clean all and lock option (this will block the bootloader and delete all data). If you want to save data, pre-backup through the TWRP. Alternative way (without locking the bootloader): in Magisk Manager, select Uninstall β†’ Complete Uninstall, then go through the original boot.img.
Can I install Magisk on Xiaomi with a MediaTek processor?
Yes, but the process is more complicated than for Qualcomm Snapdragon devices. TWRP (For example, from wrztky developer for Redmi Note 10 Pro. Some models (e.g. Poco) X3 Pro on Helio. G96) protect SLA (Secure Launch Area, which blocks changes to boot. SP Flash Tool.Be sure to check compatibility on the forum before you run the firmware. XDA or in thematic chat rooms.
Will Google Pay and banking apps work after Magisk is installed?
Yes, but you do: Enable DenyList in Magisk and add Google Pay, SberBank, etc. Install Universal SafetyNet Fix (download Magisk repository). In Magisk settings, turn on Enforce DenyList and Zygisk. Reboot the device. After that, most of the apps will work, but some banks (like Tinkoff) can block access. In this case, try the MagiskH Props Config module and change the device fingerprint to the one supported.