manager: add module signature verification

fix site base
This commit is contained in:
ShirkNeko
2025-08-03 04:34:04 +08:00
parent 7e7d2a28af
commit 48d7a13028
8 changed files with 82 additions and 1 deletions

View File

@@ -413,3 +413,22 @@ NativeBridgeNP(getManagersList, jobject) {
LogDebug("getManagersList: count=%d", managerListInfo.count);
return obj;
}
NativeBridge(verifyModuleSignature, jboolean, jstring modulePath) {
#if defined(__aarch64__) || defined(_M_ARM64)
if (!modulePath) {
LogDebug("verifyModuleSignature: modulePath is null");
return false;
}
const char* cModulePath = GetEnvironment()->GetStringUTFChars(env, modulePath, nullptr);
bool result = verify_module_signature(cModulePath);
GetEnvironment()->ReleaseStringUTFChars(env, modulePath, cModulePath);
LogDebug("verifyModuleSignature: path=%s, result=%d", cModulePath, result);
return result;
#else
LogDebug("verifyModuleSignature: not supported on non-arm64 architecture");
return false;
#endif
}