kernel: Enhance the user space scanning functionality
This commit is contained in:
@@ -431,4 +431,16 @@ NativeBridge(verifyModuleSignature, jboolean, jstring modulePath) {
|
||||
LogDebug("verifyModuleSignature: not supported on non-ARM architecture");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
NativeBridgeNP(isUidScannerEnabled, jboolean) {
|
||||
return is_uid_scanner_enabled();
|
||||
}
|
||||
|
||||
NativeBridge(setUidScannerEnabled, jboolean, jboolean enabled) {
|
||||
return set_uid_scanner_enabled(enabled);
|
||||
}
|
||||
|
||||
NativeBridgeNP(clearUidScannerEnvironment, jboolean) {
|
||||
return clear_uid_scanner_environment();
|
||||
}
|
||||
@@ -48,6 +48,7 @@ extern const char* zako_file_verrcidx2str(uint8_t index);
|
||||
#define CMD_GET_SUSFS_FEATURE_STATUS 102
|
||||
#define CMD_DYNAMIC_MANAGER 103
|
||||
#define CMD_GET_MANAGERS 104
|
||||
#define CMD_ENABLE_UID_SCANNER 105
|
||||
|
||||
#define DYNAMIC_MANAGER_OP_SET 0
|
||||
#define DYNAMIC_MANAGER_OP_GET 1
|
||||
@@ -249,4 +250,18 @@ bool verify_module_signature(const char* input) {
|
||||
LogDebug("verify_module_signature: not supported on non-ARM architecture, path=%s", input ? input : "null");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool is_uid_scanner_enabled() {
|
||||
bool status = false;
|
||||
ksuctl(CMD_ENABLE_UID_SCANNER, (void*)0, &status);
|
||||
return status;
|
||||
}
|
||||
|
||||
bool set_uid_scanner_enabled(bool enabled) {
|
||||
return ksuctl(CMD_ENABLE_UID_SCANNER, (void*)1, (void*)enabled);
|
||||
}
|
||||
|
||||
bool clear_uid_scanner_environment() {
|
||||
return ksuctl(CMD_ENABLE_UID_SCANNER, (void*)2, NULL);
|
||||
}
|
||||
@@ -137,4 +137,10 @@ bool get_managers_list(struct manager_list_info* info);
|
||||
|
||||
bool verify_module_signature(const char* input);
|
||||
|
||||
bool is_uid_scanner_enabled();
|
||||
|
||||
bool set_uid_scanner_enabled(bool enabled);
|
||||
|
||||
bool clear_uid_scanner_environment();
|
||||
|
||||
#endif //KERNELSU_KSU_H
|
||||
Reference in New Issue
Block a user