From c7d9336b705697247f7e5edaf8228deaa3ee6c4d Mon Sep 17 00:00:00 2001 From: xiaozhou233 Date: Sun, 5 Apr 2026 14:26:33 +0800 Subject: [PATCH] Refactor: preload event --- src/libagent/libagent.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/libagent/libagent.cpp b/src/libagent/libagent.cpp index 4e57d27..76cbbec 100644 --- a/src/libagent/libagent.cpp +++ b/src/libagent/libagent.cpp @@ -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;