mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
[Update] Get bytes with ClassFileLoadHook
This commit is contained in:
1 parent
c642280142
commit
f3c2b7d0e6
3 files changed
+104
-3
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#include "javautils.h"
|
||||
#include <jni.h>
|
||||
#include <jvmti.h>
|
||||
#include <string.h>
|
||||
|
||||
char* get_class_name(JNIEnv* env, jclass clazz) {
|
||||
jclass clsClass = (*env)->FindClass(env, "java/lang/Class");
|
||||
jmethodID mid_getName = (*env)->GetMethodID(env, clsClass, "getName", "()Ljava/lang/String;");
|
||||
jstring nameStr = (jstring)(*env)->CallObjectMethod(env, clazz, mid_getName);
|
||||
|
||||
const char* temp = (*env)->GetStringUTFChars(env, nameStr, NULL);
|
||||
char* result = strdup(temp);
|
||||
(*env)->ReleaseStringUTFChars(env, nameStr, temp);
|
||||
(*env)->DeleteLocalRef(env, nameStr);
|
||||
return result;
|
||||
}
|
||||
Reference in new issue
Block a user