编写编译用的Android.mk,并和apk一并放入你新建的文件夹下:
vendor/mediatek/proprietary/packages/apps/test_demo
Android.mk:
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := TestDemo
LOCAL_MODULE_CLASS := APPS
LOCAL_SYSTEM_EXT_MODULE := true
LOCAL_PRIVILEGED_MODULE :=false
LOCAL_SRC_FILES := $(LOCAL_MODULE)$(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_DEX_PREOPT := true
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
#when app has <uses-library> tags,open this
LOCAL_ENFORCE_USES_LIBRARIES :=
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_JNI_SHARED_LIBRARIES_ABI := None
MY_LOCAL_PREBUILT_JNI_LIBS := \
LOCAL_MULTILIB := 32
MY_APP_LIB_PATH := $(TARGET_OUT_SYSTEM_EXT)/app/$(LOCAL_MODULE)/lib/$(LOCAL_JNI_SHARED_LIBRARIES_ABI)
ifneq ($(LOCAL_JNI_SHARED_LIBRARIES_ABI), None)
LOCAL_POST_INSTALL_CMD := mkdir -p $(MY_APP_LIB_PATH) $(foreach lib, $(MY_LOCAL_PREBUILT_JNI_LIBS), ; cp -f $(LOCAL_PATH)/$(lib) $(MY_APP_LIB_PATH)/$(notdir $(lib)))
endif
include $(BUILD_PREBUILT)
将apk加入固件
在device/mediatek/system/mssi_aiv_64_armv82/device.mk添加
PRODUCT_PACKAGES +=TestDemo
最后,整体编译,看system_ext/app是否有你的apk名生成