yyxxgame.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // Created by KaiWeiCai on 2022/1/14.
  3. //
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. void InitSdkDrive(JNIEnv *env, jobject clz, jobject context) {
  8. // CommMap::GetInstance()->Init(env, context);
  9. }
  10. static JNINativeMethod gMethods[] = {
  11. {"initDrive", "(Landroid/content/Context;)V", (void *) InitSdkDrive},
  12. // {"setParam", "(Ljava/lang/String;Ljava/lang/String;)V", (void *) SetParam},
  13. // {"getParam", "(Ljava/lang/String;)Ljava/lang/String;", (void *) GetParam},
  14. // {"invokeJob", "(Ljava/lang/String;)Ljava/lang/String;", (void *) InvokeJob},
  15. // {"parseJob", "(Ljava/lang/String;)Ljava/lang/String;", (void *) ParseJob},
  16. // {"RsaEncrypt", "(Ljava/lang/String;)Ljava/lang/String;", (void *) RsaEncrypt}
  17. };
  18. JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
  19. JNIEnv *env = nullptr;
  20. if (vm->GetEnv((void **) &env, JNI_VERSION_1_6) != JNI_OK) {
  21. return JNI_ERR;
  22. }
  23. jclass clz = env->FindClass("cn/yyxx/commsdk/core/NTest");
  24. if (env->RegisterNatives(clz, gMethods, sizeof(gMethods) / sizeof(gMethods[0])) < 0) {
  25. return JNI_ERR;
  26. }
  27. return JNI_VERSION_1_6;
  28. }
  29. #ifdef __cplusplus
  30. }
  31. #endif