My 32-bit ARM Android apps come with .so files that I dlopen() in my native code. This works just fine, and I can dlopen them at the /data/data/com.domain.app/lib/libX.so
location.
If I add 64-bit binaries to my package (arm64-v8a) and install it on a 64 bit Android device, then there will be no /data/data/com.domain.app/lib
directory present.
After some investigation, I found that the .so files on a 64-bit Android device end up in a different directory:
/data/app/com.domain.app-1/lib/arm64
And to make matters worse, the '-1' suffix varies, and could be '-2' or something else.
This is a way to check what got installed in the application's home directory:
$ adb shell run-as com.steenriver.biplane '/system/bin/sh -c "pwd"'
/data/data/com.steenriver.biplane
$ adb shell run-as com.steenriver.biplane '/system/bin/sh -c "ls -al"'
drwxrwx--x u0_a108 u0_a108 2017-01-17 15:04 app_.gpg.classloader
drwxrwx--x u0_a108 u0_a108 2017-01-17 15:04 cache
drwxrwx--x u0_a108 u0_a108 2017-01-17 15:04 code_cache
drwxrwx--x u0_a108 u0_a108 2017-01-17 15:04 files
A 32 bit device will have a lib/
entry listed here.
Is there an Android call I can do (Either in Java or native code) that will tell me where the .so files have ended up, so I can dlopen() them?