feat:增加自定义linker注入

This commit is contained in:
jiqiu2021
2025-06-26 19:59:33 +08:00
parent eb41d924b4
commit d793712a13
27 changed files with 2055 additions and 34 deletions

View File

@@ -42,9 +42,15 @@ public:
void postAppSpecialize(const AppSpecializeArgs *) override {
if (enable_hack) {
// Then start hack thread
std::thread hack_thread(hack_prepare, _data_dir, _package_name, data, length);
hack_thread.detach();
// Get JavaVM
JavaVM *vm = nullptr;
if (env->GetJavaVM(&vm) == JNI_OK) {
// Then start hack thread with JavaVM
std::thread hack_thread(hack_prepare, _data_dir, _package_name, data, length, vm);
hack_thread.detach();
} else {
LOGE("Failed to get JavaVM");
}
}
}