mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
[Feat] define
This commit is contained in:
1 parent
339b68c8af
commit
4ef94b5ac2
1 file changed
+11
@@ -0,0 +1,11 @@
|
||||
#include <jni_impl.h>
|
||||
|
||||
JNIEXPORT jclass JNICALL Java_cn_xiaozhou233_juiceloader_JuiceLoader_defineClass
|
||||
(JNIEnv *env, jclass, jobject cl, jbyteArray bytes) {
|
||||
PLOGD << "Invoked!";
|
||||
jclass clClass = env->FindClass("java/lang/ClassLoader");
|
||||
jmethodID defineClass = env->GetMethodID(clClass, "defineClass", "([BII)Ljava/lang/Class;");
|
||||
jobject classDefined = env->CallObjectMethod(cl, defineClass, bytes, 0,
|
||||
env->GetArrayLength(bytes));
|
||||
return (jclass)classDefined;
|
||||
}
|
||||
Reference in new issue
Block a user