| 200 | }; |
| 201 | |
| 202 | int registerNativeMethods(JNIEnv *env, const char *className, |
| 203 | JNINativeMethod *gMethods, int numMethods) { |
| 204 | jclass clazz; |
| 205 | clazz = env->FindClass(className); |
| 206 | if (clazz == nullptr) { |
| 207 | return JNI_FALSE; |
| 208 | } |
| 209 | if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) { |
| 210 | return JNI_FALSE; |
| 211 | } |
| 212 | return JNI_TRUE; |
| 213 | } |
| 214 | |
| 215 | int registerNatives(JNIEnv *env) { |
| 216 | if (!registerNativeMethods(env, VMCORE_CLASS, gMethods, |