I'm trying to load a .so library from a specified "allowed" path that is:
/data/data/my.package.name/mylibrary.so
I know that I can't just put my lib to /sdcard/ for security purpose (and this is fine).
I'm trying to load the library with:
System.load("/data/data/my.package.name/mylibrary.so");
But for some reasons I'm failing to understand, my app crash with:
java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/data/my.package.name/mylibrary.so" not found
Running the app in Monitor I can also read:
avc: denied { read } for name="mylibrary.so" dev=tmpfs ....... tclass=file permissive=0
This looks like a SELinux issue. I've also checked the library permission in adb shell (from a root shell) and they looks okay.
I know that since Android Nougat it isn't possible to load system library, but this isn't a system lib.
Is there anything I can try?
Thank you very much