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), 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):
Otherwise you'll have to extract them from the official MIUI firmware package using payload_dumper as follows.
Step-by-step:
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
Note, it appears that updating Magisk (the system) through the Magisk app does not currently work on this device.
Normally you'd update the Magisk APK (in the app) then use it to update the Magisk system (via Direct Install in the app). This appears to work, but on reboot the Magisk system is still the old version and the "Requires Additional Setup. Reboot to continue." alert comes up.
The way to fix this is to uninstall the Magisk APK (not the Magisk system in the app) and reinstall the stable version of the APK, then "update" the Magisk system (in the app). This re-patches the boot.img and downgrades you back to the stable version.
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), 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
Note: if your MIUI version (Available at: Settings -> About phone -> MIUI version) has a "Fastboot" file listed here then you can download that file and unzip it to find the boot.img and vbmeta.img, then skip to step 3.Otherwise you'll have to extract them from the official MIUI firmware package using payload_dumper as follows.
Step-by-step:
- Download the firmware package for your device (you can check what version you need in Settings -> About phone -> MIUI version (For POCO))
- Extract the .zip and find the payload.bin file
- Download the payload dumper, extract the zip, and place the payload.bin file in the payload_dumper folder
- In the payload_dumper directory run:
python payload_dumper.py payload.bin
- This will extract lots of files from the firmware package. You only need to keep boot.img and vbmeta.img
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
- 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
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
Note, it appears that updating Magisk (the system) through the Magisk app does not currently work on this device.
Normally you'd update the Magisk APK (in the app) then use it to update the Magisk system (via Direct Install in the app). This appears to work, but on reboot the Magisk system is still the old version and the "Requires Additional Setup. Reboot to continue." alert comes up.
The way to fix this is to uninstall the Magisk APK (not the Magisk system in the app) and reinstall the stable version of the APK, then "update" the Magisk system (in the app). This re-patches the boot.img and downgrades you back to the stable version.
Last edited: