Fix legacy prctl check condition (#2864)

This commit is contained in:
Wang Han
2025-11-05 14:48:33 +08:00
committed by ShirkNeko
parent 0400b94674
commit 99bec0e439
3 changed files with 3 additions and 3 deletions

View File

@@ -131,7 +131,7 @@ bool is_manager() {
return (info.flags & 0x2) != 0;
}
// Legacy Compatible
return legacy_get_info().version;
return legacy_get_info().version > 0;
}
bool uid_should_umount(int uid) {

View File

@@ -50,7 +50,7 @@ static bool ksuctl(int cmd, void* arg1, void* arg2) {
struct ksu_version_info legacy_get_info()
{
int32_t version = 0;
int32_t version = -1;
int32_t flags = 0;
ksuctl(CMD_GET_VERSION, &version, &flags);
return (struct ksu_version_info){version, flags};

View File

@@ -189,7 +189,7 @@ object Natives {
}
fun requireNewKernel(): Boolean {
if (version < MINIMAL_SUPPORTED_KERNEL) return true
if (version != -1 && version < MINIMAL_SUPPORTED_KERNEL) return true
return isVersionLessThan(getFullVersion(), MINIMAL_SUPPORTED_KERNEL_FULL)
}