Refactor: preload event

This commit is contained in:
xiaozhou233 committed 2026-04-05 14:26:33 +08:00
1 parent c11891e718
commit c7d9336b70
1 file changed
+7 -8
+7 -8
View File
@@ -14,13 +14,6 @@ namespace JuiceAgent {
bool Agent::init(JavaVM* jvm, JNIEnv* env, jvmtiEnv* jvmti) {
PLOGI << "JuiceAgent Native EntryPoint Invoked!";
// PreLoad Event
eventbus.post(EventPreLoad{
.jvm = jvm,
.env = env,
.jvmti = jvmti
});
// ======== neccessary environment check ========
if (jvm == nullptr) {
PLOGE << "Failed to initialize JuiceAgent: jvm is null";
@@ -37,9 +30,15 @@ namespace JuiceAgent {
set_jvm(jvm);
set_jvmti(jvmti);
PLOGD << "env: " << env << ", jvmti: " << jvmti;
// PreLoad Event
eventbus.post(EventPreLoad{
.jvm = jvm,
.env = env,
.jvmti = jvmti
});
// ======== Application ability ========
jvmtiCapabilities caps{};
caps.can_get_bytecodes = 1;