apkcerts: Add information about the compressed state of the APK.

We add a compressed="$extension" attribute to an APK's entry if it's
compressed.

Bug: 64531948
Test: make dist

Change-Id: Ic3f95ed77f0bb16dec825bae944c70ee2d130657
This commit is contained in:
Narayan Kamath 2017-08-14 10:53:50 +01:00
parent 025d5d910b
commit 6a4bd696f6
3 changed files with 8 additions and 8 deletions

View File

@ -419,8 +419,10 @@ package-stats: $(PACKAGE_STATS_FILE)
# -----------------------------------------------------------------
# Cert-to-package mapping. Used by the post-build signing tools.
# Use a macro to add newline to each echo command
define _apkcerts_echo_with_newline
$(hide) echo $(1)
define _apkcerts_write_line
$(hide) echo -n 'name="$(1).apk" certificate="$2" private_key="$3"' >> $5
$(if $(4), $(hide) echo -n ' compressed="$4"' >> $5)
$(hide) echo '' >> $5
endef
@ -440,12 +442,8 @@ $(APKCERTS_FILE):
@rm -f $@
$(foreach p,$(PACKAGES),\
$(if $(PACKAGES.$(p).EXTERNAL_KEY),\
$(call _apkcerts_echo_with_newline,\
'name="$(p).apk" certificate="EXTERNAL" \
private_key=""' >> $@),\
$(call _apkcerts_echo_with_newline,\
'name="$(p).apk" certificate="$(PACKAGES.$(p).CERTIFICATE)" \
private_key="$(PACKAGES.$(p).PRIVATE_KEY)"' >> $@)))
$(call _apkcerts_write_line,$(p),"EXTERNAL","",$(PACKAGES.$(p).COMPRESSED),$@),\
$(call _apkcerts_write_line,$(p),$(PACKAGES.$(p).CERTIFICATE),$(PACKAGES.$(p).PRIVATE_KEY),$(PACKAGES.$(p).COMPRESSED),$@)))
# In case value of PACKAGES is empty.
$(hide) touch $@

View File

@ -222,6 +222,7 @@ endif
endif
ifdef LOCAL_COMPRESSED_MODULE
PACKAGES.$(LOCAL_PACKAGE_NAME).COMPRESSED := gz
LOCAL_BUILT_MODULE_STEM := package.apk.gz
LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk.gz
else # !LOCAL_COMPRESSED_MODULE

View File

@ -120,6 +120,7 @@ endif # LOCAL_COMPRESSED_MODULE
ifndef LOCAL_INSTALLED_MODULE_STEM
ifdef LOCAL_COMPRESSED_MODULE
PACKAGES.$(LOCAL_MODULE).COMPRESSED := gz
LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk.gz
else
LOCAL_INSTALLED_MODULE_STEM := $(LOCAL_MODULE).apk