mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
[Refactor] Remove useless code
This commit is contained in:
1 parent
b46802faaa
commit
8e42780eed
3 files changed
+1
-19
No files matched your search
@@ -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];
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user