MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / JNI_OnLoad

Function JNI_OnLoad

libapp2sys/src/main/cpp/c2java.h:17–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15jclass g_classUdpEngine;
16
17jint JNI_OnLoad(JavaVM *vm, void *reserved) {
18 UNUSED(reserved);
19
20 JNIEnv *env = NULL;
21 jint result = JNI_ERR;
22 g_jvm = vm;
23
24 if (vm->GetEnv((void**) &env, JNI_VERSION_1_6) != JNI_OK) {
25 return result;
26 }
27
28 jclass clazz = env->FindClass("com/tencent/mm/hardcoder/HardCoderJNI");
29 g_classUdpEngine = (jclass) env->NewGlobalRef(clazz);
30 env->DeleteLocalRef(clazz);
31
32 return JNI_VERSION_1_6;
33}
34
35void c2Java_OnData(JNIEnv *envCThread, int callbackType, uint64_t requestid, uint64_t timestamp, int errCode, int funcid, int dataType, uint8_t *data, int len) {
36 if (!envCThread) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected