Among the Android modding circles, there's no app more recognizable than Magisk. It has a well-earned reputation as the de facto standard for rooting your phone, tablet, and really just about anything that runs Android. While Magisk managed to establish itself as the successor to Chainfire's SuperSU, the aftermarket development community stumbled on multiple root solutions during the transition phase. Apart from the notable ones, e.g. the LineageOS su add-on or XDA Recognized Developer phhusson's SuperUser, we also came across unique implementations, such as Kernel Assisted Superuser (KernelSU) by Jason Donenfeld AKA XDA Recognized Developer zx2c4.
Unlike other conventional rooting methods, KernelSU embedded the ability to gain root access into the underlying Linux kernel of Android itself. However, it never received mainstream traction because there was no easy way to patch the existing device-specific kernel of the stock boot image on the fly. Not only had you needed to incorporate it during the kernel build process, but the lack of a root manager app also made it difficult for regular users. Having said that, Google's strategy of enforcing Generic Kernel Image essentially removed a major roadblock to the adoption of a PC-esque kernel update mechanism, which means cooking up a set of device-agnostic rooted boot images isn't a difficult task anymore. Planning for this eventuality, XDA Senior Member weishu, the developer of VirtualXposed and Taichi, has now come up with a new iteration of the kernel-based root solution for Android.
The GKI-compatible KernelSU adaptation by weishu has a number of advantages over the initial version. The wider compatibility is a prime factor, as every Android device launching with kernel version 5.10 or higher should be accordant with this project. Moreover, the developer offers a dedicated root management app, which allows you to easily toggle superuser access for the installed apps. Last but not least, this variant of KernelSU also supports overlay-based modding, so that you can make alterations to read-only partitions without physically reshaping them.
For devices compliant with GKI 2.0, you can root them by downloading a suitable pre-patched boot image from the project's Buildbot and flashing it, provided you can unlock the bootloader. Kernel builders can also compile the images themselves and even integrate KernelSU for certain non-GKI kernels (with some limitations) as well. To know more about rooting your Android smartphone with KernelSU, take a look at our upcoming tutorial.
It's worth noting that weishu's KernelSU is still a work-in-progress solution, so you may face random bugs and glitches here and there in case you heavily rely on root-enabled apps. But if you’re a kernel or ROM developer, or if you're dead set on using the new tool, check out the project’s homepage and GitHub repository to learn more.
KernelSU by weishu: Website || GitHub repo