From f0febf13f2326c97d0920fa9d4fde11570e92b45 Mon Sep 17 00:00:00 2001 From: liankong Date: Mon, 7 Apr 2025 19:43:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E5=85=BC=E5=AE=B9=E5=87=BD=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E7=A1=AE=E4=BF=9D=E8=83=BD=E5=A4=9F=E8=BF=90?= =?UTF-8?q?=E8=A1=8CPeekaboo.KPM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/kpm/compact.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/kernel/kpm/compact.c b/kernel/kpm/compact.c index e25a7a53..01f00e80 100644 --- a/kernel/kpm/compact.c +++ b/kernel/kpm/compact.c @@ -26,9 +26,29 @@ #include #include "kpm.h" #include "compact.h" +#include "../allowlist.h" unsigned long sukisu_compact_find_symbol(const char* name); +// ====================================================================== +// 兼容函数 for KPM + +static +int sukisu_is_su_allow_uid(uid_t uid) { + return ksu_is_allow_uid(uid) ? 1 : 0; +} + +static +int sukisu_get_ap_mod_exclude(uid_t uid) { + // Not supported + return 0; +} + +static +int sukisu_is_uid_should_umount(uid_t uid) { + return ksu_uid_should_umount(uid) ? 1 : 0; +} + // ====================================================================== struct CompactAddressSymbol { @@ -39,7 +59,10 @@ struct CompactAddressSymbol { static struct CompactAddressSymbol address_symbol [] = { { "kallsyms_lookup_name", &kallsyms_lookup_name }, { "compact_find_symbol", &sukisu_compact_find_symbol }, - { "is_run_in_sukisu_ultra", (void*)1 } + { "is_run_in_sukisu_ultra", (void*)1 }, + { "is_su_allow_uid", &sukisu_is_su_allow_uid }, + { "get_ap_mod_exclude", &sukisu_get_ap_mod_exclude }, + { "is_uid_should_umount", &sukisu_is_uid_should_umount } }; unsigned long sukisu_compact_find_symbol(const char* name) {