[Refactor] Remove useless code

This commit is contained in:
xiaozhou233 committed 2025-10-29 19:48:35 +08:00
1 parent b46802faaa
commit 8e42780eed
3 files changed
+1 -19

No files matched your search

-1
View File
@@ -9,7 +9,6 @@
typedef struct _InjectionInfo {
char BootstrapAPIPath[INJECT_PATH_MAX];
char JuiceLoaderJarPath[INJECT_PATH_MAX];
char JuiceLoaderLibPath[INJECT_PATH_MAX];
char EntryJarPath[INJECT_PATH_MAX];
char EntryClass[INJECT_PATH_MAX];
char EntryMethod[INJECT_PATH_MAX];
+1 -3
View File
@@ -124,11 +124,10 @@ DWORD WINAPI ThreadProc(LPVOID lpParam) {
// init juiceloader
log_info("init juice loader...");
init_juiceloader(env, jvmti);
initLogger();
log_info("juice loader init done");
// Invoke loader.init(JuiceLoaderLibPath, EntryJarPath)
log_info("invoking loader init()...");
log_info("============ Loader Info ============\n");
jclass cls = (*env)->FindClass(env, "cn/xiaozhou233/juiceloader/JuiceLoader");
@@ -147,7 +146,6 @@ DWORD WINAPI ThreadProc(LPVOID lpParam) {
return 1;
}
(*env)->CallStaticVoidMethod(env, cls, mid,
(*env)->NewStringUTF(env, InjectionInfo.JuiceLoaderLibPath),
(*env)->NewStringUTF(env, InjectionInfo.EntryJarPath),
(*env)->NewStringUTF(env, InjectionInfo.EntryClass),
(*env)->NewStringUTF(env, InjectionInfo.EntryMethod));
-15
View File
@@ -49,21 +49,6 @@ bool ReadInjectionInfo(toml_result_t result, InjectParameters* params) {
safe_copy(InjectionInfo.JuiceLoaderJarPath, JuiceLoaderJarPathStr, INJECT_PATH_MAX);
// ======= JuiceLoaderJarPath =======
// ======= JuiceLoaderLibPath =======
toml_datum_t JuiceLoaderLibPath = toml_seek(InjectionTree, "JuiceLoaderLibPath");
char JuiceLoaderLibPathStr[INJECT_PATH_MAX];
if (JuiceLoaderLibPath.type != TOML_STRING) {
log_error("JuiceLoaderLibPath is not a string.");
return false;
}
if (JuiceLoaderLibPath.u.s == NULL || strlen(JuiceLoaderLibPath.u.s) == 0) {
sprintf(JuiceLoaderLibPathStr, "%s\\libjuiceloader.dll", params->ConfigDir);
} else {
sprintf(JuiceLoaderLibPathStr, "%s", JuiceLoaderLibPath.u.s);
}
safe_copy(InjectionInfo.JuiceLoaderLibPath, JuiceLoaderLibPathStr, INJECT_PATH_MAX);
// ======= JuiceLoaderLibPath =======
// ======= Entry =======
toml_datum_t EntryJarPath = toml_seek(InjectionTree, "EntryJarPath");
char EntryJarPathStr[INJECT_PATH_MAX];