The Custom Droid

Android Tutorials, Tips and Tricks

How to Root Xiaomi Mi A3 using Magisk (without TWRP)

How to Root Xiaomi Mi A3

In this tutorial, I will show you how to easily root the Xiaomi Mi A3 using Magisk, without installing or using a custom recovery such as TWRP at all. These instructions are compatible with both the Global and European variants of the Mi A3 and supports all Android versions including Android 11, Android 10, as well as Android Pie.

Advertisement

Since its launch in 2019, the Mi A3 received support from the custom development community in no time. A major reason for that was the fact that the phone runs near-stock Android OS being a part of Google’s Android One program. This makes a lot of things easier at the developers’ end to set things in motion when it comes to custom development.

Traditionally, rooting involved flashing Magisk through a custom recovery such as the popular TWRP recovery. However, that’s not the norm anymore, in fact, it hasn’t been for some years.

Advertisement

The process of rooting the Mi A3 is a tried-and-true one and does not rely on a custom recovery.

You can now easily root your Xiaomi Mi A3 using Magisk. You will not only be able to use root applications, but you can also use Magisk to apply modifications to the phone’s software systemless-ly, hide root access from individual apps, pass SafetyNet checks (well, not after Google’s new hardware-backed attestation), and much more.

That being said, the instructions below in this guide will take you through the complete process in detail.

Prerequisites

Before you begin, make sure that you fulfill all the requirements listed below.

  • Rooting your phone will not wipe data. But we still strongly recommend that you take a complete backup of all your data, including the internal storage, to prevent data loss if anything goes wrong. Here’s a detailed guide on how to manually backup your Android device completely, just in case you need it.
  • In order to root, you must first enable OEM unlocking and unlock your Mi A3’s bootloader. If you have not unlocked yet, then note that unlocking the phone’s bootloader will wipe all the data including internal storage.
  • Charge your phone to a sufficient battery level (About 50% or above). This shall help avoid any sudden shutdowns during the rooting process.
  • (For Method 1 only): Download the latest TWRP for Mi A3 and install it. If you already have TWRP installed, then this is not needed.
  • (For Method 2 only):
    • Enable USB Debugging on your Mi A3. We will be using ADB to pull the Magisk Patched Boot Image from the device to the PC.
    • Download the latest ADB and Fastboot package and extract it to a suitable location on your PC (example: C:\platform-tools).
    • Launch the command-line window on PC:
      • PowerShell in Windows: Go to the folder where ADB and Fastboot are installed. Then hold the Shift key on the keyboard and right-click on any empty space inside the folder. Finally, select the ‘Open PowerShell window here’ option.
        Xiaomi Mi A3 Root - Open PowerShell Window in Windows PC
      • Terminal in macOS/Linux: Open the Terminal window and “cd” to the folder where ADB and Fastboot are installed (example: cd Documents/platform-tools)
        Xiaomi Mi A3 Root - cd to ADB and Fastboot folder in macOS/Linux Terminal
    • When executing ADB or fastboot commands during the instructions, make sure to prepend them with “.\” while using Windows PowerShell or “./” when using macOS/Linux Terminal.

Download Xiaomi Mi A3 Stock Boot Images

For rooting the Mi A3 using Magisk Patched Boot Image (Method #2), you will need the stock boot image (boot.img) for the software version/build number installed on your phone.

Although you can simply extract the boot image from the OTA file, we decided to save you that trouble. Below, you will find the links to download the stock boot image for both the Global and European variants of the Mi A3, for all the software versions released to date.

Note: Please avoid using pre-patched boot images provided by others. In doing so, you would lose the ability to restore the stock boot image, which is required for installing OTA updates after rooting, as well as for unrooting the phone later.

For Global Variant

For European Variant

Instructions to Root Xiaomi Mi A3 using Magisk

As we mentioned initially, there are two different ways/methods to root the Xiaomi Mi A3 using Magisk. The method you choose purely depends on what you’re trying to achieve overall.

  • If you have TWRP installed on your phone and plan on using it to flash custom ROMs, kernels, and mods, then you should use Method #1.
  • On the other hand, if you just want to root your phone and keep using the stock firmware, then Method #2 is what you should follow.

After you finish following either of these methods, your Mi A3 will be rooted with Magisk. So, the result stays the same. Now, without any further ado, let us start with the instructions.

Method 1: By flashing Magisk through TWRP recovery

In this method, you will be flashing the latest Magisk installer ZIP file through TWRP recovery.

  1. First, download the latest Magisk APK file (e.g. Magisk-v22.0.apk) on your Mi A3.
  2. Open a file manager and rename the .apk file to a .zip file (e.g. Magisk-v22.0.apk to Magisk-v22.0.zip).
  3. Next, hold the power button of your phone to bring up the Power Menu and select ‘Power off’.
  4. Once the phone is fully powered off, hold the Volume Up and Power buttons together to enter TWRP recovery mode.
  5. Select ‘Install’ from the TWRP main menu.
    Select Magisk Installer Package (Magisk-v19.4.zip) in TWRP - Xiaomi Mi A3
  6. Navigate to the phone’s internal storage (/sdcard) in the file selector window.
  7. Select the Magisk installer ZIP file that you downloaded earlier (e.g. Magisk-v22.0.zip) to add it to TWRP’s flashing queue.
  8. Swipe the button on the bottom of the screen to flash Magisk and root your Xiaomi Mi A3.
    Flash Magisk Installer Package in TWRP to Root Xiaomi Mi A3
  9. Press the ‘Reboot System’ button once the flashing process is finished.

That’s it! Your phone will now reboot into the rooted stock firmware environment.

Method 2: By flashing Magisk patched boot image (without TWRP)

In this method, you will be downloading and patching the stock boot image, and then flashing the resultant patched boot image to your Mi A3 using fastboot commands.

  1. First, download the stock boot image according to your Mi A3’s software build number on your PC.
  2. Extract the contents of the downloaded ZIP file (stock_boot_vxx.x.x.x_mi_a3_xxxx.zip) to get the stock boot image (boot.img).
  3. Transfer the extracted stock boot image to your phone’s internal storage.
  4. Now download the latest version of Magisk Manager and install the APK on your phone.
  5. Once installed, launch the Magisk Manager app and select ‘Install’.
    Root Xiaomi Mi A3 - Select and Patch a File using Magisk Manager
  6. Press ‘Install’ and then select the ‘Select and Patch a File’ option.
  7. Navigate to your phone’s internal storage and select the stock boot image file (boot.img) that you transferred earlier.
  8. Magisk Manager will now automatically patch the stock boot image file with the latest version of Magisk. The resultant Magisk Patched Boot Image (magisk_patched.img) file will be stored in the ‘Download’ folder of your phone’s internal storage.
    Root Xiaomi Mi A3 - Patch Stock Boot Image using Magisk Manager
  9. Launch the command-line window inside the ‘platform-tools’ folder on your PC (refer to pointer #4 of the ‘Prerequisites’ section).
  10. Enter the below command to transfer the ‘magisk_patched.img’ file from the phone to the PC. Alternatively, you could also transfer the file manually.
    adb pull /sdcard/Download/magisk_patched.img
  11. Now power off your Xiaomi Mi A3 and boot it into Fastboot Mode by holding the Volume Down and Power buttons.
    Boot Mi A3 into Fastboot Mode to Flash Magisk Patched Boot Image
  12. Connect your phone to the PC using a USB cable.
  13. Now, enter the following command to flash the Magisk Patched Boot Image and root your Xiaomi Mi A3.
    fastboot flash boot magisk_patched.imgFlash Magisk Patched Boot Image to Root Xiaomi Mi A3
  14. Once the flashing process finishes, reboot your phone back into the OS using the following command.
    fastboot continue

Once your phone boots, it should be rooted with Magisk. To verify, you can open the Magisk Manager app and verify the installation status.

Wrapping Up

So by now, you have learned how to root the Xiaomi Mi A3 using two different methods. Rooting gives you tons of control over each and every part of your phone’s software. You can now install your favorite root apps like Titanium Back and start using them. You could also install Magisk Modules to install mods such as ViPER4Android, Xposed Framework, etc.

If you ever wish to unroot the phone, you can use the ‘Uninstall’ option in Magisk Manager.

About the Author

Founder and Editor-in-Chief

Dhananjay has more than 11 years of experience in Android software customization and development, and has spent the past 10 years writing about it. He spends most of his prime time reading, learning and writing about Android and other open-source projects. He is also a community-taught web developer. Apart from that, he loves mountain biking and playing video games on his PlayStation.

Comments 12 Comments

    1. You will need to wait until the full OTA or Fastboot ROM of V12.0.4.0.RFQEUXM firmware is available.

      Once it is, you can extract it from the package.

      For Fastboot ROMs, it is as simple as extracting a ZIP file on your computer.

      But for the OTA, you will need to use the Payload Dumper.

  1. I have a question about method 2. How to update the device after I install the root? Is it possible to do it by flashing the stock boot image provided above?

    1. Also I’d be very happy if you could provide us with the latest boot image for the global variant 11.0.15.0

    2. Hi again, Ventsi. I have added the download link above. The stock boot has been packed inside the ZIP file, so you will need to extract the downloaded ZIP first.

    3. Hi Ventsi. It’s quite easy actually. Magisk automatically creates a backup of the stock boot image when you patch the boot image for rooting. After your phone is rooted, you can use Magisk Manager to restore that boot image and install the OTA update. The detailed instructions for this could be found on this page.

      You’d only need to manually re-flash the stock boot image in case Magisk fails to restore the backup or if the OTA update still fails after following the instructions I linked above.

  2. I have using second method (Flashing Magisk Patched Boot Image using Fastboot (without TWRP)) to root xiaomi mi a3 . I have stuck at step 13. I execute this command fastboot flash boot magisk_patched.img but CMD stuck at waiting for any device> Give me solution ASAP.

    Pankaj kumar

    1. Hi Pankaj. It’s good to have you here.

      The problem you have mentioned concerns the USB drivers. It seems like the PC is not able to recognize your Mi A3 over the fastboot interface.

      Please try to download the latest drivers from here, install them on your PC, reboot it, and then try the fastboot command again.

      A side tip: Prefer using USB 2.0 ports. USB 3.1/3.0 ports may pose unusual problems when flashing via fastboot.

    2. Thanks sir this issue is resolve but now I am stuck in next step after run fastboot flash boot magisk_patched.img command showing this error below:

      C:\platform-tools>fastboot flash boot magisk_patched.img
      Sending ‘boot_a’ (19572 KB) OKAY [ 0.437s]
      Writing ‘boot_a’ FAILED (remote: ‘Flashing is not allowed in Lock State’)
      fastboot: error: Command failed

    3. Hi again, Pankaj. Your phone’s bootloader isn’t fully unlocked, that’s why you’re seeing this error.

    4. how can make my phone’s bootloader fully unlocked . Please guide me. Actually I want restore format data of my phone. so I am trying to Root Xiaomi Mi A3. My important data of office. Give me best solution and tell me it is possible or not.

    5. Hi again, Pankaj. The complete instruction for unlocking the bootloader of your Mi A3 could be found here.

      Do note that unlocking will erase all the data on the device including that on the internal storage, so take a full backup before you start.

Leave a Reply

Comments are moderated, and published only if they are relevant to the topic and add value in a constructive way. If you disagree with something, please be polite and respectful. We suggest you read our comment policy before commenting.