Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNI_OnLoad 不执行 #10

Open
liukuo362573 opened this issue Mar 20, 2023 · 0 comments
Open

JNI_OnLoad 不执行 #10

liukuo362573 opened this issue Mar 20, 2023 · 0 comments

Comments

@liukuo362573
Copy link

liukuo362573 commented Mar 20, 2023

Hello,是否可以在 libHook.so 中写 JNI_OnLoad,我这样写,可以编译成功,但是没有执行,使用的平台是 arm64-v8a。

jint JNI_OnLoad(JavaVM* vm, void* reserved) {
	LOGD("JNI_OnLoad\n");

	JNIEnv* env = NULL;

	if (vm->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK) {
		LOGD("JavaVm fail to get JNIEnv\n");
		return -1;
	}

	LOGD("JNI_OnLoad1\n");

	return JNI_VERSION_1_6;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant