summaryrefslogtreecommitdiffstats
path: root/core/prebuilt_internal.mk
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2015-04-15 12:09:32 -0700
committerKenny Root <kroot@google.com>2015-04-15 12:40:22 -0700
commitdff3755a939a4f69475f22a110fa632981e002f5 (patch)
treec91f0f6b66569bcf2c1a7f651f1d71b9b136904f /core/prebuilt_internal.mk
parent8b75ec1c7b6efa79f358725d0fd7a3932fd273e5 (diff)
downloadbuild-dff3755a939a4f69475f22a110fa632981e002f5.zip
build-dff3755a939a4f69475f22a110fa632981e002f5.tar.gz
build-dff3755a939a4f69475f22a110fa632981e002f5.tar.bz2
Move package signing after file stripping
For dex preopt and JNI library extraction, we should remove the classes.dex and .so files before we sign the APK so that there isn't an entry in the manifest. Prebuilt APKs which are pre-signed will simply not have the files removed. This may cause some system.img bloat, but signature checks make this necessary. Bug: 20247329 Change-Id: I4742d1aa3aa64ab5aea2264304cb8c0bea24f784
Diffstat (limited to 'core/prebuilt_internal.mk')
-rw-r--r--core/prebuilt_internal.mk7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index d544619..8595bce 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -193,17 +193,18 @@ include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
$(built_module) : PRIVATE_PAGE_ALIGN_JNI_SHARED_LIBRARIES := $(LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES)
$(built_module) : $(my_prebuilt_src_file) | $(ACP) $(ZIPALIGN) $(SIGNAPK_JAR)
$(transform-prebuilt-to-target)
+ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
+ @# Only strip out files if we can re-sign the package.
ifdef extracted_jni_libs
$(hide) zip -d $@ 'lib/*.so' # strip embedded JNI libraries.
endif
-ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
- $(sign-package)
-endif
ifdef LOCAL_DEX_PREOPT
ifneq (nostripping,$(LOCAL_DEX_PREOPT))
$(call dexpreopt-remove-classes.dex,$@)
endif
endif
+ $(sign-package)
+endif
$(align-package)
###############################