Rooting your Xiaomi device can unlock its full potential, allowing you to bypass software limitations, customize the user experience, enhance performance, and install powerful third-party tools. Unlike some other Android manufacturers, Xiaomi officially supports bootloader unlocking, making the rooting process relatively straightforward, though it still requires careful attention. This guide will walk you through how to root your Xiaomi device using the widely accepted method involving Magisk and a custom recovery like TWRP.
Disclaimer: Rooting your phone voids its warranty and carries the risk of bricking your device if not done correctly. Proceed with extreme caution and only if you are comfortable with technical procedures. I am not responsible for any damage to your device.
What is Rooting and Why Root a Xiaomi Device?
Rooting an Android device means gaining “root access” or “superuser permissions,” which is essentially administrative control over the operating system. Xiaomi’s MIUI, while feature-rich, still has limitations that rooting can overcome.
Benefits of Rooting a Xiaomi Device:
- Remove Bloatware: Uninstall pre-installed Xiaomi/MIUI apps you don’t use.
- Install Custom ROMs: Flash alternative Android versions like Pixel Experience, LineageOS, or other MIUI-based custom ROMs for different features and optimizations.
- Ad Blocking System-Wide: Block ads in apps and browsers without needing a VPN.
- Advanced Backups: Create full system backups (Nandroid backups) via TWRP for easy restoration.
- Kernel Customization: Tweak CPU/GPU frequencies for performance or battery life.
- Magisk Modules: Access a vast ecosystem of modules that add functionality, customize UI, or improve system performance.
Risks of Rooting:
- Voids Warranty: Xiaomi generally allows bootloader unlocking but may deny warranty claims for software-related issues on rooted devices.
- Potential for Bricking: Incorrect steps, especially during flashing, can render your device unusable.
- Security Vulnerabilities: Root access can potentially make your device more vulnerable if not managed carefully.
- Failed OTA Updates: You will likely stop receiving official Over-The-Air (OTA) software updates. You’ll need to update manually, often by flashing new ROMs or updating Magisk.
- SafetyNet Issues: Apps like banking apps, Google Pay, Netflix, and some games may detect root and refuse to work. This can often be bypassed with MagiskHide (DenyList) and SafetyNet Fix modules.
Essential Preparations Before You Start
Thorough preparation is paramount for a successful and safe rooting process.
- Back Up Your Data: This is crucial. Unlocking the bootloader will factory reset your device and wipe all data. Use Xiaomi Cloud, Google Drive, or transfer important files to a PC.
- Charge Your Phone: Ensure your Xiaomi phone is charged to at least 80% battery.
- Find Your Exact Device Model & Codename: Go to Settings > About phone > All specs. Note down your Model name (e.g., Redmi Note 10 Pro) and its internal codename (e.g., “sweet” for Redmi Note 10 Pro). This is vital for downloading correct TWRP and firmware.
- Know Your MIUI Version: Note your current MIUI version (e.g., MIUI 14.0.5 Global).
- Enable Developer Options:
- Go to Settings > About phone.
- Tap MIUI version repeatedly (7-10 times) until you see “You are now a developer!”
- Enable OEM Unlocking & USB Debugging:
- Go to Settings > Additional settings > Developer options.
- Enable OEM unlocking.
- Enable USB debugging.
- Enable “Mi Unlock status” and “Add account and device.” This links your Mi account to your device for bootloader unlocking.
- Download Necessary Software/Tools on Your PC:
- ADB & Fastboot Tools: Download the latest platform-tools from Google’s official Android Developers website. Extract the contents to an easily accessible folder (e.g., C:\adb).
- Xiaomi USB Drivers: Install these on your PC to ensure your computer recognizes your phone in different modes.
- Mi Unlock Tool: Download the official Mi Unlock Tool from Xiaomi’s MIUI website. Extract it to a folder.
- TWRP Recovery Image: This is a custom recovery environment crucial for flashing Magisk. Find the exact TWRP image (.img file) for your specific device model and its codename. Search reputable sources like the official TWRP website or XDA Developers forums. Download it and place it in your ADB folder.
- Magisk APK: Download the latest stable Magisk APK from the official Magisk GitHub repository (topjohnwu/Magisk). Transfer this APK file to your phone’s internal storage after the bootloader unlock and initial setup.
Part 1: Unlock the Bootloader
This is the first and most critical step. Xiaomi requires you to request permission to unlock the bootloader, which can take several days.
- Bind Mi Account to Device: As mentioned in preparation step 6, go to Settings > Additional settings > Developer options > Mi Unlock status and tap “Add account and device.” Your device must be connected to the internet.
- Apply for Unlock Permission:
- On your PC, open the Mi Unlock Tool.
- Sign in with the exact same Mi Account that you added to your phone.
- The tool will likely tell you there’s a waiting period (e.g., 72 hours, 168 hours, or more). You must wait for this period to expire without removing the Mi account from your phone or performing a factory reset.
- Boot Phone into Fastboot Mode:
- Once the waiting period is over, power off your phone.
- Press and hold Volume Down + Power buttons simultaneously until you see the Fastboot rabbit icon.
- Connect to PC: Connect your phone to your PC via a USB cable.
- Unlock Bootloader with Mi Unlock Tool:
- In the Mi Unlock Tool on your PC, click “Unlock.”
- Confirm the unlock process. This will erase all data on your phone and unlock the bootloader.
- Your phone will factory reset and reboot.
Part 2: Install TWRP (Custom Recovery)
TWRP (Team Win Recovery Project) is a custom recovery that allows you to flash custom ROMs, kernels, and importantly, Magisk.
- Boot Phone into Fastboot Mode: After the bootloader unlock and initial phone setup (don’t worry about setting everything up perfectly yet, as we’ll be wiping again), power off your phone and boot into Fastboot mode (Volume Down + Power).
- Connect to PC: Connect your phone to your PC via USB cable.
- Open Command Prompt/Terminal in ADB Folder:
- On your PC, navigate to the folder where you extracted ADB & Fastboot tools (e.g., C:\adb).
- In the address bar of the folder, type cmd and press Enter to open a Command Prompt window in that directory.
- Verify Device Connection: In the Command Prompt, type:
- fastboot devices
You should see your device’s serial number. If not, your drivers aren’t installed correctly.
- Flash TWRP:
- In the Command Prompt, type the following command, replacing twrp.img with the actual name of your downloaded TWRP recovery file:
- fastboot flash recovery twrp.img
- Press Enter. You should see “OKAY” messages indicating successful flashing.
- Reboot to TWRP Immediately: This is crucial to prevent the stock recovery from overwriting TWRP.
- While your phone is still in Fastboot mode, and BEFORE it reboots automatically, unplug the USB cable.
- Simultaneously press and hold Volume Up + Power buttons. Continue holding until the TWRP logo appears.
- If you accidentally boot into MIUI, power off and try again.
Inside TWRP:
- Allow Modifications: The first time you boot into TWRP, it might ask if you want to “Keep System Read Only.” Swipe to “Allow Modifications.”
- Format Data: This step will wipe your internal storage, so ensure backups are complete.
- In TWRP, go to Wipe > Format Data.
- Type yes and confirm. This decrypts your internal storage, making it accessible to TWRP.
- Reboot to Recovery: After formatting data, go back to the main TWRP menu and select Reboot > Recovery. This is essential to ensure TWRP works correctly with the newly formatted data.
Part 3: Install Magisk
Now that TWRP is installed and data is formatted, you can flash Magisk.
- Transfer Magisk APK to Phone:
- With your phone still in TWRP recovery, connect it to your PC.
- Your phone’s internal storage should now be accessible on your PC.
- Transfer the Magisk APK (the same file you downloaded earlier) to your phone’s internal storage (e.g., the Downloads folder).
- Flash Magisk within TWRP:
- On your phone, in TWRP, go to Install.
- Navigate to the folder where you placed the Magisk APK (e.g., /sdcard/Download).
- Tap the Magisk APK file.
- TWRP will recognize it as a flashable zip. Swipe to “Confirm Flash.”
- The flashing process will begin.
- Wipe Dalvik/Cache (Optional but Recommended): After flashing, you’ll see options to “Wipe Dalvik/Cache.” Swipe to perform this.
- Reboot System: Tap “Reboot System.”
Final Steps and Verification
- Initial Boot: Your phone will now boot into the rooted MIUI. The first boot might take a bit longer.
- Complete Setup: Go through the initial setup process for MIUI.
- Install Magisk App: If the Magisk app doesn’t appear on your home screen, navigate to the Downloads folder (or wherever you placed the Magisk APK earlier), and manually install it.
- Verify Root:
- Open the Magisk app. It should show “Magisk is installed” with a version number.
- You can also download a “Root Checker” app from the Google Play Store to confirm root access.
What to Do After Rooting Your Xiaomi Device
- Install Magisk Modules: Explore the vast array of Magisk modules available (search on XDA Developers) to add new features or customize your device.
- Hide Root (SafetyNet): If you encounter issues with banking apps, Google Pay, or other apps that detect root, enable Magisk DenyList (formerly MagiskHide) in Magisk settings. Add the problematic apps to the DenyList. You may also need to install the Universal SafetyNet Fix Magisk module.
- Custom ROMs: Now that you have TWRP and root, you can flash custom ROMs specifically designed for your Xiaomi model for a completely different software experience. Always read the ROM’s installation instructions carefully.
- Nandroid Backup: From TWRP, create a full Nandroid backup of your system. This is invaluable if you ever face issues or want to revert to a previous state. Go to Backup in TWRP, select all partitions, and swipe to back up.
Troubleshooting Common Issues
- “Waiting for device” in Fastboot:
- Ensure ADB & Fastboot drivers are correctly installed.
- Try a different USB port or cable.
- Run Command Prompt as administrator.
- Failed to Flash TWRP/Magisk:
- Ensure you have the correct TWRP image for your exact device codename.
- Ensure the Magisk APK is the correct version and not corrupted.
- If flashing TWRP, make sure you’re in Fastboot mode.
- If flashing Magisk, make sure you’re in TWRP recovery.
- Boot Loop: If your phone is stuck in a boot loop after flashing:
- Reboot to TWRP (Volume Up + Power).
- Try flashing the Magisk APK again.
- If that fails, you might need to re-flash your stock MIUI ROM using Xiaomi’s official Mi Flash Tool (a separate process).
- SafetyNet Fails:
- Ensure Magisk DenyList is enabled and configured for the problematic apps.
- Install and enable the Universal SafetyNet Fix Magisk module.
- Clear data for the problematic apps and reboot.
- No Wi-Fi/Bluetooth after Flashing: This often indicates an incorrect or incompatible firmware/ROM flash. You may need to re-flash the correct stock firmware or a compatible custom ROM.
Rooting your Xiaomi device can be a rewarding journey into advanced Android customization. By carefully following each step, understanding the tools involved, and prioritizing backups, you can safely unlock the full potential of your phone. Always refer to device-specific forums (like XDA Developers) for the most up-to-date and model-specific instructions.
Add Comment