Rooting the POCO M4 Pro 4G (fleur) turned out to be quite straightforward. Note, I have a 2201117PG (EEA), you may have a different experience, it's not my fault if you brick your phone etc. Backup before you start as this will wipe your phone.
The process can be broken down into 4 steps:
This can be done using the official tool from MIUI, using MediatekBootloaderUnlock (Windows 10/11, which reportedly does not wipe your user data), or using mtkclient (Any OS but requires Python). I will explain the mtkclient option as I'm on Linux and don't trust MIUI with more personal data than I have to.
Step-by-step (adapted from this How to Guide):
Step-by-step (adapted from the Magisk installation instructions):
Step-by-step:
It's a good idea to disable automatic OTA updates (Settings -> Additional settings -> Developer options -> Automatic sytem updates) so that you can update through Magisk.
Some apps will be able to tell that you have rooted your phone, and may stop you from using them. You can check this by downloading YASNAC onto your phone and seeing if it passes. If not (which it won't) the most straightforward solution is to add the Universal SafetyNet Fix module to Magisk, then enable Zygisk in Magisk settings and restart your phone, which will be enough to pass SafetyNet Attestation. If they're clever and still detect the root then in Magisk toggle Enforce DenyList and add the problematic apps to the DenyList.
Updating Magisk
You cannot update Magisk via the Magisk app, as this device does not allow writing to the boot partition at runtime.
Instead, update the Magisk app, then use it to patch your stock boot.img and flash it manually using fastboot, as if you were installing it from scratch (as above). This will not wipe your user data, but be sure to backup first in case something goes wrong.
The process can be broken down into 4 steps:
- Unlock Bootloader
- Source boot.img
- Patch boot.img (using Magisk)
- Flash patched boot.img (using adb)
1. Unlock Bootloader
Note: This step will wipe your phone.This can be done using the official tool from MIUI, using MediatekBootloaderUnlock (Windows 10/11, which reportedly does not wipe your user data), or using mtkclient (Any OS but requires Python). I will explain the mtkclient option as I'm on Linux and don't trust MIUI with more personal data than I have to.
Step-by-step (adapted from this How to Guide):
- Install mtkclient and its dependencies (easier if familiar with installing python packages etc., straightforward for me on Linux)
- On your phone activate developer mode and turn on USB debugging and OEM unlocking
- Turn off phone and disconnect from computer
- In the directory where you installed mtkclient run:
python mtk e metadata,userdata,md_udc
- This erases your data
- At this point plug your phone in (still turned off)
python mtk da seccfg unlock
- This unlocks the bootloader
python mtk reset
- This reboots the phone
- Disconnect USB cable and reboot phone
- When it boots a message is displayed warning that dm-verity is corrupted. Click the power button to dismiss and continue booting.
2. Source boot.img
- Find your MIUI version in Settings -> About phone -> MIUI Version and look for the version number (e.g.
13.0.6.0(RKEEUXM)
) - Visit the MIUI Updates Tracker and download the matching Stable Fastboot update (if you can't find it scroll down to Extracting boot.img from Payload)
- Unzip the TGZ and the TAR that it contains then navigate to the
images
directory and find theboot.img
file
3. Patch boot.img
We need to patch the boot.img to give it root powers. We do this on the phone using Magisk.Step-by-step (adapted from the Magisk installation instructions):
- On your phone, download Magisk and install it
- Connect your phone to your computer and put the boot.img you extracted on your phone somewhere
- Open Magisk and in "Magisk" section tap "Install"
- Choose the "Select and Patch a File" option and select your boot.img in the file browser and let Magisk patch it
- Find the patched boot image in Downloads (called magisk_patched_*.img) and copy it to your computer in the same directory as the vbmeta.img we extracted earlier
4. Flash patched boot.img
Finally we need to replace the current boot.img on the phone with our patched one that has root powers. This is called flashing and is done using adb.Step-by-step:
- Install the Android SDK platform tools which contains adb and fastboot
- Install a USB driver that supports fastboot mode (you cannot use fastbootd for this or you'll bootloop)
- Ensure your phone is connected, USB debugging is enabled and working, and OEM Unlocking is enabled
- In the directory you copied the magisk_patched_*.img to run:
adb reboot bootloader
- This reboots your phone into fastboot mode. Wait until "FASTBOOT" is displayed on the screen
fastboot flash boot magisk_patched_*.img
- This flashes the patched boot.img to give you root
fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
- This flashes the vbmeta.img, disabling the dm-verity corruption message at startup
- Once it's done reboot your phone by pressing and holding the power button
Extract boot.img from Payload
If you can't find a fastboot image (boot.img) for your version then you might be able to extract it from the full firmware package. This will require the use of a third party tool such as payload-dumper (python) or payload-dumper-go. Note that you may be better off just waiting for the fastboot image to be released to the public.Tidying up
You can delete all the stuff you downloaded onto your computer and the boot.img and magisk_patched_*.img from your phone.It's a good idea to disable automatic OTA updates (Settings -> Additional settings -> Developer options -> Automatic sytem updates) so that you can update through Magisk.
Some apps will be able to tell that you have rooted your phone, and may stop you from using them. You can check this by downloading YASNAC onto your phone and seeing if it passes. If not (which it won't) the most straightforward solution is to add the Universal SafetyNet Fix module to Magisk, then enable Zygisk in Magisk settings and restart your phone, which will be enough to pass SafetyNet Attestation. If they're clever and still detect the root then in Magisk toggle Enforce DenyList and add the problematic apps to the DenyList.
Updating Magisk
You cannot update Magisk via the Magisk app, as this device does not allow writing to the boot partition at runtime.
Instead, update the Magisk app, then use it to patch your stock boot.img and flash it manually using fastboot, as if you were installing it from scratch (as above). This will not wipe your user data, but be sure to backup first in case something goes wrong.
Last edited: