Convert Figma logo to code with AI

tiann logoKernelSU

A Kernel based root solution for Android

10,029
1,631
10,029
29

Top Related Projects

47,030

The Magic Mask for Android

17,465

LSPosed Framework

10,677

Using system APIs directly with adb/root privileges from normal apps through a Java process started with app_process.

This tool is now dead...

Quick Overview

KernelSU is an open-source kernel-based root solution for Android devices. It provides root access and privilege management directly from the kernel, offering a more secure and versatile alternative to traditional user-space root solutions like Magisk.

Pros

  • Enhanced security due to kernel-level implementation
  • Compatibility with various Android versions and devices
  • Ability to hide root from apps and pass SafetyNet checks
  • Minimal modifications to the system, preserving OTA update functionality

Cons

  • Requires custom kernel or kernel modification, which may be challenging for some users
  • Limited module support compared to more established solutions like Magisk
  • Potential for device instability if not implemented correctly
  • May void device warranty or violate terms of service for some manufacturers

Getting Started

To use KernelSU, follow these general steps:

  1. Check if your device is supported by visiting the KernelSU website.
  2. Download the appropriate kernel image for your device.
  3. Flash the kernel image using a custom recovery (e.g., TWRP) or fastboot.
  4. Install the KernelSU manager app from the GitHub releases page.
  5. Reboot your device and use the KernelSU manager app to grant root access to apps as needed.

Note: The exact steps may vary depending on your device and Android version. Always follow device-specific instructions and backup your data before making system modifications.

Competitor Comparisons

47,030

The Magic Mask for Android

Pros of Magisk

  • More established and widely used in the Android rooting community
  • Extensive module ecosystem for customization and feature enhancement
  • User-friendly GUI for managing root access and modules

Cons of Magisk

  • Requires modification of boot image, potentially triggering SafetyNet checks
  • May be detected by some banking apps and other security-sensitive applications
  • More complex installation process for some devices

Code Comparison

Magisk (init.cpp):

static int magisk_main(int argc, char *argv[]) {
    if (argc > 1 && strcmp(argv[1], "-c") == 0) {
        printf("%s\n", MAGISK_VERSION ":MAGISK");
        return 0;
    }
    // ... (additional code)
}

KernelSU (ksu.c):

int ksu_main(int argc, char **argv) {
    if (argc == 2 && strcmp(argv[1], "-v") == 0) {
        fprintf(stdout, "%s\n", ksu_get_version());
        return 0;
    }
    // ... (additional code)
}

Both projects implement root access management for Android devices, but KernelSU focuses on kernel-level modifications, potentially offering better compatibility with some security measures. However, Magisk provides a more comprehensive set of features and a larger community support base.

17,465

LSPosed Framework

Pros of LSPosed

  • More established project with a larger user base and community support
  • Offers a wider range of customization options and module support
  • Provides a user-friendly GUI for managing modules and settings

Cons of LSPosed

  • Requires a custom recovery (e.g., TWRP) for installation
  • May have compatibility issues with some devices or Android versions
  • Potentially higher impact on system performance due to its extensive features

Code Comparison

LSPosed:

public class XposedBridge {
    private static final String TAG = "LSPosed";
    private static final CopyOnWriteSortedSet<XC_LoadPackage> sLoadedPackageCallbacks = new CopyOnWriteSortedSet<>();
    // ...
}

KernelSU:

int ksu_handle_execve(struct pt_regs *regs) {
    u64 ret = 0;
    struct filename *filename;
    // ...
}

LSPosed uses Java and focuses on app-level modifications, while KernelSU is written in C and operates at the kernel level, providing root access and system-level modifications.

10,677

Using system APIs directly with adb/root privileges from normal apps through a Java process started with app_process.

Pros of Shizuku

  • Does not require kernel modifications, making it more compatible with a wider range of devices
  • Provides a more user-friendly interface for managing app permissions
  • Offers better stability and less risk of system-wide issues

Cons of Shizuku

  • Requires ADB or root access to set up initially
  • May have slightly higher battery consumption due to running as a separate service
  • Limited to specific API functions, unlike KernelSU's full root access

Code Comparison

Shizuku (Java):

@RequiresPermission(Manifest.permission.MANAGE_EXTERNAL_STORAGE)
public static boolean setExternalStorageManager(Context context, boolean allowed) {
    return StorageManager.from(context).setExternalStorageManager(allowed);
}

KernelSU (C):

int su_daemon_main(int argc, char *argv[]) {
    // Initialize KernelSU
    ksu_kernel_init();
    // Start the daemon
    return daemon_main(argc, argv);
}

Both projects aim to provide elevated privileges on Android devices, but they approach the task differently. Shizuku focuses on a more controlled and user-friendly method, while KernelSU offers deeper system integration at the kernel level.

This tool is now dead...

Pros of MagiskHidePropsConf

  • More user-friendly and easier to configure for non-technical users
  • Offers a wider range of device fingerprinting options
  • Integrates seamlessly with existing Magisk ecosystem

Cons of MagiskHidePropsConf

  • Requires Magisk to be installed, limiting compatibility with some devices
  • May not provide as deep-level system modifications as KernelSU
  • Potentially less secure due to reliance on userspace modifications

Code Comparison

MagiskHidePropsConf:

MODDIR=${0%/*}
MAGISKTMP="$(magisk --path)"
MIRROR="$MAGISKTMP/.magisk/mirror"

KernelSU:

int ksu_execve(const char *filename, char *const argv[], char *const envp[])
{
    return ksu_handle_execve(filename, argv, envp, NULL);
}

The code snippets highlight the different approaches:

  • MagiskHidePropsConf uses shell scripts to interact with Magisk's environment
  • KernelSU operates at the kernel level, modifying system calls directly

Both projects aim to enhance Android customization, but KernelSU provides lower-level modifications, while MagiskHidePropsConf offers more user-friendly options within the Magisk framework. The choice between them depends on the user's technical expertise and specific requirements for system modification.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

English | Español | 简体中文 | 繁體中文 | 日本語 | 한국어 | Polski | Português (Brasil) | Türkçe | Русский | Tiếng Việt | Indonesia | עברית | हिंदी | Italiano

KernelSU

logo

A Kernel-based root solution for Android devices.

Latest release Weblate Channel License: GPL v2 GitHub License

Features

  1. Kernel-based su and root access management.
  2. Module system based on OverlayFS.
  3. App Profile: Lock up the root power in a cage.

Compatibility State

KernelSU officially supports Android GKI 2.0 devices (kernel 5.10+). Older kernels (4.14+) are also compatible, but the kernel will have to be built manually.

With this, WSA, ChromeOS, and container-based Android are all supported.

Currently, only arm64-v8a and x86_64 are supported.

Usage

Translation

To help translate KernelSU or improve existing translations, please use Weblate. PR of Manager's translation is no longer accepted, because it will conflict with Weblate.

Discussion

Security

For information on reporting security vulnerabilities in KernelSU, see SECURITY.md.

License

Credits