add: Magisk variant status; improve: KSU detection

This commit adds the Magisk variant to module description, and also improves KernelSU detection by requiring the userspace part of it to be installed, AKA "ksud".
This commit is contained in:
ThePedroo
2024-10-24 16:51:23 -03:00
parent 380ef011a1
commit 135ebbb9ba
12 changed files with 245 additions and 222 deletions

View File

@@ -17,6 +17,7 @@
#include <android/log.h>
#include "utils.h"
#include "root_impl/common.h"
bool switch_mount_namespace(pid_t pid) {
char path[PATH_MAX];
@@ -411,3 +412,37 @@ int non_blocking_execv(const char *restrict file, char *const argv[]) {
return -1;
}
void stringify_root_impl_name(struct root_impl impl, char *restrict output) {
switch (impl.impl) {
case None: {
strcpy(output, "None");
break;
}
case Multiple: {
strcpy(output, "Multiple");
break;
}
case KernelSU: {
strcpy(output, "KernelSU");
break;
}
case APatch: {
strcpy(output, "APatch");
break;
}
case Magisk: {
if (impl.variant == 0) {
strcpy(output, "Magisk Official");
} else {
strcpy(output, "Magisk Kitsune");
}
break;
}
}
}