MTK平台 Android9 预置apk找不到so
2021-05-09 本文已影响0人
vivian310
背景
我们有一款自定义的launcher app,用Androidstudio直接run是可以正常运行的,在预编译到system/priv-app目录下时,始终找不到so文件。
1、最简单的方法,将so预置到system/lib64下,仍然提示找不到so
2、在app的目录下手动创建lib连接指向system/lib64中的so,这样so可以找到,但是会有其他一些错误,但是明明在AS中直接run是可以正常运行的
3、对比系统原有预置app的Android.mk文件,发现预置app的mk文件的签名跟我的不一样,
我的app用的签名是
LOCAL_CERTIFICATE := platform
系统系统预置app的签名是
LOCAL_CERTIFICATE := PRESIGNED
但是感觉找不到so这种问题不应该是签名导致的,实在没办法了试了一下,自己手动系统签名后,再预置到系统里,问题竟然解决了……
还请知道缘由的大神不吝赐教
下面附上预置apk的完整mk文件
LOCAL_PATH := $(call my-dir)
#预置so库
include $(CLEAR_VARS)
LOCAL_MODULE := libImSDK
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES_32 := lib/armeabi-v7a/libImSDK.so
LOCAL_SRC_FILES_64 := lib/arm64-v8a/libImSDK.so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_SUFFIX = .so
LOCAL_MULTILIB = 64
include $(BUILD_PREBUILT)
#预置so库
include $(CLEAR_VARS)
LOCAL_MODULE := libreadface
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES_32 := lib/armeabi-v7a/libreadface.so
LOCAL_SRC_FILES_64 := lib/arm64-v8a/libreadface.so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_SUFFIX = .so
LOCAL_MULTILIB = 64
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := Launcher3Go_Goertek
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
#编译当前launcher时,不编译其他launcher
LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3 \
Launcher3QuickStep Launcher3Go Launcher3QuickStepGo \
MtkLauncher3 MtkLauncher3QuickStep MtkLauncher3QuickStepGo
LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.*
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_PRIVILEGED_MODULE := true
LOCAL_MULTILIB := both
include $(BUILD_PREBUILT)