I'm having a pretty hard time getting this to work but I have a SQLite extension, which is loaded via dlopen, that is packaged into an APK. It comes from a package that I am developing and I have noticed a few things. This is via .NET 8, so gradle is entirely unused and the .NET tooling attempts to mimic what is being done. So things like `useLegacyPackaging` are not available, but there is an older variant of this called android:extractNativeLibs which .NET honors by doing the following:
- If extractNativeLibs is true (which appears to be the default?) then jniLibs are stored in the APK compressed, and they end up in the native libs directory. My SQLite extension filename does not begin with lib, though, so it doesn't get extracted and I cannot extract it there after the fact because the directory is readonly! This is quite irritating and the subject of this thread
- If extractNativeLibs is false, then jniLibs are stored in the APK uncompressed and I can use the magic dlopen syntax to get at them from within the APK.
However, the latter doesn't work for API 22, which is currently our minSdkVersion, so the only choice is extracting native libs. But where can I extract them to? I tried cache, files, code_cache, and /data/app-lib/<package> but for the first few dlopen returns null, but with an error code of 0. The final path (app-lib) returns null with an error code of 20 (not a directory). Is my only choice to rename the library filename itself so that it can get magically auto extracted or is there somewhere I can put this extension?