Magisk Installation

Prerequisites

You need to have the following programs:

platform-tools (adb, fastboot) and python.

Getting the files

You need a copy of your boot.img file, which is sometimes distributed alongside the main Custom ROM, but is also available in the payload.bin in the installation ZIP (we need to use Python to extract it!).

If you have your boot.img file already, only extract the vbmeta.img file.

Install payload_dumper

python3 -m pip install pipx
python3 -m pipx install payload_dumper

Why install pipx and then payload_dumper? Because pipx is better for installing isolated python modules automatically and reliably.

Extract the IMG files

payload_dumper --partitions boot,vbmeta payload.bin

Patching

Copy the boot.img to your phone, it’s small enough to go fast with MTP or FTP.

Install the official Magisk APK on your device, and click Install, that will lead you to patching your file.

After it finishes, copy it back to the computer.

Flashing

Boot into fastboot/download/bootloader mode, an easy way is by

adb reboot bootloader

Now just flash the modified boot.img and the vbmeta.img in a special way.

fastboot flash boot magisk_patched-$VERSION_$RANDOM.img
fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img

Finishing notes

Reboot into Android, and you should see the Magisk APK telling you now have root and can install Modules!.