Git Product home page Git Product logo

apatch's Introduction

logo

APatch

Latest Release Nightly Release Weblate Channel GitHub License

The patching of Android kernel and Android system.

  • A new kernel-based root solution for Android devices.
  • APM: Support for modules similar to Magisk.
  • KPM: Support for modules that allow you to inject any code into the kernel (Requires kernel function inline-hook and syscall-table-hook enabled).
  • APatch relies on KernelPatch.
  • The APatch UI and the APModule source code have been derived and modified from KernelSU.

Supported Versions

  • Only supports the ARM64 architecture.
  • Only supports Android kernel versions 3.18 - 6.1

Support for Samsung devices with security protection: Planned

Requirement

Kernel configs:

  • CONFIG_KALLSYMS=y and CONFIG_KALLSYMS_ALL=y

  • CONFIG_KALLSYMS=y and CONFIG_KALLSYMS_ALL=n: Initial support

Security Alert

The SuperKey has higher privileges than root access.
Weak or compromised keys can lead to unauthorized control of your device.
It is critical to use robust keys and safeguard them from exposure to maintain the security of your device.

Translation

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

Translation Status

Get Help

Usage

For usage, please refer to our official documentation.
It's worth noting that the documentation is currently not quite complete, and the content may change at any time.
Furthermore, we need more volunteers to contribute to the documentation in other languages.

Updates

Discussions

More Information

Credits

License

APatch is licensed under the GNU General Public License v3 GPL-3.

apatch's People

Contributors

admirepowered avatar alex193a avatar anaelle-dev avatar bintianqi avatar bmax121 avatar chilan666 avatar crrashh1542 avatar dependabot[bot] avatar dohun0310 avatar gyrorayo avatar igormiguell avatar linsui avatar marat2509 avatar pegioner avatar pomelohan avatar ponces avatar rashadgasimly avatar ravindu644 avatar rejectvanity avatar schwegelbin avatar scruel avatar sekaiacg avatar sowtag avatar symbuzzer avatar tinyhai avatar uaevuon avatar weblate avatar y0geshx avatar yervant7 avatar zenlua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apatch's Issues

An error occurred when uninstalling apatch

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

When I unfortunately uninstalled Apatch, I reinstalled it right after but it came up with unknown error, see screenshot

To Reproduce

  1. Uninstall Apatch
  2. Install Apatch.apk
  3. Open the application

Expected behavior

Root permissions remain in applications that have granted root access, but the Apatch manager has shown no longer having root permissions

Screenshots

Screenshot_2024-01-11-23-31-24-687_me bmax apatch

Logs

No response

Device info

  • Device: raphael k20pro
  • OS Version: 14
  • APatch Version: 10388
  • Kernel Version: 4.14.275

Additional context

No response

修补oppo a72成功卡开机了

内核源码配置要开启下面两个
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
才不会报错
kallsyms_num那个�®

但是刷入不开机

./kptools segment fault

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

Segment fault while patching the boot
No new boot generated

To Reproduce

  1. Enter the app,
  2. Tap Patch and enter my passphrase and tap OK
  3. Chose the image from a backup of KernelFlasher
  4. Segment fault and no new boot generated

Expected behavior

Patch the image, and generate new-boot.img

Screenshots

Screenshot_20240111-151925

Logs

APatch_bugreport_2024-01-11_15_21.tar.gz

Device info

  • Device: Google Pixel 8 Pro
  • OS Version: Android 14
  • APatch Version: 10376-1-gc9312a1
  • Kernel Version: 5.15.110

Additional context

No response

Safety net test

It won't pass the integrity test, not even the foundation
He failed me in the test earlier

安卓13 ,5.15,操作成功,但无法开机,需要提供什么吗

安卓13 ,5.15,操作成功,但无法开机,需要提供什么吗
./kptools -p Image --kpimg /root/tools/build/kpimg --skey 123456 --out kernel

[+] kptools image size 0x02700a00
[-] kptools kernel patch image size: 0x000255b4
[+] kernel image_size: 0x02700a00
[+] kernel uefi header: true
[+] kernel load_offset: 0x00000000
[+] kernel kernel_size: 0x027a0000
[+] kernel page_shift: 12
[+] kptools kernel new size 0x027c55b4
[+] kernel linux_banner offset: 0x01ad7e92
[+] kernel linux_banner: Linux version 5.15.94-android13-8-gdf77205a33ef (build-user@build-host) (Android (8508608, based on r450784e) clang version 14.0.7 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6), LLD 14.0.7) #1 SMP PREEMPT Fri Aug 18 23:59:44 UTC 2023
[+] kernel version major: 5, minor: 15, patch: 94
[+] kallsyms kallsyms_token_table offset: 0x019d78e8
[+] kallsyms endian: little
[+] kallsyms kallsyms_token_index offset: 0x019d7c20
[-] kallsyms find arm64 relocation table error
[+] kallsyms kallsyms_markers range: [0x019d6e18, 0x019d78e8), count: 0x000002b4
[+] kallsyms approximate kallsyms_offsets range: [0x015791f8, 0x01625fc4) count: 0x0002b373
[+] kallsyms kallsyms_names offset: 0x01625fd8
[+] kallsyms kallsyms_num_syms offset: 0x01625fd0, value: 0x0002b373
[+] kallsyms linux_banner index: 0x0001c5d9
[+] kallsyms kallsyms_offsets offset: 0x015791f8
[+] kptools map_start: 0x200, max_size: 0x800
[+] kallsyms kallsyms_lookup_name: type: T, offset: 0x00241674
[-] kallsyms can't find symbol: printk
[+] kallsyms paging_init: type: T, offset: 0x0238297c
[+] kallsyms memblock_reserve: type: T, offset: 0x003d3400
[+] kallsyms memblock_alloc_try_nid: type: T, offset: 0x023979f4
[+] kallsyms memstart_addr: type: D, offset: 0x01d0baf0
[+] kallsyms vabits_actual: type: D, offset: 0x02700010
[+] kallsyms kimage_voffset: type: D, offset: 0x01d0baf8
[+] kptools supercall key: 123456
[+] kptools patch done: kernel

FC manager when clicking buttons on Superuser section...

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

...when both AndroidPatch and KernelPatch not installed.

Other sections show 'not installed' warnings but in SuperUser section, apps are listed and buttons are enabled. When trying to change superuser or module settings of an app, manager force close

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Logs

No response

Device info

  • Device:
  • OS Version:
  • APatch Version:
  • Kernel Version:

Additional context

No response

魅族18s 10.3刷入后卡meizu

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

boot链接 https://www.123pan.com/s/xykDVv-YNLN.html
修补后 刷入卡meizu
微信图片_20240110193216

To Reproduce

No response

Expected behavior

No response

Screenshots

微信图片_20240110193125
微信图片_20240110193216
微信图片_20240110193321

Logs

No response

Device info

  • Device:魅族18s
  • OS Version:flyme10.3
  • APatch Version:10363
  • Kernel Version:5.4.148

Additional context

No response

Su cannot respond

I have given root permission,But which su cannot be used normally and su cannot respond. How can I adapt it
IMG_20240110_194527_892

OTA survival for kernel like Magisk?

Does this feature exist or is it planned to be added? I have a business where I have to use LineageOS and LineageOS Recovery.

It is not very practical to repeatedly install from the computer after weekly updates.

Failed to patch boot.img (Redmi note 9 / Merlinx)

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

My Device is Redmi Note 9 (Merlinx).
I am using CRDroid 10 (Android 14) Custom rom.
I've extract boot.img from the zip rom, and put it in some folder in my internal storage.
then I try to patch it, but I got an error like this

image

To Reproduce

  1. Extract boot.img from Official CRdroid 10 (Android 14)
  2. Put it at some folder
  3. Install latest APatch.apk
  4. Click patch button
  5. Enter some key / password
  6. Point to boot.img file
  7. Patch it

Expected behavior

it should be success patch the boot.img

Screenshots

image

Logs

APatch_bugreport_2024-01-04_21_34.tar.gz

Device info

  • Device: Redmi note 9 (Merlinx)
  • OS Version: A14
  • APatch Version: Latest
  • Kernel Version: I dunno the kernel version

Additional context

I think it only happen to my device and rom

修补boot失败

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

修补boot失败
Screenshot_2024-01-10-11-21-27-115_me bmax apatch

To Reproduce

No response

Expected behavior

No response

Screenshots

Screenshot_2024-01-10-11-21-27-115_me bmax apatch

Logs

No response

Device info

  • Device:redmi k30 ultra
  • OS Version:miui14.0.5 android12
  • APatch Version:10348-2-gaba079e
  • Kernel Version:4.14.186-perf-00252-g2f26b5917fd6

Additional context

No response

Failed to patch (polaris a13 pe+)

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

After flashing Boot my phone does not boot into firmware

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Logs

No response

Device info

  • Device: polaris
  • OS Version: Pixel Experience (android 13, October patch)
  • APatch Version: lasted (10302-7-gc3b7520)
  • Kernel Version: 4.9.337

Additional context

No response

crux could not power on

i use the recovery function on twrp,use boot.emmc.wim patch it,then i flash it into,As a result, the power is not turned on
Is it because my boot doesn't have a ramdisk?

IMG_20231231_032324_1
IMG_20231231_032338_1
IMG_20231231_032353
IMG_20231231_032355_1
IMG_20231231_032958

We got bugs🐞

Screen_Recording_20240111_060542_APatch.mp4

when changing language, back button seems not working, also it make the app crashes. btw it works.
Screenshot_20240111_060753_One UI Home

App icon is darker too. Expected color = dark blue.

内核不支持overlayfs,如何解决,5.10-gki

内核版本:5.10.149-gki
设备型号:iQOO 9
Android版本:Android 13

问题:
您好,我有一个设备是5.10.149-gki内核
我刷入ksu的ak3后无法使用模块系统,ksu管理器提示 内核不支持overlay
使用APatch后也是一样提示 内核不支持overlayfs,有什么方法可以解决么,或者可以通过patch启用overlayfs吗

没有内核源码
最好继续使用原厂映像,只是在上面修改而不是采用通用映像

魅族Flyme9 安卓11修补Boot失败

根据我的试验,密钥从256位一直对半折,一直折到16位才修补成功,建议作者在密钥那里做个最高支持几位密钥的提示

[Path Failed] kallsyms kallsyms_num_syms error

I'm trying to patch a boot.img from Redmi Note 8 Pro, unfortunately got analyze_kallsym_info error. My device partition contains vbmeta and I'm not sure it's related to the issue or not. Fyi, I don't get any issue when patching the boot.img from Mi 10 device. Any pointer how to resolve this issue? Thanks.

关于modules目录下文件可读的问题

您好,我是刚刚使用apatch的开发者,但是我发现相比ksu和magisk,apatch的/data/adb/modules目录下的文件在引导完成后是不可见的,但许多老的模块需要读取或修改这里面的文件,想问一下是否有兼容模式可以让该路径下的文件在引导完成后保留?

Kernel patching is not possible

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

I tried the patch with two boot images I have, but both got the same error. My device is Nokia 5.3.

To Reproduce

No response

Expected behavior

No response

Screenshots

Screenshot_20240108-225012
Screenshot_20240108-223056

Logs

APatch_bugreport_2024-01-08_22_47.tar.gz

Device info

  • Device: Nokia 5.3
  • OS Version: 13
  • APatch Version:10318-2
  • Kernel Version:4.14.190

Additional context

No response

Magisk module installation mode

It is suggested to change the installed magisk module into an independent img file, instead of putting all modules in the same img file. If a certain magisk module causes the machine to fail to start, you only need to delete the img file of a single magisk module, not all of them.

Apatch image not boot on Motorola G20

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

After flashing the patched boot image, the device cannot proceed to the boot logo screen and is frozen there. The device is a Motorola G20 unisoc T700 processor.

NOTE: It has already been tested with vbmeta turned off.

To Reproduce

    1. Flash boot image patched.
    1. Reboot
    1. Device freeze on bootlogo.

Expected behavior

No response

Screenshots

No response

Logs

APatch_bugreport_2024-01-10_08_07.tar.gz

Device info

  • Device: Motorola G20 (Java)
  • OS Version: 11
  • APatch Version: 10363
  • Kernel Version: 4.14.193

Additional context

No response

可以增加KernelSU上的默认卸载模块选项吗?

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

只有给应用关闭移除模块选项才能生效,这让一些全局模块,比如hosts在没有关闭移除模块选项的应用中不生效,ksu有默认卸载模块的选项可以设置黑白名单模式

To Reproduce

只有给应用关闭移除模块选项才能生效,一些全局模块,比如systemless hosts在没有关闭移除模块选项的应用中不生效

Expected behavior

添加一个让模块对于所有应用生效的选项

Screenshots

这是ksu的选项
Screenshot_20240111-163855

Logs

No response

Device info

  • Device:xiaomi mi 10
  • OS Version:14
  • APatch Version:10398
  • Kernel Version:4.19.157

Additional context

No response

app修补boot.img在安卓10以上没权限

/storage/emulated/0/Download这个路径会没权限,应该放在/data/data下面,

diff --git a/app/src/main/java/me/bmax/akpatch/ui/util/Patch.kt b/app/src/main/java/me/bmax/akpatch/ui/util/Patch.kt
index c14a962..21f22e5 100644
--- a/app/src/main/java/me/bmax/akpatch/ui/util/Patch.kt
+++ b/app/src/main/java/me/bmax/akpatch/ui/util/Patch.kt
@@ -88,7 +88,8 @@ fun patchBootimg(uri: Uri, superKey: String, onMessage: (String) -> Unit): Int {
     val currentTime = dateFormat.format(time)
     val nativeDir = File(pApp.applicationInfo.nativeLibraryDir)
     onMessage("exe_dir: ${nativeDir.absolutePath}")
-    val workDir = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "akpatch_${currentTime}")
+//    val workDir = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "akpatch")
+    val workDir = File("/data/data/me.bmax.akpatch")
     workDir.mkdirs()
     onMessage("work_dir: ${workDir.absolutePath}")

不过后面的修补又报错了

After successfully patching, I flashed in, but the boot logo page kept getting stuck and I couldn’t enter the system.

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

After flashing in, I am stuck on the startup logo page and cannot enter the system.

To Reproduce

No response

Expected behavior

Ask developers for help in adapting the kernel.

Screenshots

Screenshot_2024-01-13-10-57-28-46_fc704e6b13c4fb26bf5e411f75da84f2
Screenshot_2024-01-13-10-57-34-37_fc704e6b13c4fb26bf5e411f75da84f2
Screenshot_2024-01-13-11-08-51-95

Logs

Unable to upload boot.img larger than 25M, where should I upload boot.img?
APatch_bugreport_2024-01-13_11_13.tar.gz

Device info

  • Device:OnePlus 9 Pro(LE2120)
  • OS Version:Android 11(ColorOS v11.2)
  • APatch Version:10413
  • Kernel Version:5.4.61-qgki-ga139308

Additional context

No response

在编译bootimgtools时候缺少很多依赖

cd imgtools mkdir build; cd build cmake .. make
在最后make的时候出现很多出错,我尝试修改了一下,比如
android error: ‘strlen’ was not declared in this scope
我将#include <string>改成#include <cstring>
error: ‘sDIR’ does not name a type; did you mean ‘DIR’?,我改成#include <dirent.h>,但是问题太多了,要改很多东西
make.log

Patch button not translated

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • If patch failed, root failed, or device unable to boot after flashing the new boot.img. Please goto KernelPatch
  • I will upload bugreport file in APatch Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

Patch button not translated

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Logs

No response

Device info

  • Device:
  • OS Version:
  • APatch Version:
  • Kernel Version:

Additional context

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.