explaingit

bmax121/apatch

7,464KotlinAudience · developerComplexity · 5/5LicenseSetup · hard

TLDR

An Android rooting tool that patches the kernel directly, supports existing Magisk-compatible modules, and allows deep kernel-level code injection on 64-bit ARM devices.

Mindmap

mindmap
  root((APatch))
    What it does
      Kernel-level rooting
      Magisk module support
      Kernel code injection
    Module systems
      APM modules
      KPM kernel hooks
    Requirements
      64-bit ARM only
      Android kernel 3.18-6.12
      Kernel config flags
    Audience
      Android developers
      Security researchers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Root a 64-bit ARM Android device by patching its kernel using APatch.

USE CASE 2

Run existing Magisk modules on a kernel-patched Android device through the APM module system.

USE CASE 3

Inject custom code into a running Android kernel to intercept or modify low-level OS operations.

Tech stack

KotlinCAndroidARM

Getting it running

Difficulty · hard Time to first run · 1day+

Requires a 64-bit ARM device with Android kernel version 3.18, 6.12 and two specific kernel config flags enabled. Risk of bricking device if misapplied.

Licensed under GPL v3: you can use, modify, and distribute freely, but any modifications you distribute must also be released under GPL v3.

In plain English

APatch is a root solution for Android devices that works at the kernel level. Rooting an Android phone means gaining administrator-level access to the operating system, which lets you make changes that are normally blocked, such as modifying system files or running special apps. APatch achieves this by patching the Android kernel directly, rather than using the more common method of replacing the boot image. The project has two module systems. The first, called APM, supports modules in the same format as Magisk, a widely used rooting tool, so existing Magisk modules work with APatch. The second, called KPM, goes deeper and lets developers inject code directly into the running kernel. This allows for advanced modifications like hooking kernel functions, which is a technique used to intercept or alter how the operating system handles certain operations at a very low level. APatch is built on top of another project called KernelPatch and its app interface was derived from KernelSU, another kernel-based root tool. It only supports 64-bit ARM devices and Android kernel versions between 3.18 and 6.12. Two specific kernel configuration flags must be enabled in the device's kernel for it to work. The README includes a security warning: APatch uses a SuperKey during setup that grants higher-than-root privileges, and using a weak key or exposing it could allow someone else to take control of your device. The project is available on F-Droid and through GitHub releases. It is licensed under the GNU General Public License v3.

Copy-paste prompts

Prompt 1
How do I use APatch to root my 64-bit ARM Android phone, and what kernel configuration flags must be enabled beforehand?
Prompt 2
I have a Magisk module I want to run with APatch. What steps do I follow to install it using the APM module system?
Prompt 3
Explain the difference between APatch APM modules and KPM modules, and when I would use kernel function hooking via KPM.
Prompt 4
What SuperKey security risks does APatch warn about, and how do I choose a strong key during setup?
Open on GitHub → Explain another repo

← bmax121 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.