12345678910111213141516171819202122232425262728293031323334353637 |
- //
- // Created by KaiWeiCai on 2022/1/14.
- //
- #ifdef __cplusplus
- extern "C" {
- #endif
- void InitSdkDrive(JNIEnv *env, jobject clz, jobject context) {
- // CommMap::GetInstance()->Init(env, context);
- }
- static JNINativeMethod gMethods[] = {
- {"initDrive", "(Landroid/content/Context;)V", (void *) InitSdkDrive},
- // {"setParam", "(Ljava/lang/String;Ljava/lang/String;)V", (void *) SetParam},
- // {"getParam", "(Ljava/lang/String;)Ljava/lang/String;", (void *) GetParam},
- // {"invokeJob", "(Ljava/lang/String;)Ljava/lang/String;", (void *) InvokeJob},
- // {"parseJob", "(Ljava/lang/String;)Ljava/lang/String;", (void *) ParseJob},
- // {"RsaEncrypt", "(Ljava/lang/String;)Ljava/lang/String;", (void *) RsaEncrypt}
- };
- JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
- JNIEnv *env = nullptr;
- if (vm->GetEnv((void **) &env, JNI_VERSION_1_6) != JNI_OK) {
- return JNI_ERR;
- }
- jclass clz = env->FindClass("cn/yyxx/commsdk/core/NTest");
- if (env->RegisterNatives(clz, gMethods, sizeof(gMethods) / sizeof(gMethods[0])) < 0) {
- return JNI_ERR;
- }
- return JNI_VERSION_1_6;
- }
- #ifdef __cplusplus
- }
- #endif
|