Android预装apk

 预装APK到system/app目录

        注:APK名字不能含有中文、空格等特殊字符。

  1. 在 驱动路径/android/vendor/aw/public/prebuild/apk 创建一个目录存放对应的APK
  2. 将所需预装的APK放入该目录中
  3. 在该目录中创建 Android.mk文件,并编译
# 文件名
LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)
LOCAL_MODULE := APK_MODULE_NAME(模块的唯一名字)
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_BULIT_MODULE_STEM := package.apk
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := PRESIGNED(签名方式)
#LOCAL_OVERRIDES_PACKAGES := OVERRIDES_MODULE(要替代的模块)
LOCAL_SRC_FILES := name.apk(apk的文件名,一般与MODULE同名)
include $(BUILD_PREBUILT)

例:

 

        在 驱动\android\device\{vendor-name}(softwinner)\{platform-name}(ceres)\{platform-name}ceres-p25\{product-name}.mk

PRODUCT_PACKAGES += APK_MODULE_NAME(apk模块名字,预装多个apk用空格隔开)

预装谷歌的apk

###############################################################################
# Family(apk名字)
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
#LOCAL_APK_NAME := Family(apk名字)
#LOCAL_POST_PROCESS_COMMAND := $(shell mkdir -p $(TARGET_OUT)/app/$(LOCAL_APK_NAME) && cp $(LOCAL_PATH)/$(LOCAL_APK_NAME).apk $(TARGET_OUT)/app/$(LOCAL_APK_NAME)/)
include $(CLEAR_VARS)
LOCAL_MODULE := Family(apk名字)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_PATH := $(TARGET_OUT)/app/
LOCAL_REPLACE_PREBUILT_APK_INSTALLED := $(LOCAL_PATH)/Family.apk(apk名字)
LOCAL_DEX_PREOPT := false
LOCAL_MULTILIB := 32
include $(BUILD_PREBUILT)

本文链接:https://my.lmcjl.com/post/13139.html

展开阅读全文

4 评论

留下您的评论.