Run zipalign after classes.dex is removed from the apk
If LOCAL_DEX_PREOPT is enabled.
Change-Id: Ie2a706fbb77bc31c9fdb01c8435819c5de97ea28
diff --git a/core/package.mk b/core/package.mk
index c0bc7d8..3a8e43a 100644
--- a/core/package.mk
+++ b/core/package.mk
@@ -421,15 +421,17 @@
$(add-java-resources-to-package)
endif
$(sign-package)
- @# Alignment must happen after all other zip operations.
- $(align-package)
ifdef LOCAL_DEX_PREOPT
$(hide) rm -f $(patsubst %.apk,%.odex,$@)
$(call dexpreopt-one-file,$@,$(patsubst %.apk,%.odex,$@))
ifneq (nostripping,$(LOCAL_DEX_PREOPT))
$(call dexpreopt-remove-classes.dex,$@)
endif
+endif
+ @# Alignment must happen after all other zip operations.
+ $(align-package)
+ifdef LOCAL_DEX_PREOPT
built_odex := $(basename $(LOCAL_BUILT_MODULE)).odex
$(built_odex): $(LOCAL_BUILT_MODULE)
endif