BakaSU
Return to top

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

  1. Flash AnyKernel3 after LKM installation to grant root.

  2. Using magiskboot to manual patch boot.img.

Patch boot.img manually

  1. magiskboot
  2. magiskboot_build

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
  1. Get your device's stock boot.img. You can get it from your device manufacturers. You may need payload-dumper-go.
  2. Unpack the AnyKernel3 package and get the Image file, which is the kernel file of KernelSU.
Using magiskboot on Android devices
  1. Download latest Magisk from GitHub Releases.
  2. Rename Magisk-*(version).apk to Magisk-*.zip and unzip it.
  3. Push Magisk-*/lib/arm64-v8a/libmagiskboot.so to your device by ADB: adb push Magisk-*/lib/arm64-v8a/libmagiskboot.so /data/local/tmp/magiskboot
  4. Push stock boot.img and Image in AnyKernel3 to your device.
  5. Enter ADB shell and run cd /data/local/tmp/ directory, then chmod +x magiskboot
  6. Enter ADB shell and run cd /data/local/tmp/ directory, execute ./magiskboot unpack boot.img to unpack boot.img, you will get a kernel file, this is your stock kernel.
  7. Replace kernel with Image by running the command: mv -f Image kernel.
  8. Execute ./magiskboot repack boot.img to repack boot image, and you will get a new-boot.img file, flash this file to device by fastboot.
Using magiskboot on Windows/macOS/Linux PC
  1. Download the corresponding magiskboot binary for your OS from magiskboot_build.
  2. Prepare stock boot.img and Image in your PC.
  3. Run chmod +x magiskboot.
  4. Enter the corresponding directory, execute ./magiskboot unpack boot.img to unpack boot.img, you will get a kernel file, this is your stock kernel.
  5. Replace kernel with Image by running the command: mv -f Image kernel.
  6. Execute ./magiskboot repack boot.img to repack the boot image, and you will get a new-boot.img file, flash this file to device by fastboot.

Search guides, devices, and kernel integration.