From 31df068b38729c5bc04a859b9216f539bc22c29e Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 13 Nov 2012 10:55:28 -0800 Subject: [PATCH] Additional certificates support for an apk. Change-Id: I5b35d5728ba9d65f7ece956127270a9ca2ea0efe --- core/clear_vars.mk | 1 + core/definitions.mk | 3 ++- core/package.mk | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index e7edbf394a..853f9a00bf 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -128,6 +128,7 @@ LOCAL_LINT_FLAGS:= LOCAL_SOURCE_FILES_ALL_GENERATED:= # '',true # Don't delete the META_INF dir when merging static Java libraries. LOCAL_DONT_DELETE_JAR_META_INF:= +LOCAL_ADDITIONAL_CERTIFICATES:= # Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to # iterate over thousands of entries every time. diff --git a/core/definitions.mk b/core/definitions.mk index 97a909b667..8926b2ba33 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1659,7 +1659,8 @@ endef define sign-package $(hide) mv $@ $@.unsigned $(hide) java -jar $(SIGNAPK_JAR) \ - $(PRIVATE_CERTIFICATE) $(PRIVATE_PRIVATE_KEY) $@.unsigned $@.signed + $(PRIVATE_CERTIFICATE) $(PRIVATE_PRIVATE_KEY) \ + $(PRIVATE_ADDITIONAL_CERTIFICATES) $@.unsigned $@.signed $(hide) mv $@.signed $@ endef diff --git a/core/package.mk b/core/package.mk index 358caeeb60..3af1afb0d6 100644 --- a/core/package.mk +++ b/core/package.mk @@ -376,6 +376,9 @@ $(LOCAL_BUILT_MODULE): PRIVATE_CERTIFICATE := $(certificate) PACKAGES.$(LOCAL_PACKAGE_NAME).PRIVATE_KEY := $(private_key) PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate) +$(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(foreach c,\ + $(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x509.pem $(c).pk8) + # Define the rule to build the actual package. $(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN) ifdef LOCAL_DEX_PREOPT