0

If android installed at below path:

/system/product/priv-app/mynative/app-debug.apk

And this apk contains a jni library:

app-debug/lib/arm64-v8a/libnative-lib.so

Where is the path android to load the library libnative-lib.so? I search device and never find that so file.

lucky1928
  • 8,708
  • 10
  • 43
  • 92
  • Given that `libnative-lib.so` is packaged inside the apk, you should expand on who and when is looking for that file. Possibly related: [How to correctly find native lib path in Android?](https://stackoverflow.com/q/63134761/295004) – Morrison Chang Aug 07 '21 at 05:13

1 Answers1

0

The answer might be: "it never was on the filesystem to begin with".

Modern Android build infrastructure sets extractNativeLibraries=false by default. This keeps the .so in the APK instead of having a copy linger on your device.

EDIT: I did some source digging, the Android runtime linker can open libraries directly from zip files if the filename contains !/. I think this would just show up as another mapping of the APK in /proc/pid/maps, but I did not investigate beyond that (eg how relocation is done in this case or what namespaces have to do with it).

Botje
  • 26,269
  • 3
  • 31
  • 41