fix: runtime KSUN manager switch detection

This commit fixes the issue where the new KernelSU Next manager wouldn't be recognized if it was changed without a reboot.
This commit is contained in:
ThePedroo
2025-07-01 14:31:06 -03:00
parent e036b1f40a
commit b6f02b39b3

View File

@@ -24,7 +24,6 @@
static enum kernelsu_variants variant = KOfficial; static enum kernelsu_variants variant = KOfficial;
static uid_t manager_uid = 0;
static bool supports_manager_uid_retrieval = false; static bool supports_manager_uid_retrieval = false;
void ksu_get_existence(struct root_impl_state *state) { void ksu_get_existence(struct root_impl_state *state) {
@@ -101,7 +100,7 @@ bool ksu_uid_is_manager(uid_t uid) {
KernelSU Next have different package names. KernelSU Next have different package names.
*/ */
if (supports_manager_uid_retrieval) { if (supports_manager_uid_retrieval) {
if (manager_uid == 0) uid_t manager_uid = 0;
prctl(KERNEL_SU_OPTION, CMD_GET_MANAGER_UID, &manager_uid, NULL, NULL); prctl(KERNEL_SU_OPTION, CMD_GET_MANAGER_UID, &manager_uid, NULL, NULL);
return uid == manager_uid; return uid == manager_uid;