Xiaomi Mi A2 is one of the few smartphones of the brand that runs on βpureβ Android One instead of the proprietary shell MIUI. This feature simultaneously simplifies and complicates the process of obtaining root rights. On the one hand, the lack of proprietary restrictions Xiaomi allows you to use standard tools to unlock the bootloader. On the other hand, the specifics of Android One firmware require taking into account nuances that many users do not know.
In this article, we will discuss three current methods for obtaining root rights to the Mi A2 (including the Mi A2 Lite models), analyze the risks of each method, and give recommendations for restoring the device in the event of a failure.
Why does the Mi A2 require a special approach to rut?
The main challenge lies in the architecture of Android One. Unlike MIUI, where Xiaomi provides official tools to unlock the bootloader (for example, Mi Unlock Tool), Android One firmware uses a standard Google bootloader with rigorous integrity checks.
- π OEM-unlock lock by default is enabled and requires manual shutdown in developer settings.
- π‘οΈ dm-verity (partition integrity check) /system) This leads to a logo hanging when the firmware is incorrect.
- π Forceencrypt encrypts user data, making it difficult to work with custom recovery.
Also, the Mi A2 doesnβt support the TWRP project out of the box β most users have to use modified versions or alternative recovery like OrangeFox.This adds to the risks but also opens up opportunities for fine-tuning.
Preparation of the device: 5 mandatory steps before unlocking
Before you start unlocking the bootloader and installing root rights, you need to perform a number of prepared actions, skipping any of them can lead to data loss or locking the device.
β οΈ Attention: On Mi A2 Android 10+ unlocking the bootloader resets all data on the device, including photos and apps. Use adb backup or third-party backup tools.
- Activate Developer Mode: Go to Settings β About Phone β Build Number and tap it 7 times.
- Enable USB debugging: In the Settings menu β System β For developers, activate USB debugging and OEM unlock.
- Install ADB drivers: Download Googleβs Platform Tools and check the adb device team.
- Check the firmware version: Make sure the device has the latest official firmware installed (the minimum supported root version is Android 9 Pie).
- Download the files you need: You will need Magisk (the latest version), fastboot, and modified recovery (e.g. OrangeFox for the Mi A2).
Pay special attention to the OEM Unlock item. On some Android One firmwares, this option may disappear after a reboot. If this happens, repeat the activation of the developer mode and turn the option on again.
Data backup created | ADB drivers installed | USB enabled |OEM unlocked |Magisk and recovery files downloaded-->
Method 1: Unlocking the bootloader + Magisk (recommended)
This is a method that is suitable for most users and is considered the most reliable, and involves unlocking the bootloader via fastboot, installing custom recovery, and Magisk firmware to obtain root rights.
Step 1: Unlock the bootloader
Connect the Mi A2 to your computer and execute the following commands in the terminal:
adb reboot bootloader
fastboot flashing unlock
fastboot rebootThe device will display a data reset warning, confirm the unlock with the volume and power buttons, and after the reset, the device will be completely reset.
Step 2: Install custom recovery
Download a modified recovery for Mi A2 (like OrangeFox) and run it through fastboot:
fastboot flash recovery orangefox-recovery.img
fastboot reboot recoveryIf the device doesnβt boot in recovery, try using the fastboot boot command orangefox-recovery.img for a temporary boot.
Step 3: Magisk firmware
In recovery, select Install and specify the path to the Magisk-vXX.X.zip file. Once installed, restart the device. You may need to set up Magisk via the app for the first time.
β οΈ Warning: If the device is stuck on the logo after Magisk firmware, the reason may be the dm-verity check, so the solution is to patch the device. disable_dm-verity_forceencrypt.zip recovery.
π‘
If Magisk does not define root rights after the reboot, try manually installing the MagiskHide Props Config module through the module manager.
Method 2: Patching a boot image through Magisk (no custom recovery)
This is a method that is suitable for users who do not want to install custom recovery or face problems when running it, and the essence of the method is to remove boot.img from the firmware, patch it with Magisk and flash it back.
Step 1: Extract boot.img
Download the official firmware for the Mi A2 from Xiaomi (select the version that matches your current firmware). Unpack the archive and find the boot.img file.
Step 2: Patching through Magisk
Transfer boot.img to your smartphone and open it through the Magisk app. Press Install β Select and Patch a File and wait until the process is complete. The patched file will be saved in the Download folder.
Step 3: Firmware patch boot.img
Connect the device to the PC and do:
adb reboot bootloader
fastboot flash boot magisk_patched.img
fastboot rebootThis method is less risky than custom recovery firmware, but requires a precise match to boot.img and the current firmware.
Method 3: Using the DirtyCOW exploit (for older firmware)
If your device is running Android 7 Nougat or Android 8 Oreo, you can use the DirtyCOW exploit, which allows you to get a root without unlocking the bootloader. However, this method is outdated and does not work on all devices.
Instructions:
- Download. APK-utility (for example, KingRoot or Framaroot).
- Install the app and follow the instructions on the screen.
- Once you receive the root, install Magisk or SuperSU immediately to manage the rights.
β οΈ Note: DirtyCOW exploits often contain malicious code or backdoors. Use this method only as a last resort and immediately after receiving the root swipe Magisk to clean the system.
What if KingRoot is not working?
Common mistakes and their solutions
Even with the exact instructions, Mi A2 users often encounter problems, and here is a table of the most common errors and ways to fix them.
| Mistake. | Reason. | Decision |
|---|---|---|
| fastboot: error: Cannot generate image | The file is damaged. boot.img recovery | Download the file again, check check the checksums (MD5) |
| The device hung on the logo after firmware Magisk | DM Verity Checking is enabled | Please. disable_dm-verity_forceencrypt.zip recovery |
| adb: device unauthorized | Unconfirmed access to debugging via USB | Confirm the resolution on the smartphone screen when connecting |
| Magisk does not define the root after the reboot | MagiskHide module not installed | Update Magisk to the latest version through the module manager |
| fastboot: error: Failed to lock/unlock | The bootloader has already been unlocked or blocked by the operator | Check the status of the bootloader with the command fastboot oem device-info |
If your problem is not listed in the table, try resetting the device to factory settings via recovery (Wipe). β Factory Reset) and repeat the process from the start, which helps to fix software failures in 90% of cases.
What to do after obtaining a root license?
Root access offers a lot of options for customizing the Mi A2, but it also requires caution.
- π Install MagiskHide: Hiding the root from apps (such as banking or gaming) Activated in Magisk settings.
- π± Create a full backup: Use TWRP Or OrangeFox for partition backup /data.
- β‘ Optimize Performance: Remove Unnecessary System Applications with Titanium Backup or SD Maid.
- π Update the firmware carefully: After the update root OTA Will not work β use manual firmware through recovery.
On the Mi A2 with root rights, it is strongly recommended not to install modules that modify the core (for example, to overclock the processor), this can lead to overheating and failure of the Snapdragon 660 chip, which has no protection against thermal damage.
π‘
After receiving the root, be sure to turn off the automatic update check in Android settings. OTA-Update without pre-removal Magisk will result in loss of root rights or system freeze.