集成第三方so和jar包
include $(CLEAR_VARS)
#jar包编译
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES :=securitysdk:libs/hello.jar
#64和32系统选择不同的库
ifeq (arm64, $(strip $(TARGET_ARCH)))
LOCAL_PREBUILT_LIBS := libssl:libs/arm64-v8a/libssl.so
LOCAL_PREBUILT_LIBS += libcrypto:libs/arm64-v8a/libcrypto.so
LOCAL_PREBUILT_LIBS += libvivosgmain:libs/arm64-v8a/libaa.so
else
LOCAL_PREBUILT_LIBS := libssl:libs/armeabi-v7a/libssl.so
LOCAL_PREBUILT_LIBS += libcrypto:libs/armeabi-v7a/libcrypto.so
LOCAL_PREBUILT_LIBS += libvivosgmain:libs/armeabi-v7a/libtest.so
endif
include $(BUILD_MULTI_PREBUILT)
把so库包含进入apk
LOCAL_JNI_SHARED_LIBRARIES := libssl libcrypto libvivosgmain
LOCAL_MODULE_INCLUDE_LIBRARY := true
后面Android某个源码版本不支持这一处理了,加入下面
LOCAL_MODULE_TAGS := tests
编译后代apk在data目录,so是集成进入apk的
1)假设so库是已经存在的,不需要重新编译的话。只需要用LOCAL_PREBUILT_JNI_LIBS指定(注意包含so的路径)
2)假设so需要编译,则需要先用LOCAL_JNI_SHARED_LIBRARIES指定,然后再用LOCAL_MODULE_INCLUDE_LIBRARY := true打包so到apk
最好还要编写jni下的android.mk
http://wangjianfei1016.blog.163.com/blog/static/20244096201212825258706/
http://bbs.csdn.net/topics/391988797
http://blog.chinaunix.net/uid-26524139-id-3161753.html
http://blog.csdn.net/zhejiang9/article/details/8664252
http://blog.csdn.net/thl789/article/details/7918093
3)LOCAL_MULTILIB := both 32和64都编译。