Android package manager only unpacks libxxx.so named libraries

烈酒焚心 提交于 2019-12-25 07:56:40

问题


I've made a jni library that dynamically loads plugins using dlopen, plugin library files have a different naming e.g. zzz_abc.so.

eclipse and ant are correctly bundling these files in the apk, but the android packagemanager only unpacks files named libxxx.so, other filename patterns are ignored, perhaps in debug, gdbserver is added and unpacked on my 4.1 phone (but not on 4.4 genymotion emulator).

There is something "magic" to control this behavior?


回答1:


I've verified and unfortunately the native library installer only copies filenames like libxxx.so and gdbserver, if someone is interested the code is in frameworks/base/core/jni/com_android_internal_content_NativeLibraryHelper.cpp.




回答2:


Android Package Manager copies libraries according to device processor architecture (armv7a, armv6, x86, mips). So if you use x86 based emulator, you need to provide x86 build of your library.



来源:https://stackoverflow.com/questions/23568461/android-package-manager-only-unpacks-libxxx-so-named-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!