Getting Root-Rights on Xiaomi Redmi 5A: a detailed guide

Despite its age, the Xiaomi Redmi 5A remains a popular experimentation device and budget solution for second SIM cards or children’s gadgets. However, the standard limitations of the Android Operating System often prevent you from unlocking the full potential of the hardware, especially when it comes to deep cleaning the system or installing specialized modules. Obtaining superuser rights (root) opens up access to the file system, allowing you to remove undeleable system software and fine-tune the processor.

The process of modifying the firmware on Miui devices requires careful preparation and understanding of the risks associated with loss of warranty and possible device failure. Unlike other manufacturers, the Xiaomi ecosystem imposes additional restrictions in the form of mandatory unlocking of the bootloader, which is a critical first step. Without official unlocking of the bootloader through the Mi Unlock service, installing custom backup and obtaining root rights are technically impossible.

In this guide, we will look at current methods of hacking the system for the Redmi model. 5A (codename riva, using proven tools such as TWRP Recovery and Magisk. You will need not only the smartphone itself, but also a personal computer running Windows, as well as a high-quality computer. USB-Next, we will go through each step in detail, from applying to the final access check.

Preparation of the device and necessary tools

Before you start any manipulation of the system partition, you need to make sure that all components are available. You will need a stable Internet connection on your PC and smartphone, as some stages require online verification of your Mi Account. It is also critical to create a full backup of all data, since unlocking the bootloader will lead to the complete removal of user information.

Download and install the current ADB and Fastboot drivers on your computer. Without properly installed drivers, your computer will not be able to recognize your smartphone in bootloader mode. Redmi 5A also recommends downloading your regional version's original Fastboot ROM so that you can return to factory status in case of an error.

⚠️ Warning: The process of unlocking the bootloader irreversibly erases all data from the internal drive. Pre-save photos, contacts and documents to an external medium or to the cloud storage.

Make sure the battery is at least 60 percent battery powered. interrupting the firmware process due to battery discharge can cause the device to turn into a "brick" and require complex hardware recovery. USB-cable, it is desirable to use the original wire or high-quality analogue with support for data transmission.

β˜‘οΈ Checklist before start

Done: 0 / 5

Unlocking the Xiaomi bootloader

The first and most time-consuming step is to unlock the bootloader, which is the official procedure that requires you to link the device to your Mi Account. Go to your smartphone settings, select About, and click on the MIUI version several times to activate the developer mode. Then go to the advanced settings and find Developer.

In the developer menu, you need to activate the "OEM Unlock" and "USB Debugging" option. Then go to the "Mi Unlock Status" app (if installed) or just add your account to the sync settings. Importantly, between the account binding and the unlock itself, there can be a wait of 7 to 30 days, this is device theft protection.

When the waiting period expires, turn off your smartphone and turn it on in Fastboot mode, holding down the volume and power buttons at the same time. Connect your phone to your PC and launch the Mi Unlock Tool utility. If all the data match, the program will unlock the device. The process will take a few minutes, after which the phone will restart to the clean system.

  • πŸ”“ Activate Developer Mode and Link Mi Account.
  • ⏳ Wait for the waiting timer to expire (from 168 hours).
  • πŸ’» Use Mi Unlock in Fastboot mode.
  • πŸ”„ Wait for a complete reboot and cleanup of data.
πŸ“Š Have you been waiting for unlocking?
Waited 3 days
Waited exactly 7 days
Waited more than a month.
The device unlocked immediately.

Installation of custom TWRP Recovery

The standard Xiaomi recovery menu does not allow you to install third-party zip archives or obtain root rights. To do this, you need to implement custom Recovery, among which the leader is the Team Win Recovery Project (TWRP). For the Redmi 5A (riva) model, you need to find a specific build that corresponds to the architecture of the Snapdragon 425 processor.

Download the recovery image (a file with the.img extension) to the folder with ADB tools on your computer. Put your smartphone in Fastboot mode and connect to your PC. Open the command line in this folder and enter the command to check the connection: fastboot devices. If the serial number is displayed, the connection is established correctly.

fastboot flash recovery twrp-3.x.x.x-riva.img


fastboot boot twrp-3.x.x.x-riva.img

The first command records the image in memory, and the second command compulsorily runs it. After execution, the phone must go to the TWRP menu. If you release the buttons and the phone boots into the normal system, then the installed recap has been overwritten with the stock, in which case you need to immediately after the flash command, execute the boot command without releasing the keys.

ParameterImportance for Redmi 5ANote
Code namerivaUsed to search for firmware
ProcessorSnapdragon 425Architecture of ARM64
Firmware modeFastbootRequired for TWRP
File systemEXT4 / F2FSDepends on the MIUI version.

Magisk firmware to get a Root

The current standard for obtaining superuser rights is Magisk from topjohnwu. Unlike the old methods (SuperSU), Magisk works systemlessly, which allows you to bypass security checks in banking applications and games. APK-Magisk file and rename it to.zip, or use the built-in installation function.

Booted in TWRP, Go to Install. Find the downloaded Magisk installer file on the internal drive or SD-Before you run the firmware, it is recommended to back up the current Boot image via the Backup menu, in case you need to restore it.

⚠️ Note: Do not use older versions of SuperSU for Android 8.0 and higher on Redmi 5A, This can lead to a cyclic bootloop. Use only Magisk version 24.0 and higher.

Once installed successfully, click the Reboot System button. The first download can take more than usual, from 5 to 10 minutes. After you turn on the system, find a new Magisk icon in the application menu. If the application opens and shows the version, then the binary file has successfully entered into the boot section.

What if Magisk doesn’t see root?
If the app is installed but root access is not displayed, open Magisk settings and make sure the "Zygisk" option is enabled. You may also need to reflash the patch through TWRP if the Android version has been updated with OTA.

Configuring and checking access rights

After the first successful download, Magisk can suggest that you complete the installation and restart the device. You can accept this suggestion. You can use the built-in test in Magisk settings to check the health, or download a third-party application, such as Root Checker from Google Play.

An important step is to set up root hiding for applications that don’t want to run on modified devices. In Magisk settings, activate MagiskHide (or Zygisk in newer versions) and add banking apps, Google Pay and anti-cheat games to the exclusion list, allowing you to enjoy all the features of your smartphone without restrictions.

Advanced users can access system files through root-enabled file managers like Root Explorer or Mixplorer. You can now change system fonts, remove embedded MIUI ads through hosts, and change the CPU frequency to improve performance or autonomy.

  • πŸ“± Launch the Magisk App to Check Status.
  • πŸ›‘οΈ Activate MagiskHide to hide modifications.
  • πŸ“‚ Install a file manager with root support.
  • βš™οΈ Set up automatic script start at start.

πŸ’‘

For maximum stability of banking applications after obtaining root rights, it is recommended to hide not only the Magisk application itself, but also to rename its package through the application settings.

Possible problems and solutions

Software modifications rarely go perfectly smoothly for all users. One of the common problems with Redmi 5A is the loss of broadband connectivity (IMEI null) after flashing modem partitions or persist. To avoid this, never format the persist partition or flash modified modems from other models.

If the device has gone into an endless reboot, don't panic. Press the power and volume button to get back into Recovery mode. If the TWRP has survived, try making Wipe Dalvik/Cache. If the problem is more serious, you'll have to return the stock firmware via Emergency Download (EDL) or Fastboot mode using the Mi Flash Tool.

Another common error is the Verification Failed error when installing Magisk.This means that the loader is locked back or the image integrity is broken. Make sure you don't update the OTA system after installing the TWRP, as the official MIUI update automatically replaces the custom recovery with stock and blocks the possibility of modification.

⚠️ Warning: If you experience a "Device is corrupt" error when booting, ignore the message (press Power) if the phone is booting.This is the standard warning for unlocked Xiaomi bootloaders.

πŸ’‘

Return to factory condition is always possible through the utility Mi Flash Tool in Clean All mode, which completely removes traces of modifications.

Frequently Asked Questions (FAQ)

Will the guarantee be reset after obtaining root rights?
Technically, software interference and bootloader unlocking are grounds for denial of warranty service by official service centers. However, since the unlocking process is officially supported by Xiaomi, in some cases, services may be met if you fully return the stock firmware and lock the bootloader before contacting.
Will banking applications work after rooting?
Yes, they will, but only if you set up the right thing. Modern versions of Magisk hide root rights from specific applications. You'll need to activate Zygisk and add banking apps to the Denit List. In some cases, you may need to uninstall the Google Play Services app and reinstall it.
Can I update Android OTA after getting root?
No, you can't install an automatic air update (OTA) that overwrites the modified boot partition, which will lead to root loss and possibly loading problems if the recover versions don't match, and you should update manually, flashing full firmware images through TWRP or Fastboot.
Is it safe to use a Root Checker to check?
Simple checks are safe, but some aggressive apps may require concealment of the fact of the check, and for basic diagnostics, a built-in status in the Magisk app is enough, where it clearly states: β€œRoot: Yes” or β€œRoot: No”.