Skip to content

Custom KernelSU kernel for Samsung Galaxy A31 (SM-A315F/G/N) with root support. Automated builds via GitHub Actions. Compatible with Android 12+ ROMs.

License

GPL-2.0, Unknown licenses found

Licenses found

GPL-2.0
LICENSE
Unknown
COPYING
Notifications You must be signed in to change notification settings

Edhic1/KernelSU_kernel_samsung_a31

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KernelSU Kernel for Samsung Galaxy A31

logo

Build Status GitHub Release License

This repository contains a custom Linux kernel for the Samsung Galaxy A31 (SM-A315F/G/N), based on the official Samsung sources with integrated KernelSU support. KernelSU provides a modern, kernel-based root solution as an alternative to traditional tools like Magisk.

Disclaimer: Building and flashing custom kernels can void your warranty and potentially brick your device. Proceed at your own risk. Always back up your data and have a recovery plan (e.g., stock firmware via Odin).

Features

  • KernelSU Integration: Built-in support for root access via KernelSU. Install the KernelSU manager app after flashing to manage root permissions and modules.
  • Based on LineageOS 19.1: Compatible with Android 12-based ROMs.
  • MediaTek MT6768 Chipset Support: Optimized for the Helio P65 SoC in the Galaxy A31.
  • Automated Builds: Use GitHub Actions to build the kernel and generate flashable ZIPs via AnyKernel3.
  • Patches Applied: Includes kernelsu.patch for seamless KernelSU hooks in file system operations.

Prerequisites

  • Unlocked bootloader on your Samsung Galaxy A31.
  • Custom recovery installed (e.g., TWRP or OrangeFox for A31).
  • Familiarity with ADB, Fastboot, and Odin for recovery in case of issues.

Usage

Downloading Pre-Built Kernels

  • Head to the Releases page.
  • Download the latest KernelSU-A31-Flashable.zip.
  • Boot into recovery and flash the ZIP.
  • Reboot and install the KernelSU Manager APK to enable root.

Building from Source

This repo uses GitHub Actions for automated builds, but you can build locally if preferred.

Local Build

  1. Set up a Linux environment (e.g., Ubuntu 22.04) with dependencies:
    sudo apt install git ccache bc bison build-essential curl flex libelf-dev libssl-dev lz4 ncurses-dev pahole python3 unzip wget xz-utils zstd clang lld
    
  2. Clone the repo:
    git clone https://github.com/Edhic1/KernelSU_kernel_samsung_a31 -b kernel_su
    cd KernelSU_kernel_samsung_a31
    
  3. Download toolchain (e.g., Proton-Clang):
    mkdir toolchains && cd toolchains
    git clone https://github.com/kdrag0n/proton-clang --depth=1
    export PATH="$PWD/bin:$PATH"
    cd ..
    
  4. Build:
    chmod +x buildKernel.sh
    ./buildKernel.sh
    
  5. The output will be in a31/arch/arm64/boot/ (e.g., Image.gz, mt6768.dtb).

Automated Build via GitHub Actions

  1. Fork this repo or use your existing fork.
  2. Go to the Actions tab.
  3. Select the "Build KernelSU Kernel" workflow and run it (optionally provide a release tag).
  4. Download artifacts from the run summary, including the flashable ZIP.

Packaging with AnyKernel3

To create a flashable ZIP:

  1. Combine kernel files:
    cat a31/arch/arm64/boot/Image.gz a31/arch/arm64/boot/mt6768.dtb > Image.gz-dtb
    
  2. Clone and use the customized AnyKernel3 fork:
    git clone https://github.com/Edhic1/AnyKernel3 -b Samsung_A31
    cd AnyKernel3
    cp ../Image.gz-dtb .
    zip -r9 KernelSU-A31-Flashable.zip * -x .git README.md *placeholder
    
  3. Flash the resulting ZIP in recovery.

Credits

  • DevZillion: Original KernelSU fork.
  • KernelSU Team: For the KernelSU project.
  • osm0sis: AnyKernel3 packaging tool.
  • Samsung: For open-source kernel code.
  • LineageOS: Base for the kernel configuration.

License

This kernel is licensed under the GPL-2.0. KernelSU modifications are under their respective licenses.

Contributing

Pull requests are welcome for bug fixes, optimizations, or additional features. Please test thoroughly on a Galaxy A31 device.

Support

For issues, open a GitHub issue here. For device-specific help, check XDA Developers forums for the Samsung Galaxy A31.

About

Custom KernelSU kernel for Samsung Galaxy A31 (SM-A315F/G/N) with root support. Automated builds via GitHub Actions. Compatible with Android 12+ ROMs.

Topics

Resources

License

GPL-2.0, Unknown licenses found

Licenses found

GPL-2.0
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 98.3%
  • Assembly 1.0%
  • Makefile 0.4%
  • Perl 0.1%
  • Shell 0.1%
  • Python 0.1%