manager: Add the ability to get the hook type

This commit is contained in:
ShirkNeko
2025-06-13 14:39:16 +08:00
parent 9f407a94e3
commit 2d9783e3d4
5 changed files with 22 additions and 2 deletions

View File

@@ -310,4 +310,9 @@ Java_com_sukisu_ultra_Natives_setSuEnabled(JNIEnv *env, jobject thiz, jboolean e
extern "C" JNIEXPORT jboolean JNICALL
Java_com_sukisu_ultra_Natives_isKPMEnabled(JNIEnv *env, jobject) {
return is_KPM_enable();
}
extern "C" JNIEXPORT jboolean JNICALL
Java_com_sukisu_ultra_Natives_getHookType(JNIEnv *env, jobject) {
return get_hook_type();
}

View File

@@ -30,6 +30,7 @@
#define CMD_IS_SU_ENABLED 14
#define CMD_ENABLE_SU 15
#define CMD_ENABLE_KPM 100
#define CMD_HOOK_TYPE 101
static bool ksuctl(int cmd, void* arg1, void* arg2) {
int32_t result = 0;
@@ -102,4 +103,9 @@ bool is_su_enabled() {
bool is_KPM_enable() {
bool enabled = false;
return ksuctl(CMD_ENABLE_KPM, &enabled, nullptr), enabled;
}
bool get_hook_type() {
bool enabled = false;
return ksuctl(CMD_HOOK_TYPE, &enabled, nullptr), enabled;
}

View File

@@ -85,4 +85,6 @@ bool is_su_enabled();
bool is_KPM_enable();
#endif //KERNELSU_KSU_H
bool get_hook_type();
#endif //KERNELSU_KSU_H