Installing BakaSU
On this page
Get Manager
Install
BakaSU provides the following two installation methods:
LKM Installation
GKI2/GKI1/Non-GKI Kernel (AnyKernel3) Installation
Although the BakaSU Manager has a built-in AnyKernel3 installation method, this option will not be displayed if the Manager does not have ROOT access. You may need to perform the following steps to enable it
-
Flash AnyKernel3 after LKM installation to grant root.
-
Using
magiskbootto manual patch boot.img.
Patch boot.img manually
The official build of magiskboot can only run on Android devices, if you want to run it on PC, you can try the second option.
Preparation
- Get your device's stock boot.img. You can get it from your device manufacturers. You may need payload-dumper-go.
- Unpack the AnyKernel3 package and get the
Imagefile, which is the kernel file of KernelSU.
Using magiskboot on Android devices
- Download latest Magisk from GitHub Releases.
- Rename
Magisk-*(version).apktoMagisk-*.zipand unzip it. - Push
Magisk-*/lib/arm64-v8a/libmagiskboot.soto your device by ADB:adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot - Push stock boot.img and Image in AnyKernel3 to your device.
- Enter ADB shell and run
cd /data/local/tmp/directory, thenchmod +x magiskboot - Enter ADB shell and run
cd /data/local/tmp/directory, execute./magiskboot unpack boot.imgto unpackboot.img, you will get akernelfile, this is your stock kernel. - Replace
kernelwithImageby running the command:mv -f Image kernel. - Execute
./magiskboot repack boot.imgto repack boot image, and you will get anew-boot.imgfile, flash this file to device by fastboot.
Using magiskboot on Windows/macOS/Linux PC
- Download the corresponding
magiskbootbinary for your OS from magiskboot_build. - Prepare stock
boot.imgandImagein your PC. - Run
chmod +x magiskboot. - Enter the corresponding directory, execute
./magiskboot unpack boot.imgto unpackboot.img, you will get akernelfile, this is your stock kernel. - Replace
kernelwithImageby running the command:mv -f Image kernel. - Execute
./magiskboot repack boot.imgto repack the boot image, and you will get anew-boot.imgfile, flash this file to device by fastboot.