Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "jni.h"
- #include <iostream>
- jint JNICALL MockGetVersion(JNIEnv *)
- {
- return 23;
- }
- JNINativeInterface_ jnini = {
- 0, 0, 0, 0, //4 reserved pointers
- MockGetVersion
- };
- // class Foo { public static native void bar(); }
- void Java_Foo_bar(JNIEnv* jni, jclass)
- {
- std::cout << jni->GetVersion() << std::endl;
- }
- int main()
- {
- JNIEnv_ myjni = {&jnini};
- Java_Foo_bar(&myjni, 0);
- return 0;
- }
Add Comment
Please, Sign In to add comment