Complete Guide to Rooting Xiaomi and Redmi Smartphones with Magisk

Complete Guide to Rooting Xiaomi and Redmi Smartphones with Magisk

This comprehensive guide covers the essential steps for obtaining root access on Xiaomi and Redmi devices using Magisk. The process involves unlocking the bootloader, extracting necessary firmware components, patching the boot image, and flashing the modified file back to the device.

Prerequisites and Resources

Before proceeding, gather the following tools and resources required for the rooting process:

  • Mi Unlock Tool: Official bootloader unlocking utility available from Xiaomi's developer portal
  • MIUI ROM Package: Download the appropriate firmware for your device from trusted repositories
  • Magisk Application: The primary rooting solution for Android devices
  • Payload Dumper Tool: Utility for extracting boot images from firmware packages
  • ADB and Fastboot: Essential debugging and flashing tools for Android

Important Notes on Boot Image Handling

Obtaining the Original boot.img File

The boot image file must be extracted from a fastboot ROM package, not a recovery ZIP file. Using a boot image extracted from a recovery package will result in boot loops and device failure.

Always maintain a backup of the original boot.img file in a secure location on your computer. This backup serves as a recovery option if your device becomes unbootable after installing modules or making configuration changes. The original image can be restored using fastboot commands to return your device to its pre-rooted state.

Naming Convention for Backup Files

Implement a consistent naming scheme for your backup files to avoid confusion during the rooting process. Include the device identifier, MIUI version, and firmware build number in the filename:


boot_venus-images-V14.0.2.0.TKJCNXM_fastboot.img
magisk_patched-25200_xK9mN_venus-images-V14.0.2.0.TKJCNXM_fastboot.img

Step-by-Step Rooting Procedure

Step 1: Unlock the Bootloader

Download and run the official Mi Unlock tool from Xiaomi. The unlocking process typically requires:

  • Mi account association with the device (minimum 7 days)
  • Device connected to the internet
  • Confirmation through the unlock tool interface

The tool will wipe all device data during the unlocking process. Note that some newer Xiaomi devices may have bootloader unlock restrictions that cannot be bypassed with standard methods.

Step 2: Download the MIUI Firmware Package

Obtain the full MIUI firmware package matching your device's codename and region. Ensure the version matches or is compatible with your current system version to avoid compatibility issues during the update process.

Step 3: Extract the Boot Image

Use a payload dumper tool to extract the boot.img from the downloaded firmware package:


payload_dumper -o ./output boot.img

If the firmware package already contains a standalone boot.img file, you can skip this extraction step.

Step 4: Transfer Files to Device

Connect your device to the computer via USB and enable file transfer mode (MTP). Copy the original boot.img and the complete firmware package to the Download directory on your device's internal storage.

Step 5: System Update Verification

Access the system update menu by repeatedly tapping the MIUI logo in the update screen. This reveals additional options including manual package installation. Navigate to this menu and select the firmware package you transferred earlier to ensure version consistency between your installed system and the downloaded package.

Step 6: Install Magisk Application

Download and install the latest Magisk application on your device. The app serves as both the root management interface and the patching tool for boot images.

Step 7: Patch the Boot Image

Launch the Magisk application and proceed with the following steps:

  1. Tap the "Install" button on the main interface
  2. Ensure all option checkboxes remain unchecked (enabling certain options may cause boot loops on some devices)
  3. Select "Select and Patch a File" from the available options
  4. Navigate to and select the original boot.img file from your Download directory
  5. Initiate the patching process

Upon successful completion, Magisk generates a new image file in the Download directory with a naming pattern like magisk_patched-<version>_<random>.img. The random characters change with each patching operation, so note the exact filename generated.

Step 8: Prepare Flashing Environment

Download and extract the ADB and Fastboot tools to a dedicated folder on your computer. Connect your device to the computer using a high-quality USB cable and enable file transfer mode. Copy both the original boot.img and the patched Magisk image to the ADB/Fastboot directory.

Step 9: Boot into Fastboot Mode

Restart your device by holding the power button until the screan turns off. As the device restarts, immediately press and hold the volume down button along with the power button to enter fastboot mode. Connect the device to your computer once in this mode.

Step 10: Flash the Patched Image

Execute the following command from the ADB/Fastboot directory to flash the patched boot image:


fastboot flash boot magisk_patched-<version>_<random>.img

Successful execution produces output similar to:


Sending 'boot' (131072 KB) OKAY [ 3.311s]
Writing 'boot' OKAY [ 0.441s]
Finished. Total time: 3.794s

Step 11: Complete the Process

Reboot your device normally. Upon startup, a vibration feedback indicates successful boot. The presence of the Magisk version information in the application confirms successful root installation.

Recovery Procedures

Restoring Original System

If Magisk modules cause boot failures or system instability, flash the original boot image to restore your device:


fastboot flash boot boot.img

This recovery method works in most cases where the device fails to boot after module installation or system modifications.

Maintaining Root After System Updates

When updating your device's MIUI version, download the complete firmware package and repeat the patching and flashing steps. Minor incremental updates may not require re-rooting, but full version upgrades typically necessitate the complete process outlined in this guide.

Device Enformation Reference

This guide has been tested on the following configuration:

  • Device: Xiaomi 10 Pro
  • Operating System: MIUI 13 (Android 12)
  • Host Environment: Windows 11

Tags: magisk xiaomi root Android fastboot

Posted on Sun, 17 May 2026 17:41:36 +0000 by TGixer