| 141 | }; |
| 142 | |
| 143 | int registerNativeMethods(JNIEnv *env, const char *className, |
| 144 | JNINativeMethod *gMethods, int numMethods) { |
| 145 | jclass clazz; |
| 146 | clazz = env->FindClass(className); |
| 147 | if (clazz == nullptr) { |
| 148 | return JNI_FALSE; |
| 149 | } |
| 150 | if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) { |
| 151 | return JNI_FALSE; |
| 152 | } |
| 153 | return JNI_TRUE; |
| 154 | } |
| 155 | |
| 156 | int registerNatives(JNIEnv *env) { |
| 157 | if (!registerNativeMethods(env, VMCORE_CLASS, gMethods, |