How to install Magisk with ADB
Does not require the availability of custom recovery and root-access
1. Delete all other types of root-access and restore the partition image of the boot partition
2. Download Magisk v13.6 or later and download / unzip from the firmware partition image of the boot partition
3. Unpack the Magisk archive, put the boot image of the boot partition in the same folder, and rename it to boot.img
4. Rename the folder with the name corresponding to the architecture of your device (arm, arm64, chromeos, x64, x86), in magisk_inject
5. In the terminal, change the current directory to the folder with Magisk and run the following commands one at a time:
PHP:
adb shell "rm -rf / data / local / tmp / *"
adb push META-INF / com / google / android / update-binary common magisk_inject boot.img / data / local / tmp
adb shell "cd / data / local / tmp / magisk_inject; mv ../common/*.; chmod 755 *; sh ../update-binary indep boot_patch.sh ../boot.img; mv ../bin/ busybox busybox "
adb pull /data/local/tmp/magisk_inject/new-boot.img
adb shell "cd / data / local / tmp; rm -rf * .img magisk_inject / *. img update-binary bin common"
6. To flash the resulting boot partition image with the name new-boot.img
PHP:
fastboot flash boot new-boot.img
7. Download the system and make sure that Magisk Manager is installed and that its version corresponds to the version of Magisk. If not, manually install the correct version of Magisk Manager.