Commit f34d6966 by Fear1ess

4/19

parent 39118ec8
......@@ -34,6 +34,7 @@ JNIEXPORT void jni_init(JNIEnv* env, jobject thiz, jobject context) {
}
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
logd("wdun_core", "%s", "enter jni_onload...");
JNIEnv* env = NULL;
if((*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6) == JNI_OK) {
jclass cls = (*env)->FindClass(env, WDMAIN_CLASS_NAME);
......@@ -43,12 +44,20 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
(*env)->DeleteLocalRef(env, cls);
}
//find lic needed symbol
logd("wdun_core", "%s", "find libc symbol...");
//find libc needed symbol
struct so_info* si = fake_dlopen("libc.so", 0);
if(si != NULL) {
g_funcs.wd_popen = fake_dlsym(si, "popen");
g_funcs.wd_pclose = fake_dlsym(si, "pclose");
g_funcs.wd_system_property_get = fake_dlsym(si, "__system_property_get");
fake_dlclose(si);
}
if(!g_funcs.wd_popen) g_funcs.wd_popen = popen;
if(!g_funcs.wd_pclose) g_funcs.wd_pclose = pclose;
if(!g_funcs.wd_system_property_get) g_funcs.wd_system_property_get = __system_property_get;
logd("wdun_core", "%s", "leave jni_onload...");
return JNI_VERSION_1_6;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment