Disclaimer: for advanced power user only. If you don't understand what your are doing, then don't do it.
Prerequisites#
- Phone unlocked (OEM unlock / Mi unlock)
- USB debug enabled
Rooting with Magisk#
Download the latest release of Magisk on your phone and
install it. For example Magisk-v24.3.apk
as of Mar 10, 2022.
Then, on your PC, download the stable ROM of MIUI corresponding to your region and the version installed on your phone. For example V13.0.4.0.SKHEUXM - European version.
Note: the same steps can be followed if you are running LineageOS, just by using LineageOS installation package instead.
Plug your phone to your PC with an USB cable.
Run adb devices
to pair your PC with your phone (accept the popup on the phone).
Extract the ROM to a folder (eg. miui
): 7z x miui_ALIOTHEEAGlobal_V13.0.4.0.SKHEUXM_17e135935d_12.0.zip -omiui
.
As we can see on Magisk app, the POCO F3 has a ramdisk, so as
explained in Magisk documentation we need to fetch a copy of
boot.img
. But as we can see the ROM image contains only a big payload.bin
file.
We'll have to extract boot.img
from payload.bin
. For this we'll use
payload dumper (see Android OTA payload dumping / extraction: 4 tools review to see how to do it with ssut/payload-dumper-go
which is much faster).
Install the dependencies, for me on ArchLinux: pacman -S python-protobuf python-six --needed --asdeps && pikaur -S python-bsdiff4
,
else you can still create a virtual environment and pip install requirements.txt
or use the docker image.
Then launch the extraction:
The extracted boot image is stored in output/boot.img
.
We have a separate vbmeta partition because vbmeta.img
is extracted from the firmware
package and we can also confirm by running adb shell ls -l /dev/block/by-name
that shows vbmeta_a
and vbmeta_b
.
We can copy the boot image we extracted to the phone with the following command:
Now we can click Install
on the Magisk app. You will have to select boot.img
from the download folder to select the image to patch.
Then we'll download the patched image to our PC (the path is written in Magisk logs).
Treble Check app show we have a A/B partition system, so this will change the flash method.
Reboot the phone in bootloader/fastboot mode:
In fastboot mode flash the boot image:
Now reboot the phone.
We can launch the Magisk app to check the root was successful.