How to get root rights on Xiaomi Mi 5: a safe way to unlock the bootloader

The Xiaomi Mi 5, released in 2016, is still popular among Android enthusiasts thanks to its powerful hardware (Snapdragon 820, 3/4 GB of RAM) and strong support for custom firmware. However, root rights are required to fully control the device β€” from removing system applications to installing modified cores. In this article, we will discuss current ways to obtain root rights to the Mi 5 in 2026, given the changes in Xiaomi policy and model features.

Important: the procedure for unlocking the bootloader and obtaining root rights voids the warranty and can lead to the inability to use official MIUI updates through the OTA. In addition, improper actions are fraught with a β€œbrief” (complete inoperability) of the device. If you are a beginner, follow the instructions carefully and do not miss the steps.

Why do you need root rights to Xiaomi Mi 5?

Root access offers features not available in standard firmware:

  • πŸ”§ Remove embedded software: remove unnecessary system applications (Mi Browser, Mi Music, Mi Video) that cannot be uninstalled without root rights.
  • ⚑ Optimizing Performance: Turn off background processes MIUI, Overclock the processor or limit battery consumption for individual applications.
  • πŸ“± Install custom firmware: flash LineageOS, Pixel Experience or other AOSP projects for pure Android.
  • πŸ”’ System-level Ad Blocking: Use AdAway or Blokada to remove ads completely across all apps.
  • πŸ”„ Nandroid Backup: Create Full System Backups Through TWRP, including application data and settings.

However, there are downsides: some banking applications (such as Sberbank Online or Tinkoff) refuse to work on rooted devices due to SafetyNet, and the risk of malware infection increases if you install applications from unreliable sources.

πŸ“Š Why you need root rights to Xiaomi Mi 5?
Removal of system applications
Installation of custom firmware
Overclocking/optimization
Blocking ads
Other

Preparation of the device: what to do before unlocking

Before starting the procedure, follow the mandatory steps:

  1. Back up your data. Use Mi Cloud or adb backup to save contacts, SMS and files. TWRP will be installed later, so you can't do a full backup yet.
  2. Check out the MIUI version. Go to Settings β†’ About Phone β†’ MIUI version. Any version will do the job, but you’d better use a global stable firmware (e.g. MIUI 12.5) to install Magisk.
  3. Turn on USB debugging: Settings β†’ About Phone β†’ MIUI Version (click 7 times to become a developer) Settings β†’ Additional β†’ For Developers β†’ Debugging over USB (enable)
  4. Link your Mi Account. Without a Xiaomi account, you can’t unlock the bootloader. Make sure the account is confirmed by email and phone.

Also prepare:

  • πŸ’» Windows PC 10/11 Linux (MacOS is not recommended due to driver issues).
  • πŸ”Œ Original. USB-cable (a faulty cable may interrupt the process!).
  • πŸ”‹ Battery charge of at least 70%.

Linked to the Mi Account to the device

USB debugging enabled

Backup of important data is made

Installed ADB/Fastboot drivers on PC

Battery charge β‰₯ 70%-->

Unlock the bootloader on Xiaomi Mi 5

The bootloader is locked by default on all Xiaomi devices, and unlocking it is a mandatory step before obtaining root rights. In 2026, Xiaomi tightened the rules: it now requires waiting 72-168 hours after linking an account to the device.

Instructions:

  1. Download Mi Unlock Tool from the official website en.miui.com/unlock (version no lower than 5.5.224.24).
  2. Sign in to Mi Unlock under the same account as your phone. If the program gives an error "Account not bound", double-check the binding in the phone settings.

Once successfully unlocked, the phone will automatically reset to factory settings!

What if the Mi Unlock Tool can’t see the device?
1. Check if the Fastboot drivers are installed (download here). 2. Try another one. USB-port (better 2.0, not 3.0). 3. Disable the antivirus - it can block the Mi Unlock Tool. 4. Use the original Xiaomi cable (poor cables often do not transmit data to Fastboot).

⚠️ Attention: If you interrupt the unlocking process (e.g., disconnect the cable or exit the Fastboot), the timer will reset and you will have to wait again. Do not try to speed up the process using bypass methods - this can lead to hard-brick (irreparable damage).

Installation of custom TWRP Recovery

Once you unlock the bootloader, you need to install TWRP (Team Win Recovery Project) - a custom Recovery that will allow you to flash Magisk and other modifications. For Xiaomi Mi 5 (codename gemini), use the official TWRP build from twrp.me.

Step-by-step:

  1. Download the image TWRP for Mi 5 (file twrp-3.7.0_9-0-gemini.img Or newer. Rename it in recovery.img convenienceally.
  2. Move the file to the folder with ADB (for example, C:\platform-tools\).
  3. Launch your phone in Fastboot mode (as in the previous section) and connect to your PC.
  4. TWRP command: fastboot flash recovery.img fastboot boot recovery.img After the second command, the phone will automatically reboot to TWRP.

If the TWRP does not start after the reboot and the phone is loaded into a standard MIUI recavator, do:

fastboot flash recovery recovery.img


fastboot oem reboot-recovery

πŸ’‘

To avoid automatic replacement TWRP on the stock Recovery when loading, after the first installation immediately flash Magisk or any other ZIP-file-through TWRP. This will prevent the system from rolling back.

Install Magisk for root rights

Magisk is a universal tool for obtaining root rights without changing the systemless root, and it also allows you to bypass SafetyNet checks, which is critical for banking applications.

Installation instructions:

  1. Download the latest version of Magisk (Magisk-v26.4.zip or later) from the official GitHub repository.
  2. Move it. ZIP-file on the phone (internal memory or SD-map).
  3. Boot in TWRP: adb reboot recovery Or turn off your phone and pinch Volume Up + Power.
  4. In TWRP, select: Install β†’ Select Magisk-v26.4.zip β†’ Swipe to Confirm Flash.
  5. Reboot the system (Reboot System).

After the reboot, check for root rights using the Magisk Manager app (sets automatically) or the Root Checker from Google Play.

Problem.Reason.Decision
Magisk is not installed, the error is "Failed to mount /system".Incompatible version of TWRP or damaged imageSweep through another version of TWRP (e.g. 3.6.2 instead of 3.7.0)
The phone is loaded into bootloop (cyclic reboot)Magisk module conflict or incorrect firmwareDownload to TWRP and delete files from /data/adb/modules
SafetyNet is not working (bank applications are not working)Universal SafetyNet Fix is not available.Install the module via Magisk (download on GitHub)
No network after Magisk firmwareDamaged modem or EFS-sectionSwitch to modem.img via Fastboot

⚠️ Note: If you are using Xiaomi Mi 5 firmware MIUI 13/14, Magisk may not work due to changes in the core, in which case you first roll back to the core. MIUI 12.5 Or install custom firmware based on Android 10.

Checking the efficiency and eliminating errors

After installing Magisk, perform a diagnosis:

  1. Check root rights: adb shell su If the #-root symbol appears after the su command.
  2. SafetyNet Test: Open Magisk Manager β†’ Settings β†’ SafetyNet β†’ Press Check. If Status Passed, banking apps will work.
  3. Check the modules: In Magisk, go to Modules, where you should see the installed add-ons (e.g. SafetyNet Fix).

Typical errors and decisions:

  • 🚨 Bootloop after Magisk firmware: Delete files /data/.magisk through TWRP and re-set.
  • 🚨 No Internet: Switch the stock modem.img for your version MIUI.
  • 🚨 Magisk Manager does not open: Install APK hand-held.

1. Squeeze the stock firmware command fastboot flash all [firmware file].zip.

2. Re-unlock the bootloader (timer will reset!).

3. Install. TWRP Magisk again, but with errors in mind.-->

Alternative ways to obtain root rights

If the standard method with Magisk doesn’t work, consider alternatives:

  • πŸ”„ Patched Boot Image: Download stock firmware for Mi 5 from xiaomifirmwareupdater.com. boot.img Process it through Magisk Manager ("Patch Boot Image"). boot.img Fastboot: Fastboot Flash boot magisk_patched.img

Custom firmware with pre-installed rue

Firmware like LineageOS for MicroG or Havoc-OS already includes Magisk, which can be installed via TWRP after unlocking the bootloader.

ADB Root (temporary root)

For one-time tasks (for example, removing system applications), a temporary root through ADB will suit:

adb shell


su -c "pm uninstall -k --user 0 com.miui.browser"

The rights are valid until the reset.

Power users can also use KernelSU, an alternative to Magisk that is built into the core, but the Mi 5 requires a KernelSU-enabled custom core, which complicates the process.

FAQ: Frequent questions about root rights on Xiaomi Mi 5

Can I get root rights without unlocking the bootloader?
No. On all Xiaomi devices, including the Mi 5, the bootloader is locked at the hardware level. Without it unlocking, you can't flash TWRP or Magisk. The only exception is the temporary root through vulnerabilities, but they are closed in current versions of MIUI.
How long does it take to unlock the bootloader?
Since 2021, Xiaomi has introduced a mandatory wait: For new accounts - 168 hours (7 days); for old accounts (associated with the device for more than 30 days) - 72 hours.
How to return official OTA updates after obtaining root rights?
To get updates again MIUI By air: Remove Magisk through TWRP (plough Magisk-uninstaller.zip). Fastboot flash recovery: fastboot flash recovery recovery_stock.img Restore the stock. boot.img (However, after that, the root rights will be lost and the bootloader will remain unlocked.
Will Google Pay work after getting the root rights?
Not unless you set up a SafetyNet bypass. Even with Universal SafetyNet Fix, Google Pay can block payments because of: Availability of an unlocked bootloader (checked through getprop ro.boot.verifiedbootstate). Lack of Widevine L1 certification (issues with Netflix, Disney+). Solution: Use alternatives like Revolut or Samsung Pay (if supported).
Can I block the bootloader back after obtaining the root rights?
Technically, yes, but it is extremely risky. Locking the bootloader on a device with modified partitions (Magisk, custom recaveri) will lead to hard-brick. If you want to return everything "as it was", first run the full stock firmware through the Mi Flash Tool in clean all mode, and then lock the bootloader: fastboot oem lock Attention: after locking, you can unlock the bootloader again only after 7-30 days!