Directly call function in another .so file while in C++ code

I have which defines void a() and which defines void b(). They are both put in the .apk so they are available to the Android application.

Now suppose that I’m calling a() through JNI. Is it possible to call b() from a() while completely bypassing JNI?

Can I do it this way in Android (the code is only for illustration, so it might have some errors)?

void a() {
    void *handle = dlopen("", RTLD_LAZY);
    void (*b)() = dlsym(handle, "b");

Would I need to add the fully qualified path?

Source: c++

Leave a Reply