How to Root Xiaomi Mi A2/A2 Lite using Magisk (Without TWRP)

How to Root Xiaomi Mi A2/A2 Lite on Android Pie using Magisk

In this guide, we will show you how to root Xiaomi Mi A2 and Mi A2 Lite using Magisk, without installing/using TWRP recovery at all. The instructions in this guide will work on any Mi A2/A2 Lite device running Android, 10, Android Pie, and Android Oreo.

Like its predecessor, the Xiaomi Mi A2, and Mi A2 Lite quickly gained a lot of attention from the custom development community, thanks to the Android One program. Both the devices support TWRP recovery officially, which means you can easily flash custom ROMs/kernels, mods, and root your phone by flashing the Magisk zip file.

We already have a tutorial published on how to install TWRP on Xiaomi Mi A2/Mi A2 Lite and root it through it. So why would you need to root your phone without TWRP? There are various scenarios, for example:

  • TWRP recovery for your device doesn’t support the latest software version or render issues.
  • Also, using this method makes it easier to take OTA updates on your rooted Mi A2/A2 Lite.
  • Or, you might only need root (and not TWRP) for things like enabling camera2 API and install a GCam Port on it.
  • Finally, if you are not planning on flash any custom ROMs, kernels, or mods, then it’s quite redundant to install TWRP in the first place.

As you can see, there are several reasons why you would want to use this method. Now that you are here, let’s begin with the instructions.

Related Article: Enable Camera2 API on Xiaomi Mi A2/A2 Lite without Rooting

Table of Contents

Requirements

Make sure that you fulfill all the instructions listed below.

  • Like always, we can’t help but strain enough that you take a complete backup of all your data stored on the phone. Although this process will not wipe anything, it is best to safeguard your data in case anything goes unplanned. We also have a comprehensive guide on how to backup Android phones completely.
  • In order to root, you must first unlock the bootloader of your Mi A2/A2 Lite.
  • If you have previously rooted your phone or applied any sort of modifications to your phone, then it is strongly advised to flash the stock firmware (fastboot image) using the Mi Flash tool before proceeding. This will ensure that you do not face any issues while installing OTA updates on your rooted Mi A2 device.
  • Download Android platform-tools package and extract it on your PC. When asked to launch PowerShell (on Windows) or Terminal (on Linux/macOS), use the following instructions.
    • On Windows: Go to the ‘platform-tools’ folder that you extracted earlier. Now, while holding the SHIFT key, right-click on an empty space inside this folder. Select ‘Open PowerShell window here’ from the menu.
    • On Linux/macOS: Open the ‘Terminal’ and cd to the location of the ‘platform-tools’ folder. Example:
      cd Documents/platform-tools

Instructions to Root Xiaomi Mi A2 and Mi A2 Lite using Magisk

For your convenience and a better understanding of the rooting procedure, we have split the instructions into three different steps. These are as follows.

Step 1: Download Boot Images

The first step of the rooting process is to download the stock boot image for the Android build number/software version currently installed on your Mi A2/A2 Lite.

Along with the stock boot images, we have also provided links to download the corresponding patched boot images. If you choose to use them, you can skip step (#2) of patching the stock boot image using Magisk Manager, and directly head over to step #3 and flash the provided patched boot image to root your phone.

However, we strongly recommend that you patch the stock boot image by yourself, using the instructions in the next step. That’s because Magisk takes a backup of the stock boot image during the patching process. This will allow you to easily restore the stock images for installing OTA updates on your phone after rooting.

For Xiaomi Mi A2 (jasmine_sprout)

V11.0.28.0.QDIMIXM Stock Boot Image
V11.0.27.0.QDIMIXM Stock Boot Image
V11.0.22.0.QDIMIXM Stock Boot Image
V11.0.21.0.QDIMIXM Stock Boot Image
V11.0.20.0.QDIMIXM Stock Boot Image
V11.0.19.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.17.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.15.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.14.0.QDIMIXM Stock Boot Image
V11.0.13.0.QDIMIXM Stock Boot Image
V11.0.12.0.QDIMIXM Stock Boot Image
V11.0.11.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.10.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.8.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.5.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.4.0.QDIMIXM Stock Boot Image Patched Boot Image

For Xiaomi Mi A2 Lite (daisy)

V11.0.21.0.QDLMIXM Stock Boot Image
V11.0.20.0.QDLMIXM Stock Boot Image
V11.0.18.0.QDLMIXM Stock Boot Image
V11.0.17.0.QDLMIXM Stock Boot Image
V11.0.16.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.14.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.12.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.11.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.10.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.7.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.5.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.4.0.QDLMIXM Stock Boot Image Patched Boot Image

Huge thanks to Roy Goldberg, Nico van Draanen, and XDA Senior Member Aerobatic for contributing to this article by sharing the patched and stock boot images!

Step 2: Patch Stock Boot Image using Magisk Manager

  1. Download the stock boot image for your Xiaomi Mi A2/A2 Lite. Ensure that you download the version corresponding to the current software version (build number) installed on your phone.
  2. Transfer the downloaded file to your phone’s storage.
  3. Now download the latest APK file of the Magisk app on your phone.
  4. Use a file browser app and install the downloaded APK file.
  5. Next, go to the app drawer and launch the ‘Magisk Manager‘ app.
  6. Tap on the ‘Install‘ button and select ‘Install‘.
    Root Xiaomi Mi A2/A2 Lite without TWRP - Select and Patch a File in Magisk Manager
  7. Tap on the ‘Select and Patch a File‘ option.
  8. Navigate through the phone’s storage and select the stock boot image file (e.g. stock_boot_10.0.14.0_mi_a2_lite.img).
    Root Xiaomi Mi A2/A2 Lite without TWRP - Patch Stock Boot Image using Magisk
  9. Magisk Manager will now start the patching process.
  10. Once finished, the resultant Magisk-patched boot image (magisk_patched.img) file would be placed in ‘[internal storage]\Download‘ of your phone.

Now that you have the Magisk Patched Boot Image, move down to the third step to finally root your Xiaomi Mi A2 device.

Step 3: Flash Patched Boot Image to root Xiaomi Mi A2/Mi A2 Lite

  1. Connect your Mi A2/A2 Lite to the PC using the USB cable.
  2. Transfer the ‘magisk_patched.img‘ file to the directory on the PC where the Android SDK platform-tools (ADB and fastboot) are present.
    Copy Magisk Patched Boot Image to 'platform-tools' folder
  3. Launch the PowerShell on Windows or the Terminal app if you’re using Linux/macOS PC (Refer to pointer #4 in Prerequisites).
  4. Power off your Mi A2/A2 Lite completely.
  5. Boot your phone into Fastboot Mode by pressing and holding the Volume Down and Power buttons together.
    Root Xiaomi Mi A2/A2 Lite without TWRP - Boot into Fastboot Mode
  6. Connect your phone to the PC using the USB cable once it is in Fastboot Mode.
  7. Enter the following code to flash the patched boot image and root Xiaomi Mi A2/A2 Lite using Magisk.
    • In PowerShell on Windows:
      .\fastboot flash boot magisk_patched.img

      Flash Magisk Patched Boot Image to root Xiaomi Mi A2/A2 Lite without TWRP

    • In Terminal on Linux/macOS:
      ./fastboot flash boot magisk_patched.img
  8. If you downloaded the pre-patched boot image from above, then make sure to replace [“patched-boot-image.img“] with the actual filename of the downloaded patched boot image. For example, if you downloaded the V11.0.10.0 patched boot image for Mi A2, the command would the following.
    fastboot flash boot patched_boot_11.0.11.0_mi_a2.img

    Flash Magisk Patched Boot Image on Xiaomi Mi A2/A2 Lite via fastboot

  9. Since the Mi A2 and A2 Lite support the A/B partition scheme, Magisk will only be installed on your phone’s current active slot; leaving the inactive slot untouched.
  10. Finally, reboot your phone into the OS by entering the following code:
    fastboot reboot

Your Xiaomi Mi A2/A2 Lite will reboot into the system (OS) and should be rooted now. To confirm that the process was successful, simply launch the Magisk Manager application from the app drawer.

With your phone rooted now, you can install Magisk Modules to add third-party features or to simply apply modifications systemless-ly. You can also use MagiskHide to hide root from root-detecting apps. To sum up, there’s a lot you can do on your phone now.

So, you have just succeeded to root Xiaomi Mi A2/Mi A2 Lite running Android 10/Pie/Oreo using Magisk, without installing TWRP. If you have any questions regarding the procedure, let us know via the comments.