From f7f6bdb1bb8e4ea50a5ea5889432d37f6d6c685f Mon Sep 17 00:00:00 2001 From: rsuntk Date: Tue, 12 Nov 2024 20:41:35 +0700 Subject: [PATCH] kernel: remove official manager support This can cause some issue due to some changes on unofficial libksud (e.g sparse image) Since no one will use this on GKI 2.0 I decided to completely remove it, and only make unofficial manager works. Signed-off-by: rsuntk --- kernel/Makefile | 12 ++---------- kernel/apk_sign.c | 5 +---- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 2edf8b4cac9a..d490aa3715d4 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -37,11 +37,8 @@ ifeq ($(shell grep -q "struct selinux_state " $(srctree)/security/selinux/includ ccflags-y += -DKSU_COMPAT_HAS_SELINUX_STATE endif -KSU_EXPECTED_SIZE := 0x033b -KSU_EXPECTED_HASH := c371061b19d8c7d7d6133c6a9bafe198fa944e50c1b31c9d8daa8d7f1fc2d2d6 - -KSU_EXPECTED_SIZE_CUST := 0x396 -KSU_EXPECTED_HASH_CUST := f415f4ed9435427e1fdf7f1fccd4dbc07b3d6b8751e4dbcec6f19671f427870b +KSU_EXPECTED_SIZE := 0x396 +KSU_EXPECTED_HASH := f415f4ed9435427e1fdf7f1fccd4dbc07b3d6b8751e4dbcec6f19671f427870b ifdef KSU_MANAGER_PACKAGE ccflags-y += -DKSU_MANAGER_PACKAGE=\"$(KSU_MANAGER_PACKAGE)\" @@ -51,13 +48,8 @@ endif $(info -- KernelSU Manager signature size: $(KSU_EXPECTED_SIZE)) $(info -- KernelSU Manager signature hash: $(KSU_EXPECTED_HASH)) -$(info -- KernelSU Custom Manager signature size: $(KSU_EXPECTED_SIZE_CUST)) -$(info -- KernelSU Custom Manager signature hash: $(KSU_EXPECTED_HASH_CUST)) - ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE) ccflags-y += -DEXPECTED_HASH=\"$(KSU_EXPECTED_HASH)\" -ccflags-y += -DEXPECTED_SIZE_CUST=$(KSU_EXPECTED_SIZE_CUST) -ccflags-y += -DEXPECTED_HASH_CUST=\"$(KSU_EXPECTED_HASH_CUST)\" ifeq ($(shell grep -q "int path_umount" $(srctree)/fs/namespace.c; echo $$?),0) ccflags-y += -DKSU_UMOUNT diff --git a/kernel/apk_sign.c b/kernel/apk_sign.c index f593940e3239..ba8b73f2eb2b 100644 --- a/kernel/apk_sign.c +++ b/kernel/apk_sign.c @@ -316,8 +316,5 @@ module_param_cb(ksu_debug_manager_uid, &expected_size_ops, bool is_manager_apk(char *path) { - // https://github.com/backslashxx/KernelSU/commit/038375aff1d383f0911c324cecc65f7510b17124 - return (check_v2_signature(path, EXPECTED_SIZE, EXPECTED_HASH) - || check_v2_signature(path, EXPECTED_SIZE_CUST, EXPECTED_HASH_CUST) - ); + return check_v2_signature(path, EXPECTED_SIZE, EXPECTED_HASH); } \ No newline at end of file