How to install Magisk on Xiaomi: from unlocking the bootloader to root rights

Getting root rights on Xiaomi smartphones through Magisk gives you access to deep customization, removal of firmware and use of modules that are not available to ordinary users. A mistake at any stage can lead to a device β€œbrick” or loss of warranty. In this article, we will analyze step-by-step instructions for modern Xiaomi models (including Redmi and other Xiaomi models). POCO) base MIUI 14/15 Android 13/14, In view of the latest changes in the company’s security policy.

Magisk’s concept is radically different from the classic SuperSU: it provides root access through system patches without affecting the partition. /system, But before you install it, it's important to understand that unlocking a bootloader on Xiaomi is an irreversible process that resets the device to factory settings and erases all the data?

πŸ“Š Why you need a root rights on Xiaomi?
Removal of embedded applications MIUI
Installation of custom firmware
Use of Magisk modules (ViPER4Android, LSPosed)
Processor/GPU overclocking
Other

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

Before you start unlocking the bootloader and installing Magisk, follow the mandatory preparatory steps. Ignoring them can make it impossible to restore the device through standard tools. MIUI.

First, check your smartphone model and version. MIUI. To do this, go to the Settings. β†’ Write down the exact name of the model (e.g. Redmi Note). 12 Pro+ 5G, Not just a note. 12") and firmware version (e.g, V14.0.4.0.TMCCNXM). This information will be required to download the correct boot.img and TWRP.

Second, make sure the device has disabled the β€œFind My Device” feature (on some models it blocks unlocking the bootloader).

  • πŸ”’ Go to Settings. β†’ Google β†’ Security β†’ Find My Device and Turn It Off.
  • πŸ”„ Back up your important data (photos, contacts, messages) to your PC or cloud. Once the bootloader is unlocked, the device will be reset!
  • πŸ”‹ Charge the battery to at least 70%. interruption of the process due to battery discharge can make the phone inoperable.
  • πŸ’» Prepare a PC with Windows 10/11 (or Linux/macOS with fastboot support and original USB-Wireless connections will not work.

Also download the necessary tools:

  • πŸ“± Official firmware MIUI For your model (select the Fastboot version, not the Recovery version).
  • πŸ”§ The latest version of Magisk (file) Magisk-v26.4.zip).
  • πŸ–₯️ Google Platform Tools (for fastboot and adb).
  • πŸ› οΈ Informal TWRP For your model (if available). Official builds are often outdated.

⚠️ Note: On devices with MediaTek processors (e.g. Redmi Note) 11 or POCO M4 Pro) unlocking the loader may take up to 7 days due to Xiaomi requirements. for Qualcomm Snapdragon (e.g. Xiaomi) 13 or POCO F5) process 2-3 hour.

2. Unlock the bootloader on Xiaomi: step-by-step instructions

Unlocking the bootloader is the most critical step. Xiaomi requires you to link your Mi Account to your device and wait for confirmation. Without this step, you can't install Magisk.

First, turn on the developer mode and allow debugging by USB:

  1. Go to Settings β†’ About phone and 7 times click on the MIUI version.
  2. Back to Settings β†’ Additionally. β†’ For developers.
  3. Activate the USB Debugging and OEM Unlock switches.
  4. Connect the phone to the PC and confirm the debugging permission.

Use the official Mi Unlock Tool tool:

  1. Download the Mi Unlock Tool and install it on PC.
  2. Run the program on behalf of the administrator and log in under the same Mi Account as on your phone.
  3. Transfer the device to fastboot mode: turn it off, then press Volume down + Nutrition.
  4. Connect your phone to your PC. The Mi Unlock Tool will have a wait message. For most models, it's 168 hours (7 days).

After the waiting period has expired:

  1. Re-start the Mi Unlock Tool and connect the phone in fastboot mode.
  2. Press Unlock. The process will take 1-2 minutes, after which the device automatically restarts and resets.

⚠️ Warning: If the phone does not turn on after unlocking or hovers on the logo MI, Don't panic. Try to boot up to fastboot. + Power) and repeat unlocking. If that doesn't work, you'll need to run the Mi Flash Tool firmware.

Mi Account Linked to Device|Find My Device is disabled|Unlocking enabled OEM developer-setting|Backup of all data.|The device is charged at more than 70%-->

Installation TWRP: Why is this necessary for Magisk?

TWRP (Team Win Recovery Project is a custom recovery project that allows you to install ZIP-files (including Magisk) and backup the system. on modern Xiaomi standard recovery from MIUI It blocks the installation of unofficial firmware, so TWRP β€” mandatory.

Installation process TWRP depends on the model of the device:

  • πŸ“± For Qualcomm Snapdragon devices (e.g. Xiaomi) 12T, POCO F4) The command is: fastboot flash recovery. twrp-3.7.0_12-1-tissot.img fastboot boot twrp-3.7.0_12-1-tissot.img (Replace the tissot with the code name of your model).
  • πŸ–₯️ For devices on MediaTek (e.g. Redmi Note) 12) You may need to patch vbmeta: fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img fastboot flash recovery twrp.img fastboot reboot recovery

After installation TWRP Create a backup copy of the boot section immediately:

  1. In TWRP, go to Backup.
  2. Select the Boot section and click Swipe to Back Up.
  3. Copy boot.emmc.win (or similar) file on your PC – you’ll need it for patching.

If, after the reboot, TWRP If you replace it with standard recovery, you have anti-Rollback protection on your model:

  1. Download the full firmware MIUI.tgz.
  2. Take the file out of it. boot.img.
  3. Use it to patch through Magisk (more on this in the next section).
What happens if TWRP is not installed?
If you try to sew TWRP You see a mistake. FAILED (remote: 'Not allowed in Lock State', which means the bootloader is not fully unlocked. Repeat the unlock process in Mi Unlock Tool. If the Invalid sparse file format at header magic error, download another version TWRP, model-designed.

4. Patching. boot.img Magisk: The key stage

Installation of Magisk on Xiaomi is not through firmware ZIP-file TWRP, It's through patching the original. boot.img. This is due to the specifics of protection. AVB 2.0, which checks the integrity of the boot partition.

Here's how to do it right:

  1. Download Magisk APK And install it on your phone (even without root licenses).
  2. Copy the file. boot.img (firmware-extracted TWRP) memory.
  3. Open Magisk, press Install. β†’ Select and correct the file and specify boot.img.
  4. Wait until the process is complete. A file will appear in the Download folder. magisk_patched-XXXXXX.img.
  5. Copy the patched one. boot.img PC-only.

Now, run the patchy boot.img fastboot:

fastboot flash boot magisk_patched-XXXXXX.img


fastboot reboot

If after the reboot Magisk does not appear in the list of applications or root rights do not work, then:

  • πŸ”„ You used the wrong version. boot.img (like from another firmware).
  • πŸ”§ You need to flash boot and dtbo on your model (for devices with Dynamic Partition).
  • πŸ“± The device has AB-section (A/B Partitions), and you need to flash both slots: fastboot flash boot_a magisk_patched.img fastboot flash boot_b magisk_patched.img

πŸ’‘

If after the patching boot.img phone is stuck on the screensaver, try booting into fastboot and execute the command fastboot flash boot original_boot.img, Then repatch the patching with the correct file.

5. Root rights check and Magisk setup

Once Magisk is successfully installed, you need to check the root rights and adjust the basic settings. Open the Magisk app β€” if it requests an update, agree.

To check root access:

  1. Install the Root Checker app from Google Play.
  2. Open it and press Verify Root. Congratulations! Root access is properly installed on this device!

If the root rights don't work:

  • πŸ”„ Reset the device.
  • πŸ”§ In Magisk settings, enable the Zygisk option (to bypass checks on some applications).
  • πŸ“± Make sure that in the settings β†’ Root access switch is enabled for developers (on some firmware) MIUI It's off by default).

To hide root rights from banking applications (e.g. SberBank Online or Tinkoff):

  1. In Magisk, go to Settings. β†’ Magisk cover-up.
  2. Enable the Enforce DenyList option.
  3. Add to the list of apps that should not detect root (e.g. com.sberbankmobile).
  4. Reset the device.

It is also recommended to install modules to improve functionality:

ModuleAppointmentCompatibility with MIUI
SecureTaskBlocking the background activity of applicationsβœ… Yes.
ViPER4AndroidAdvanced sound tuningβœ… Yes (requires SELinux in Permissive mode)
LSPosedAlternative to Xposed for Android 12+βœ… Yes.
Hide My ApplistHiding applications from other programsβœ… Yes.

⚠️ Attention: MIUI 14/15 certain modules (e.g, ViPER4Android) You can do this through the terminal with the su command. -c setenforce 0. However, this reduces the security of the system!

6. Solving common errors when installing Magisk

Even with the correct following of the instructions, users often face problems, and let's look at the most common errors and their solutions.

Error 1: "This package is for Xiaomi devices; this is a Google."

Reason: You are trying to flash Magisk through standard recovery MIUI, clampdown ZIP-file.

Solution: Install TWRP (as described in section 3) and stitch through it.

Error 2: The phone is stuck on the logo MI post-fix.

Causes and solutions:

  • πŸ”§ Wrong. boot.img β€” Sweat the original boot through fastboot and repeat the patching.
  • πŸ“± Conflict with modules - load into TWRP, delete the folder /data/adb/modules and reboot.
  • πŸ”„ Failure when firmware - perform a complete reset through TWRP (Wipe β†’ Format Data, then re-scan Magisk).

Error 3: Apps detect root despite DenyList.

Reason: Some applications (e.g, PokΓ©mon GO Netflix and other other systems use additional verification methods.

Decisions:

  • πŸ”§ Enable Zygisk in Magisk and add the app to DenyList.
  • πŸ“± Install Hide My Applist and hide Magisk from scanning.
  • πŸ”„ Rename the folder /magisk into /topjohnwu (via Root Explorer).

Mistake 4: It's not working OTA-update MIUI.

Reason: After installing Magisk, standard updates MIUI They are blocked because of the change. boot.img.

Decision:

  1. Download the full package OTA-manually.
  2. Get it out of him. boot.img And patch it up through Magisk.
  3. Fill in the update through TWRP, Then you can run the patch. boot.img.

πŸ’‘

If banking applications stop working after installing Magisk, do not rush to remove the root.Try the combination: Zygisk + DenyList + Universal SafetyNet Fix, which solves 90 percent of SafetyNet problems.

7.How to remove Magisk and return the device to a stock state

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

Method 1: Using the Magisk application (soft removal)

  1. Open Magisk and go to Settings.
  2. Click Delete Magisk β†’ Complete removal.
  3. Restart the device. The root rights will be removed, but the bootloader will remain unlocked.

Method 2: Through the firmware of the original boot.img (hard-excision)

  1. Download the original boot.img for your version of MIUI.
  2. Fastboot: Fastboot Flash boot Original_boot.img
  3. Perform the reset through TWRP (Wipe β†’ Format Data).

Method 3: Complete return to stock firmware

If you want to return the device to the β€œout of the box” state (including locking the bootloader):

  1. Download the full Fastboot firmware for your model.
  2. Unpack it and run it through the Mi Flash Tool with the clean all and lock option.
  3. The bootloader will be locked, but keep in mind: re-unblocking will require a wait of 7 days.

⚠️ Note: Once you lock the bootloader, you won’t be able to re-unblock it for 30 days (Xiaomi’s rule for some regions.

8.Alternative ways to get root rights to Xiaomi

If installing Magisk seems too complicated, consider alternative root-right methods, but note that they have limitations:

1. temporary root through ADB

Suitable for one-time tasks (e.g., uninstall system applications) does not require unlocking the bootloader, but the rights disappear after the reboot.

Command to activate:

adb shell


su-c "team"

2. firmware custom firmware with pre-installed rue

Some firmware (like LineageOS or Pixel Experience) already include Magisk.

  • πŸ”§ An unlocked loader is required.
  • πŸ“± Possible problems with the camera, NFC or sensors (due to lack of drivers) MIUI).
  • πŸ”„ Updates will have to be installed manually.

3. Use of exploits (e.g., DirtyCOW)

Suitable for older Android devices 7-9. On the new versions MIUI It does not work due to patched vulnerabilities.

Comparison of methods:

MethodRequires unlocking of the loaderPermanent rootCompatible with MIUI 14/15
Magisk (this guide)βœ… Yes.βœ… Yes.βœ… Complete.
Temporary rout through ADB❌ No.❌ No (before rebooting)βœ… Yes.
Custom firmwareβœ… Yes.βœ… Yes.⚠️ Partial (possible bugs)
Exploits (DirtyCOW)❌ No.⚠️ Depends on vulnerability.❌ No.

πŸ’‘

Magisk remains the only reliable way to get a full-fledged root on modern Xiaomi.

FAQ: Frequent questions about installing Magisk on Xiaomi

Can I install Magisk without unlocking the bootloader?
No. On all Xiaomi devices with Android 8+ Unlocking the bootloader is mandatory for Magisk installation. The exception is a temporary root through exploits, but it only works on older versions. MIUI.
Why are banking applications not working after Magisk is installed?
Banking apps check for root rights through SafetyNet. To get around lockdown: Enable Zygisk in Magisk. Install Universal SafetyNet Fix. Add a banking app to DenyList. If it doesn't, use a second work Profile without root rights.
How to update MIUI magisk-in-place?
Standard. OTA-Do this: Download the full service pack (.zip) for your model. boot.img And patch it through Magisk. TWRP (Install β†’ Choose. ZIP). Sweep the patchy boot.img Do not update via fastboot. β†’ Updating the system will lead to the loss of root rights!
Can I hide the unlocked bootloader from the applications?
The unlocked bootloader appears in fastboot as Device is. UNLOCKED, And some apps, like Google Pay, can check that, but the fact that you unlock it doesn't always block the apps -- the main problem is usually that you have root rights. To minimize the risks, use DenyList in Magisk. Turn off Magisk via the switch in the app (without removing it).
Which Xiaomi models don’t support Magisk?
Magisk currently works on all Xiaomi devices with Qualcomm Snapdragon and MediaTek processors, except for: Android Go devices (e.g. Redmi Go) Some models for the Chinese market with closed firmware (e.g. Xiaomi Mix Fold 3 in the first batches). Devices with HyperOS (new firmware from Xiaomi), where you may need a special version of Magisk. πŸ“– Read also: How to Unblock Xiaomi Mi3: Reset pattern lock Detailed instructions on how to unlock Xiaomi Mi3, If you forgot the graphic password. Reset via Rec How to reset Xiaomi to factory settings: step-by-step guide Detailed instructions for resetting Xiaomi to factory settings via menus, recavers and Fastboot. How to remove the lock screen on Xiaomi: 5 proven ways Step-by-step instructions for turning off the lock screen on Xiaomi smartphones (Redmi, POCO). How to Reset the Xiaomi Scooter 1S before factory settings: 3 ways Step-by-step instructions for resetting the Xiaomi Mijia scooter 1S via the app, buttons and ADB. Learn how to clean up your call log on Xiaomi Redmi 7A β€” 5 Ways to Delete Your Redmi Call History 7A How to Reset Your Password on Xiaomi: Full Guide Step-by-step Guide How to Reset Your Password in Xiaomi. Reset Your pattern lock, Mi Account and Goog πŸ“± XiaoMaster πŸ”“ Reset and release Β· βš™οΈ System setup Β· πŸ’Ύ Memory and files Β· πŸ”Š Sound and vibration Β· πŸ“Έ Camera and photo Β· πŸ“‘ Communication and network Home Β· About the project Β· Contacts Β· Privacy Β© XiaoMaster, all rights reserved. Accept document.getElementById('pbMenuBtn')?.addEventListener('click', () => { document.getElementById('pbMainNav')?.classList.toggle('pb-nav-open'); }); // Dropdown menu toggle (click for touch devices) document.querySelectorAll('.pb-dropdown-toggle').forEach(btn => { btn.addEventListener('click', (e) => { e.stopPropagation(); btn.closest('.pb-nav-dropdown').classList.toggle('pb-dd-open'); }); }); document.addEventListener('click', () => { document.querySelectorAll('.pb-nav-dropdown.pb-dd-open').forEach(d => d.classList.remove('pb-dd-open')); }); (function() { const popup = document.getElementById('cookie-consent'); const btn = document.getElementById('cookie-accept'); if (popup && btn &&!localStorage.getItem('cookie-accepted')) { setTimeout(() => popup.classList.add('pb-cookie-visible'), 1500); btn.onclick = () => { localStorage.setItem('cookie-accepted','true'); (function(d,s){d.getElementById("licnt06C4").src= "https://counter.yadro.ru/hit?t26.5;r"+escape(d.referrer)+ ((typeof(s)=="undefined")?"":";s"+s.width+"*"+s.height+"*"+ (s.colorDepth?s.colorDepth:s.pixelDepth))+";u"+escape(d.URL)+ ";h"+escape(d.title.substring(0,150))+";"+Math.random()})(document,screen) πŸͺ We use cookies to improve the operation of the website. popup.classList.remove('pb-cookie-visible'); }; } })(); function pbPollVote(el) { var poll = el.closest('.pb-poll'); if (poll.classList.contains('voted')) return; poll.classList.add('voted'); el.classList.add('selected'); var opts = poll.querySelectorAll('.pb-poll-option'); var n = opts.length; var raw = []; var sum = 0; for (var i = 0; i < n; i++) { var v = Math.random() * 50 + 5; if (opts[i] === el) v += 30; raw.push(v); sum += v; } var pcts = raw.map(function(v) { return Math.round(v / sum * 100); }); var diff = 100 - pcts.reduce(function(a,b){ return a+b; }, 0); pcts[Array.from(opts).indexOf(el)] += diff; setTimeout(function() { opts.forEach(function(opt, i) { opt.querySelector('.pb-poll-bar').style.width = pcts[i] + '%'; opt.querySelector('.pb-poll-pct').textContent = pcts[i] + '%'; }); }, 50); }