I am trying to follow advice from https://issuetracker.google.com/issues/128554619#comment4 (not on Android 10 yet, but want my code to work there as well):
While exec() no longer works on files within the application home directory, it continues to be supported for files within the read-only /data/app directory. In particular, it should be possible to package the binaries into your application's native libs directory and enable android:extractNativeLibs=true, and then call exec() on the /data/app artifacts. A similar approach is done with the wrap.sh functionality, documented at https://developer.android.com/ndk/guides/wrap-script#packaging_wrapsh .
as suggested in this answer: https://stackoverflow.com/a/58748468/9204
However, in my case the directory to which the native libs are extracted is not
File(filesDir.parentFile!!, "lib")
as in that answer but
File(File(packageCodePath).parentFile!!, "lib/arm64")
This is obviously hacky (especially hardcoding arm64
) and may depend on specific Android version and/or device.
Is there a documented way to find the native libs directory?