- Jul 12, 2019
May not work for all devices, use at your own risk
PreparationWe are going to do it on Windows, if you use Mac or Linux, please read the corresponding tutorial here.
First of all you should install Magisk 24.1+ and patch boot.img through magisk app. Then copy the patched img file to your PC, it will be used soon.
Now follow the steps:
1. Install python(3.9 recommended) and git.
2. Clone the repository and install the dependencies:
git clone https://github.com/bkerler/mtkclient.git cd mtkclient pip install -r requirements.txt
4. Turn off your phone and connect your phone to pc with usb cable.
5. Run command
python mtk_guiin CMD or Powershell, make sure to locate to mtkclient directory before you run command.
6. Now hold volume down + power button till you see phone detected in the GUI or CMD/Powershell. Then you could release the buttons.
After the device info initialized you can see:
Now let's unlock bootloader:If you have unlocked just skip and go to magisk root tutorial at the last.
Go to Flash Tools , you can see Unlock bootloader , click it. Your phone would be unlocked in 1sec.
You will getting a dm-verity warn when booting, just press the power button to continue. This warn could disappear by clean flash a ROM.
It's RECOMMENDED to do a clean flash after unlock, using MiFlash (Do not lock again). Then install Magisk and root your phone.
Now let's root the phone:
1. Rename your patched boot image to xxxx.bin, for example: magisk_patched_boot.img -> magisk_patched_boot.bin
2. Go to Write Partitions
boot_b, set both of their values to the path of magisk_patched_boot.bin
4. Click Write Partitions button at the top right.
5. Wait until the progress goes to 100%.
6. Close the window, disconnect the phone. Long press power button to reboot.
If you did everything correctly and it still boot loop, try to use mtkclient to read boot_a partition, then patch it and flash it.
Now your phone should boot successfully with magisk root.