Root access gives Android apps elevated control over a Xiaomi phone. It can enable advanced backups, system-level customization, and tools that need administrator privileges. Rooting is not a routine software update, however: it usually requires unlocking the bootloader, which erases the phone, and a mistake can leave it unable to start. The steps and files differ by model, Android version, and region. Treat this guide as a careful outline, not as a source of universal firmware files or commands.
Before you begin
- Confirm the exact model and variant. Check Settings > About phone and, if necessary, the model label or original box. A similarly named phone, regional variant, or 5G version may use different partitions. Never flash an image made for another device.
- Back up everything important. Bootloader unlocking normally performs a factory reset. Copy photos, documents, authenticator recovery codes, and other data somewhere off the phone. Make sure you can sign in to your Google and Xiaomi accounts afterward.
- Check the current requirements. Xiaomi’s bootloader-unlock rules, eligibility, waiting periods, and available tools can change, and may vary by region or HyperOS version. Use Xiaomi’s official instructions and unlock tool for your device. Do not rely on old guides promising a bypass.
- Prepare a computer and cable. Install current Android platform-tools (ADB and Fastboot) from Google and the appropriate USB driver if you use Windows. Use a reliable cable and keep the computer powered.
- Understand the trade-offs. Unlocking and rooting can affect warranty or support, trigger security checks, break banking or streaming apps, reduce device security, and complicate system updates. Results vary by app and software version; root-hiding methods are not guaranteed.
Unlock the bootloader officially
Charge the phone, install pending updates if desired, and sign in to the Xiaomi account you intend to use. On the phone, enable Developer options by tapping the OS version entry in About phone repeatedly, then open Settings > Additional settings > Developer options. Enable OEM unlocking and USB debugging if those options are present. In Mi Unlock status, follow the on-screen process to bind the account and device. Xiaomi may require mobile data, a SIM, account eligibility, or a waiting period; follow the messages shown for your phone.
Download Mi Unlock only from Xiaomi’s official channel and read its current instructions. On the computer, sign in with the same account. Turn the phone off, enter Fastboot mode using the model’s documented key combination (often Power and Volume Down), connect it, and let the official tool check eligibility. If it reports a waiting period, leave the account and device bound and try again only after the stated time. Do not use unofficial services that request account credentials.
When the tool allows unlocking, confirm the warning on the phone or computer. This usually wipes user data and may show an unlocked-device warning at startup. Let the phone boot and complete initial setup before continuing. If the official tool cannot unlock the device, stop and check Xiaomi’s current regional policy rather than trying an exploit.
Get the correct stock image
Install the official Magisk app from its project’s trusted source. Obtain the exact official fastboot ROM for your model, region, and currently installed build from Xiaomi’s official support channel where available. Check the build number in Settings and compare it with the package. Do not use an image from a random download page, another model, or a different release: mismatched boot files can cause a boot loop or data loss.
Extract the ROM on the computer and locate the boot image. Depending on the device and Android release, Magisk may need boot.img or init_boot.img; some phones use a different arrangement. Consult the device-specific documentation and Magisk’s current instructions to identify the right partition. Do not guess, and do not flash an entire ROM just to obtain one file.
Patch the image with Magisk
- Copy the correct stock image to the phone’s internal storage. Open Magisk, tap Install, choose the option to select and patch a file, and select that image.
- Allow Magisk to create a patched image. The app normally saves it in the phone’s Download folder. Copy that output back to the computer without renaming it in a way that could cause confusion.
- Keep an untouched copy of the original image and the full matching stock ROM. These are useful for recovery. Confirm again that the patched file came from the image for the installed build.
Flash the patched image
Boot the phone into Fastboot mode and connect it to the computer. Open a terminal in the platform-tools folder and check that the device is detected:
fastboot devices
If no serial number appears, stop. Check the cable, USB port, driver, and Fastboot installation rather than entering flash commands blindly. The next command depends on the correct partition and the device’s layout. For a device whose instructions specify the boot partition, the general form is:
fastboot flash boot magisk_patched.img
If the device documentation specifies init_boot, use that partition instead, for example fastboot flash init_boot magisk_patched.img. These are examples, not commands to run on every Xiaomi. Some devices use A/B slots or have special procedures; follow current instructions for your exact model. Do not add vbmeta, verification-disabling, or slot commands from an unrelated tutorial. When the documented flash completes, reboot using the specified procedure or the phone’s normal Fastboot reboot command.
Verify root and maintain the phone
After Android starts, open Magisk and follow any setup prompt it displays, then reboot if requested. Verify access with a reputable root-checking app or a trusted app that explicitly needs root; never grant superuser access to an app you do not trust. Root does not mean every system file should be changed. Grant permissions sparingly and keep Magisk and other components updated from their official sources.
System updates can replace the patched boot image or fail because the device is modified. Before an update, read the instructions for your model and Magisk version, back up data, and make sure you have the matching stock firmware and a recovery plan. Do not accept a major update on the assumption that root will survive. Never relock the bootloader while modified partitions or unofficial software remain installed: doing so can prevent the phone from booting.
Troubleshooting and recovery
- Boot loop or failure to start: Stop repeated flashing. Use the model-specific recovery instructions to restore the matching stock boot or init_boot image, or reinstall the exact official fastboot ROM if appropriate. A full restore may erase data.
- Fastboot does not detect the phone: Try another data-capable cable and USB port, reinstall the correct driver, and verify platform-tools. Do not flash until detection is stable.
- Root is missing after an update: The update may have restored the stock image. Follow the current Magisk procedure for that exact build; do not reuse an old patched image.
- Apps stop working: Some apps intentionally reject unlocked or rooted devices. Root concealment is unreliable and may violate an app’s terms. The safer option for security-sensitive apps is often to restore stock software and, if appropriate, relock only after fully returning to the official state.
In short: identify the exact Xiaomi model, make a complete backup, unlock only through the official process, patch the matching stock image with Magisk, and flash only the partition confirmed by device-specific instructions. If you cannot verify a file or command, pause and ask for guidance before proceeding.

