importing custom SO file to AOSP

后端 未结 2 1311
旧时难觅i
旧时难觅i 2021-02-09 19:16

I\'ve built an AOSP system service following this tutorial: http://www.androidenea.com/2009/12/adding-system-server-to-android.html

Now I want to use a pre-compiled .so

2条回答
  •  孤城傲影
    2021-02-09 19:56

    So the answer was quite simple. I really need to copy my lib to the system image, to the system/lib folder, because the make command doesn't copy it from out/target/product/generic/system/lib to system.img

    the trick is to add this line

      PRODUCT_COPY_FILES += $(LOCAL_PATH)/my_lib.so:system/lib/my_lib.so
    

    to full.mk file. it's location is: android-source/build/target/product also put the my_lib.so near it (as seen by the path)

    if you are planning to run the image on a real device, add this line after the device name definition. f.ex. if you are running on Nexus 4, put it at android-source/device/lge/mako/full_mako.mk

提交回复
热议问题