| 106 | } |
| 107 | |
| 108 | void registerArtNative(JNIEnv *env) { |
| 109 | jclass clazz = env->FindClass("top/niunaijun/jnihook/jni/ArtMethod"); |
| 110 | JNINativeMethod gMethods[] = { |
| 111 | {"nativeOffset", "()V", (void *) native_offset}, |
| 112 | {"nativeOffset2", "()V", (void *) native_offset2}, |
| 113 | }; |
| 114 | if (env->RegisterNatives(clazz, gMethods, sizeof(gMethods) / sizeof(gMethods[0])) < 0) { |
| 115 | ALOGE("jni register error."); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void ArtM::InitArtMethod(JNIEnv *env, int api_level) { |
| 120 | registerArtNative(env); |