Refactor: simplify injector/libinject/loader code

- libinject: drop debug cruft, dedup JNI overloads into jni_inject, const-correct inject()
- loader: reuse Utils::call_java_impl for JNI bootstrap
- JvmAttach: collapse acquire_jvm/env/jvmti retry loops into one template
- injector: remove redundant copy_arg wrapper
- DllMain: remove no-op DLL_THREAD cases, merge attach logs
- libagent: guard add_library so empty source dir does not break configure
This commit is contained in:
xiaozhou233 committed 2026-08-15 12:55:27 +08:00
1 parent a251b8996e
commit bcc1ecbf0e
6 files changed
+82 -181

No files matched your search

+3 -14
View File
@@ -9,22 +9,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
DisableThreadLibraryCalls(hinstDLL);
Logger::init("libloader.log");
spdlog::info("DllMain: DLL_PROCESS_ATTACH");
// Get the runtime directory from the lpReserved parameter
const char* runtime_dir = (const char*)lpReserved;
spdlog::info("DllMain: runtime_dir: {}", runtime_dir);
// lpReserved carries the runtime directory from the reflective loader
const char* runtime_dir = (const char*)lpReserved;
spdlog::info("DllMain: DLL_PROCESS_ATTACH, runtime_dir: {}", runtime_dir);
JuiceAgent::Loader::entrypoint(runtime_dir);
break;
}
case DLL_THREAD_ATTACH: {
break;
}
case DLL_THREAD_DETACH: {
break;
}