52-Android之内置应用

14 篇文章 3 订阅
5 篇文章 1 订阅

52-Android之内置应用


平台: Android10 MTK6739

内置不带so库的应用,如:

WhatsApp # WhatsApp是带so库,此处只是举例
build/make/target/product/base_system.mk
PRODUCT_PACKAGES += \
    WhatsApp \
    
vendor/mediatek/proprietary/packages/apps/WhatsApp目录:
vendor/mediatek/proprietary/packages/apps/WhatsApp/Android.mk
vendor/mediatek/proprietary/packages/apps/WhatsApp/WhatsApp.apk

Android.mk文件内容:
###################################
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := WhatsApp
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := APPS
LOCAL_BUILT_MODULE_STEM := package.apk
# PRESIGNED: 表示APK签名使用原来签名,即第三方签名;
# platform: 表示APK使用系统签名, APK获得系统权限 
LOCAL_CERTIFICATE := PRESIGNED 
# 表示编译后APK放在/system/vendor/operator/app目录下面, 用户可以卸载, 如果不加这句, 则会放在/system/app/下面, 用户不可以卸载
LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/operator/app
LOCAL_DEX_PREOPT := false
LOCAL_MODULE_TARGET_ARCH := arm
LOCAL_SRC_FILES_arm := $(LOCAL_MODULE).apk
include $(BUILD_PREBUILT)
######################################

内置带so库的应用,如:

Opera
build/make/target/product/base_system.mk
PRODUCT_PACKAGES += \
    Opera \
    
vendor/mediatek/proprietary/packages/apps/Opera 目录:
vendor/mediatek/proprietary/packages/apps/Opera/Android.mk
vendor/mediatek/proprietary/packages/apps/Opera/Opera.apk
vendor/mediatek/proprietary/packages/apps/Opera/libchrome_crashpad_handler.so
vendor/mediatek/proprietary/packages/apps/Opera/libcrashpad_handler_trampoline.so
vendor/mediatek/proprietary/packages/apps/Opera/libopera.so

Android.mk文件内容:
###################################
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Opera
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := APPS
LOCAL_BUILT_MODULE_STEM := package.apk
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_DEX_PREOPT := false
LOCAL_MODULE_TARGET_ARCH := arm
LOCAL_SRC_FILES_arm := $(LOCAL_MODULE).apk
# SO库的处理
LOCAL_PREBUILT_JNI_LIBS:= \
    libchrome_crashpad_handler.so \
    libcrashpad_handler_trampoline.so \
    libopera.so

include $(BUILD_PREBUILT)
###################################

平台: Android4.4 SPRD SC9820E

内置带so库的应用,如:

SipHome
device/sprd/sharkle/common/common_packages.mk
PRODUCT_PACKAGES += \
    libpj_opensl_dev \
    libpjsipjni \
    libstlport_shared \ 
    SipHome \

packages/apps/SipHome目录:
packages/apps/SipHome/Android.mk
packages/apps/SipHome/源码
packages/apps/SipHome/libs/armeabi-v7a/libpj_opensl_dev.so
packages/apps/SipHome/libs/armeabi-v7a/libpjsipjni.so
packages/apps/SipHome/libs/armeabi-v7a/libstlport_shared.so

Android.mk文件内容:
###################################
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.v4
LOCAL_AAPT_FLAGS += --extra-packages com.csipsimple
LOCAL_SRC_FILES := \
     $(call all-java-files-under, src)  
LOCAL_SRC_FILES += $(call all-Iaidl-files-under, src/com/csipsimple/api)
LOCAL_SRC_FILES += $(call all-Iaidl-files-under, src/android/app/sip)
LOCAL_JNI_SHARED_LIBRARIES :=  \
        libpj_opensl_dev \
        libpjsipjni \
        libstlport_shared 
LOCAL_PACKAGE_NAME := SipHome
LOCAL_CERTIFICATE := platform
LOCAL_PROGUARD_ENABLED := disabled
include $(wildcard vendor/sprd/platform/frameworks/support/ActionBarSherlock/apply_actionbar_sherlock.mk)
include $(wildcard vendor/sprd/platform/frameworks/support/featurebar/apply_featurebar.mk)
include $(BUILD_PACKAGE)

#====================================================
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE := libpj_opensl_dev
LOCAL_SRC_FILES := libs/armeabi-v7a/$(LOCAL_MODULE).so
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib
LOCAL_MULTILIB := 32
include $(BUILD_PREBUILT)
#====================================================

#====================================================
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE := libpjsipjni
LOCAL_SRC_FILES := libs/armeabi-v7a/$(LOCAL_MODULE).so
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib
LOCAL_MULTILIB := 32
include $(BUILD_PREBUILT)

#====================================================
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE := libstlport_shared
LOCAL_SRC_FILES := libs/armeabi-v7a/$(LOCAL_MODULE).so
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib
LOCAL_MULTILIB := 32
include $(BUILD_PREBUILT)
###################################
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值