现象:AVACRASH is systematically generated on com.intel.silentlake.installer after reboot
日志
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.intel.silentlake.installer-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64, //lib64]]] couldn't find "libsl_installer.so"
分析
I/Zygote ( 636): Process: zygote socket opened, supported ABIS: x86_64
I/Zygote ( 636): Process: zygote socket opened, supported ABIS: x86,armeabi-v7a,armeabi
在把32bit的app移植到64bit时打开app出现上述问题,因为这个app依赖的库预编译库是32bit所以需要修改make文件强制依赖32bit
以前的目录结构
imin/vendor/intel/apps/PRIVATE/silentlake/sl_installer$ ls
AndroidManifest.xml Android.mk libsl_installer.so res sl_pm_interface src
在Zygote 64起来后,pms发现当前路径下没有lib或者lib64,于是默认去到system/lib64去找app 以来的prebuild lib libsl_installer.so 而libsl_installer.so是一个32bit的,在没有提供对应的64位的情况下,要想解决pms加载失败的问题需要做如下修改
1.before Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := sl_installer
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_REQUIRED_MODULES := libsl_installer.so
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_MODULE := libsl_installer.so
LOCAL_SRC_FILES := libsl_installer.so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE:= libsl_pm_interface
LOCAL_SRC_FILES:= sl_pm_interface/sl_pm_interface.cpp \
sl_pm_interface/sl_pm_interface_impl.cpp
LOCAL_SHARED_LIBRARIES := libutils libbinder liblog
LOCAL_C_INCLUDES := $(LOCAL_PATH)/sl_pm_interface \
frameworks/native/include/ \
system/core/include/
include $(BUILD_SHARED_LIBRARY)
after Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := sl_installer
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PREBUILT_JNI_LIBS := \
lib/x86/libsl_installer.so
LOCAL_MULTILIB := 32
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_MODULE := libsl_installer.so
LOCAL_SRC_FILES := libsl_installer.so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE:= libsl_pm_interface
LOCAL_SRC_FILES:= sl_pm_interface/sl_pm_interface.cpp \
sl_pm_interface/sl_pm_interface_impl.cpp
LOCAL_SHARED_LIBRARIES := libutils libbinder liblog
LOCAL_C_INCLUDES := $(LOCAL_PATH)/sl_pm_interface \
frameworks/native/include/ \
system/core/include/
LOCAL_MULTILIB := 32
include $(BUILD_SHARED_LIBRARY)
好吧,既然修改好了,那么就编译此app吧 我这里使用mm -B -j20
正常情况下编译完成后在${OUT}/system/app/下会有对应app目录,pms这个时候就可以知道该去哪里load本地库了
运行起来又报错误,我去
E/art ( 1703): dlopen("/system/lib/libsl_installer.so", RTLD_LAZY) failed: dlopen failed: library "libsgx_urts.so" not found
D/AndroidRuntime( 1703): Shutting down VM
E/AndroidRuntime( 1703): FATAL EXCEPTION: main
E/AndroidRuntime( 1703): Process: com.intel.silentlake.installer, PID: 1703
E/AndroidRuntime( 1703): java.lang.UnsatisfiedLinkError: dlopen failed: library "libsgx_urts.so" not found
原来是预编译ibsl_installer.so依赖于其他的库,那么就改吧.在没有提供64位库的前提下都是一样强制使用32位的
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_PREBUILT_LIBS := libproxyta.so \
- libsgx_urts.so \
- libusl.so \
- libpsta.so \
- libtee_client_api.so
-include $(BUILD_MULTI_PREBUILT)
+LOCAL_MODULE := libproxyta
+LOCAL_SRC_FILES := libproxyta.so
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_SUFFIX := .so
+LOCAL_MULTILIB := 32
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libsgx_urts
+LOCAL_SRC_FILES := libsgx_urts.so
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_SUFFIX := .so
+LOCAL_MULTILIB := 32
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libusl
+LOCAL_SRC_FILES := libusl.so
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_SUFFIX := .so
+LOCAL_MULTILIB := 32
+include $(BUILD_PREBUILT)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libpsta
+LOCAL_SRC_FILES := libpsta.so
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_SUFFIX := .so
+LOCAL_MULTILIB := 32
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libtee_client_api
+LOCAL_SRC_FILES := libtee_client_api.so
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_SUFFIX := .so
+LOCAL_MULTILIB := 32
+include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := sl_si_service
@@ -35,6 +72,7 @@ LOCAL_REQUIRED_MODULES += \
libproxyta \
libsgx_urts \
libpsta \
+ libusl \
libtee_client_api \
libsl_pm_interface
include $(BUILD_PHONY_PACKAGE)
-LOCAL_PREBUILT_LIBS := libproxyta.so \
- libsgx_urts.so \
- libusl.so \
- libpsta.so \
- libtee_client_api.so
-include $(BUILD_MULTI_PREBUILT)
BUILD_MULTI_PREBUILT和BUILD_PREBUILT 在64bit的时候后者比前者表现好,因为前者很多64位库编译的时候处理的不是很好
阅读(3980) | 评论(0) | 转发(0) |