android mtk平台内置apk,可卸载恢复出厂设置还在
1.在源码的根目录下
cdvendor
mkdircustomizeapk
在customizeapk下再次创建custom文件夹
将要编译的apk放在custom目录中注意文件名不要带空格、非法字符如中文符号、#、()等
2.编写android.mk,内容如下:
LOCAL_PATH:=$(my-dir)
copy_from:=\
HAS_CUSTOM:=$(shelltest-d$(LOCAL_PATH)/custom&&echoyes)
ifeq($(HAS_CUSTOM),yes)
$(shellmkdir-p$(TARGET_OUT)endor/operator/app)
copy_from+=$(notdir$(wildcard$(LOCAL_PATH)/custom/*.apk))
endif
defineexpand_prebuilt_apks
$(foreachfile1,$(1),\
$(evalinclude$(CLEAR_VARS))\
$(evalLOCAL_MODULE:=$(file1))\
$(evalLOCAL_SRC_FILES:=$(file1))\
$(evalLOCAL_MODULE_CLASS:=APPS)\
$(evalLOCAL_MODULE_SUFFIX:=$(COMMON_ANDROID_PACKAGE_SUFFIX))\
$(evalLOCAL_PRIVILEGED_MODULE:=true)\
$(evalLOCAL_MODULE_TAGS:=optional)\
$(evalLOCAL_CERTIFICATE:=PRESIGNED)\
$(evalLOCAL_MODULE_PATH:=$(TARGET_OUT)endor/operator/app)\
$(evalinclude$(BUILD_PREBUILT))\
)
endef
$(callexpand_prebuilt_apks,$(copy_from))
3.在build/target/product/common.mk中添加如下字段
definesearch_and_add_to_product_package2
$(foreachfile1,$(1),\
$(evalPRODUCT_PACKAGES+=$(notdir$(wildcard$(file1)/*.$(strip$(2))))))
endef
$(callsearch_and_add_to_product_package2,vendor/customizeapk/custom,apk)
相关推荐
adb shell cd system/app rm *.apk21. 获取管理员权限: adb root22. 启动Activity: adb shell am start -n 包名/包名+类名。