Is it possible to read .so file in Android?

You will have to put the .so file in the lib folder. Then access it using the demo function as shown below:

public static boolean loadNativeLibrary() {

    try {

        Log.i(TAG, "Attempting to load library: " + LIBRARY_NAME);
        System.loadLibrary(LIBRARY_NAME);

    } catch (Exception e) { 
        Log.i(TAG, "Exception loading native library: " + e.toString());
        return false;
    }

    return true;
}

You can't really "read" a .so file; it's a compiled binary that contains machine code. It's not really possible to edit it.

You can list the symbols in it though, for example:

android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-nm ./path/to/libfoo.so

yes you can. You will need hex editor to read that. Because, as far as I understand, .so is just like .dll in windows.

Tags:

Android