1
- 在系统目录packages/apps 下创建 预置的 APK 名字的文件夹
android7/packages/apps/VehicleStation$
将同名的 VehicleStation.apk拷贝到新建的目录下(apk需要有系统签名)
-
将android.mk拷贝到新建目录下(/packages/apps/VehicleStation)
LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := VehicleStation LOCAL_MODULE_TAGS := optional LOCAL_DEX_PREOPT := false LOCAL_MODULE_CLASS := APPS LOCAL_SRC_FILES := VehicleStation.apk LOCAL_CERTIFICATE := platform LOCAL_PRIVILEGED_MODULE := false APK_LibList := $(subst $(LOCAL_PATH)/uncompressedlibs,,\ $(foreach FILE,$(shell unzip -l $(LOCAL_PATH)/$(LOCAL_SRC_FILES) 'lib/*.so'|grep 'arm'),$(eval APK_LibList += $(FILE)))) #$(info $(APK_LibList)) ARM64_LIB := $(findstring arm64-v8a,$(APK_LibList)) ARMV7A_LIB := $(findstring armeabi-v7a,$(APK_LibList)) ARM_LIB := $(findstring armeabi,$(APK_LibList)) ARCH_LIB := $(if $(TARGET_ARCH),$(if $(ARM64_LIB),$(ARM64_LIB),$(if $(ARMV7A_LIB),$(ARMV7A_LIB),$(ARM_LIB))),$(if $(ARMV7A_LIB),$(ARMV7A_LIB),$(ARM_LIB))) TARGET_BIT := $(if $(findstring arm64,$(ARCH_LIB)),64,32) $(info $(ARCH_LIB) $(TARGET_BIT)) PRIVATE_EMBEDDED_JNI_LIBS := 'lib/$(ARCH_LIB)/*.so' JNI_LIBS := $(foreach FILE,$(shell if unzip -l $(LOCAL_PATH)/$(LOCAL_SRC_FILES) $(PRIVATE_EMBEDDED_JNI_LIBS) > /dev/null ; then \ rm -rf $(LOCAL_PATH)/uncompressedlibs && \ mkdir $(LOCAL_PATH)/uncompressedlibs; \ unzip $(LOCAL_PATH)/$(LOCAL_SRC_FILES) $(PRIVATE_EMBEDDED_JNI_LIBS) -d $(LOCAL_PATH)/uncompressedlibs > /dev/null && \ find $(LOCAL_PATH)/uncompressedlibs -name *.so; \ fi),$(eval JNI_LIBS += $(FILE))) LOCAL_PREBUILT_JNI_LIBS := $(subst $(LOCAL_PATH),,$(JNI_LIBS)) LOCAL_MULTILIB := $(TARGET_BIT) include $(BUILD_PREBUILT)
2. 修改 build/target/product/core.mk
在PRODUCT_PACKAGES里添加
VehicleStation \