如何修改"vendor/etc/public.libraries.txt";构建纯AOSP时 [英] How to modify "vendor/etc/public.libraries.txt" when building pure AOSP
问题描述
ENV :用于 marlin目标(PIXEL XL)
我想将自己的库 libOwnlibrary.so
添加到 vendor/etc/public.libraries.txt
白名单文件中,以便可以从自己的 system/priv-app/MyOwnApp.apk
APK
I want to add my own library libOwnlibrary.so
to the vendor/etc/public.libraries.txt
whitelist file so that I can load it from my own system/priv-app/MyOwnApp.apk
APK
目前,我收到以下错误消息:
Currently I get the following error:
java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib/libOwnlibrary.so" needed or dlopened by "/system/lib/libnativeloader.so" is not accessible for the namespace "classloader-namespace"
由于Android 7.0(API 24)引入的限制,这是有道理的: https://developer.android.com/about/versions/牛轧糖/android-7.0-changes#ndk
Which makes sense due to the limitations introduced with Android 7.0 (API 24): https://developer.android.com/about/versions/nougat/android-7.0-changes#ndk
从Android 7.0开始,系统会动态阻止应用链接到非NDK库,这可能会导致您的应用崩溃.
Starting in Android 7.0, the system prevents apps from dynamically linking against non-NDK libraries, which may cause your app to crash.
我当前的设置:
AOSP-root-folder/
- vendor/
- myvendor/
device-partial.mk (this basically instructs `make` to copy libOwnlibrary.so to vendor/lib/libOwnlibrary.so
```PRODUCT_COPY_FILES := .. .so```
proprietary/
Android.mk (pushes presigned prebuilt MyOwnApp.apk to /system/priv-app)
```... include$(BUILD_PREBUILT)```
我应该更改/添加什么,以便能够修改 vendor/etc/public.libaries.txt
白名单文件以向其中添加 libOwnlibrary.so
.
What should I change / add in order to be able to modify the vendor/etc/public.libaries.txt
whitelist file to add libOwnlibrary.so
to it.
!!!一种可行的方法是将 libOwnlibrary.so
添加到
AOSP-root-folder/system/core/rootdir/etc/public.libraries.android.txt
会在设备上转换为 system/etc/public.libraries.txt
,
但意味着将我的库从 vendor/lib
移到 system/lib
,并且我认为这是不允许的 !!!
BUT that would mean moving my lib to system/lib
from vendor/lib
and I don't think that's allowed. !!!
推荐答案
在device-partial.mk中添加一个步骤,以将您的lib名称附加到现有文件 vendor/etc/public.libaries.txt
Add a step in device-partial.mk to append your lib name to the existing file vendor/etc/public.libaries.txt
此步骤后
device-partial.mk (this basically instructs `make` to copy libOwnlibrary.so to vendor/lib/libOwnlibrary.so
```PRODUCT_COPY_FILES := .. .so```
这篇关于如何修改"vendor/etc/public.libraries.txt";构建纯AOSP时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!