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

How to Root Xiaomi Mi A3

In this comprehensive guide, I will show you how to root Xiaomi Mi A3 using Magisk. This could be done through two different methods. First, by flashing the Magisk installer zip using TWRP, or second, by flashing the patched boot image using Fastboot.

The Mi A3 was launched last and has received quick due support from the custom development community in a short period of time. A major reason for that is that the phone runs near-stock Android OS since it is 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.

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.

Table of Contents

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.

Comments

  1. Hello, please i need the stock boot for V12.0.7.0.RFQMIXM, i flashed my stock ROM with V12.0.6.0.RFQMIXM after installing security update for march without realizing that the version has moved up from 12.0.6.0. Now my phone’s Audio and WiFi among other things has stopped working 🙁 Thank You..
    My earlier comment was in someone’s reply

    1. Yes, those kinds of issues could be caused due to mismatched boot images. I have uploaded the V12.0.7.0 stock boot for the Global variant and added the download link above. Check now.

    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.

  2. AMIGO, SEU SITE É MUITO COMPLETO E SEMPRE ATUALIZADO. PASSO AQUI APENAS PARA AGRADECER!
    FRIEND, YOUR SITE IS VERY COMPLETE AND ALWAYS UPDATED. STEP HERE ONLY TO THANK YOU!

  3. 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.

  4. Amigo pues ya no se, porque tengo el celular dañado, no pasa de modo fastboot no entra ni a recovery, solo se queda en modo fastboot, le instale la rom stock y tampoco

    1. Hi Davison. Have you tried downloading and restoring the latest stock firmware from here? Download the fastboot ROM, extract it, and run the ‘flash_all_except_storage.bat’ file while your phone is connected to the PC in fastboot mode.

  5. I run into some issues getting Magisk.zip installed when using Method 1; My phone was stuck in Download Mode even though TWRP was installed successfully. I had to flash stock boot in slot a and b to get the phone back.
    I therefore switched to Method 2, but no luck there either. Installing TWRP after rooting the phone with magisk_patched.img wipes the root functionality, so tried flashing Magisk.zip with TWRP, but this time my phone got stuck into TWRP Recovery not able to boot to system even when I swicth slots.
    After all of this I decided to Flash Android 10 Stock ROM and check my luck: It took while to get the stock_boot_image since there isn’t any in the firmware, and getting the correct twrp for android 10 (https://mega.nz/f868acfe-cd28-4439-b300-89b0478a69eb). Neither method 1 nor 2 worked, so I altered and combined the steps in Method 2 and steps for TWRP; I know there might a better way but that’s what worked for me.

    Repeated Steps 2, then 4 through 10 with the twrp.img; I renamed the pulled magisk_patched.img each time by adding “stock_” or “twrp_”.
    At Step 13: Flash patched stock boot “fastboot erase boot” then “fastboot flash boot stock_magisk_patched.img”
    Swicth to inactive slot (it should be either a or b) by typing “fastboot getvar current-slot” if (a) then type “fastboot –set_active b” and vice versa.
    Flash stock and twrp boot there by doing “fastboot erase boot” then “fastboot flash boot stock_magisk_patched.img” followed by “fastboot flash boot twrp_magisk_patched.img”
    Type “fastboot reboot” to reboot (do not revert to the original slot yet)
    When the phone reboots into TWRP, Choose Reboot and Choose “Slot A” in b is active and vice versa, then return to main menu.
    Choose “Install” then “Install Image”, and choose “twrp_magisk_patched.img”.
    Select the “Install Recovery Ramdisk” partion and Swipe at the slider.
    Wait the flashing to finish then Choose “Reboot System”
    Enjoy TWRP and Magisk.

    1. Thanks Jude for sharing your findings. When you mentioned ” I renamed the pulled magisk_patched.img each time by adding stock_ or twrp_”, did you mean that you created a copy of the same file and renamed it to those two?

  6. 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.

    6. Thanks Sir, Is it possible I will restore all the format data from my after complete all the steps. Please give me best way how I can restore my formatted data from my phone. Please give me best way.

    7. A mi intentado hacer el método dos, ya lo había hecho en android 9 pero lo hice con android 10, no sé si me equicove de stock.img y se me atasco en fastboot no entra ni en modo recovery, alguna solución?
      Ya le instale la stock pero no arranca

    8. Hi Davison, could you please tell me which build number of Android 10 is currently installed on your Mi A3?

    9. Hi again, Pankaj. Your contacts, emails, photos, and videos can all be synced with Google. For messages and call logs, I would advise using this handy application: SMS Backup and Restore.

      Next, connect your phone to the PC and transfer all the data from the internal storage of your phone to the PC. It’s simply copy/paste.

      Once you have unlocked the bootloader and rooted your phone, you can restore all the backed up data via Google, the application I suggested, and finally copying back all the files and folders from your PC back to your phone’s storage.

    1. Hi Nazmul, the 11.0.8.0 boot image file has been uploaded and added to the ‘Downloads’ section.

    2. Hi again, Nazmul. Glad it worked! If you have any further questions, please do let me know.

    3. Hi Nazmul, the boot image for the V11.0.11.0 update has already been added to the downloads section. Please refresh the page and check again.

Leave a Reply

Your email address will not be published. Required fields are marked *