Skip to content

Commit

Permalink
kernel: remove official manager support
Browse files Browse the repository at this point in the history
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 <rissu.ntk@gmail.com>
  • Loading branch information
rsuntk committed Nov 12, 2024
1 parent a6dd853 commit f7f6bdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
12 changes: 2 additions & 10 deletions kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"
Expand All @@ -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
Expand Down
5 changes: 1 addition & 4 deletions kernel/apk_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit f7f6bdb

Please sign in to comment.