Manual Root Redmi 5A with TWRP v3.2.3 and Magisk

Manual Root Redmi 5A with TWRP v3.2.3 and Magisk 1

This is a DIY-article for you who want to root Xiaomi Redmi 5A manually using latest official TWRP build and Topjohnwu’s Magisk root. This means you won’t be necessary to ask your friend for help just for rooting your phone. Moreover, bringing the phone to Xiaomi Service Center is no use since rooting is way beyond their service.

Redmi 5A is one of Xiaomi budget phone series with a huge number of sales. Its price is very cheap while it sports a decent hardware specification. The phone, that has a codename Riva, runs both Global Stable and China Stable build of MIUI ROM. With the regular MIUI update release, there is a need to adjust the root tools necessary for the task. For instance, the phone running the latest MIUI version needs to use the latest version of TWRP recovery. There have been several either Auto or Semi-auto Windows-based root tool capable to gain root access. However, sometimes such a tool has no latest version of TWRP included within the package.

Following this article allows you to gain full root access on your Redmi 5A running MIUI v9.6.5 based on Android 7.1 Nougat. Furthermore, this is also compatible with any previous MIUI versions.

Objectives

The main purposes of this article are:

  1. To flash TWRP Recovery v3.2.3-0 on Redmi 5A.
  2. To flash Magisk root tool on Redmi 5A.

Requirements

You will need:

Prerequisites

You need to accomplish the following tasks prior to rooting your MIUI device:

  1. Unlock your phone bootloader officially. This is particularly easy but it may take some time. Read our full guide on how to do this here.
  2. Disable Driver Signature Enforcement on your Windows computer. This allows smooth installation process, or else, you will end up fail on installing the necessary driver. The full tutorial is here.
  3. Install Xiaomi ADB-Fastboot USB driver software you have downloaded it from the above link. This allows your computer to recognize your Android device properly. On top of that, this makes sure you can establish both ADB and Fastboot connection while the phone is in Bootloader mode and USB Debugging enabled. Choose site-wide installation during the process. Once installed, you will have it in your drive C:\adb\. You may also use Mi Flash tool instead. The tool bundles all required drivers within its installation.
  4. Backup your important data. We hold no responsibility for any potential damage of following this article. Please proceed with caution.

Flashing TWRP

Follow all the steps below to install TWRP on your phone:

  1. Download the TWRP image file from the above link to your computer and rename the file to recovery.img.
  2. Copy the recovery.img file to the C:\adb\ folder.
  3. Enable Developer Options. Go to Settings > About phone > tap the MIUI version several times until the developer options being enabled.
  4. Also, enable USB Debugging through Settings > Additional Settings > Developer Options > USB Debugging > toggle it on.
  5. Reboot your phone into bootloader/fastboot mode. You can either use the button combination method or use the ADB method. Read our full guide about Redmi 5A bootloader mode here.
  6. Connect your phone to your computer using its USB cable.
  7. On your computer, go to the ADB folder in Windows Explorer. This is usually located at C:\adb\.
  8. Type “cmd” – without quotes – in the Address bar of Windows Explorer, then hit Enter. This will launch Command Prompt window right in the current location.
  9. Type “fastboot devices” and hit Enter. This command asks your computer to establish the fastboot connection and to display all connected devices. You will see the code number of your phone in the list.
  10. Type “fastboot flash recovery recovery.img” and hit Enter. This instructs the computer to flash TWRP image file to the phone through the fastboot interface. The process should finish within seconds.
  11. Type “fastboot reboot” and hit Enter. This will boot your device into normal mode.
  12. You may disconnect it from your computer if you want.

Manual Root Redmi 5A with TWRP v3.2.3 and Magisk 2

p.s: All the command executed in the above and below steps are within quotes. Do not copy or use the quotes.

Flashing Magisk

  1. Assuming your phone is now in normal mode. You can either download the zip files of Magisk and DM Verity Disabler directly to your phone or grab it to your computer and transfer it to your phone later. The point is you need to have both zip files in the phone storage.
  2. Reboot your phone to Recovery mode. The easiest way to accomplish this task is by turning off your phone completely then press Power and Volume Up (+) button simultaneously. There are a few other ways to get into recovery mode. Read here for the full tutorial on this topic.
  3. If this is your first time using TWRP, you will need to swipe to allow system modification.
  4. Next, you will see the main TWRP menu. From here, choose Install.
  5. Now locate the Magisk zip file you have copied earlier. Tap on its file name to choose it.
  6. Finally, do the “Swipe to confirm flash” action.
  7. TWRP will then flash Magisk to your phone.

Manual Root Redmi 5A with TWRP v3.2.3 and Magisk 3

Avoiding Bootloop

  1. Go back to the main menu of TWRP.
  2. Again, choose Install from the menu.
  3. Locate the No Verity or DM Verity Disabler zip file. Tap on its file name to choose it.
  4. do the “Swipe to confirm flash” action.
  5. TWRP will then flash the zip file to your phone.
  6. Finally, tap the Reboot menu.
  7. Your phone will then reboot into the normal mode.

Additional steps:

A new app called “Magisk Manager” will be automatically installed after flashing Magisk zip file. Look for this app icon on your phone. There is a rare case that it may not be found due to corrupted flashing process. If this happens, you can download Magisk Manager .apk file here and install it manually.

Magisk Manager is basically a root manager app. It allows you to manage and to organize all the apps allowed to use root access on your phone. You can grant or revoke root access within this app. On top of that, you can use it to hide the root status from being detection by specific apps. This feature is useful to avoid root detection performed by banking apps and some gaming apps like Pokemon Go.

You can also check the current root status by downloading Root Checker app from the Play Store. Look for it there.

Conclusion

While TWRP is a powerful custom recovery, it requires some efforts to flash. Moreover, it demands unlocked bootloader and DM verity Disabler. Redmi 5A is one of the devices with the dm-verity mechanism. Hence, flashing a custom recovery and third-party binaries like Magisk require you to use DM-Verity patch to avoid bootloop.

Flashing TWRP and gaining root access can sometimes be challenging while also enjoyable. Going through such a manual process is arduous but it gives distinctive experience to enhance your knowledge and to sharpen your skill. On top of that, it gives you sophisticated satisfaction when succeeded.

Feel free to leave comment below. Let us know your experience or difficulties during the process if you found one.

Leave a Reply