Merge "Revert "Make privileged apps always keep uncompressed dex files."" am: bb779a0c04 am: ed7dab7625
am: 7c1b5d08d4

Change-Id: I6c71407f2504ccb8bde2ad121dc9574afe32c02d
diff --git a/core/base_rules.mk b/core/base_rules.mk
index e7da560..57ac23c 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -660,15 +660,6 @@
 endif
 
 ###########################################################
-# Ensure privileged applications always have LOCAL_PRIVILEGED_MODULE
-###########################################################
-ifndef LOCAL_PRIVILEGED_MODULE
-  ifneq (,$(filter $(TARGET_OUT_APPS_PRIVILEGED)/% $(TARGET_OUT_VENDOR_APPS_PRIVILEGED)/%,$(my_module_path)))
-    LOCAL_PRIVILEGED_MODULE := true
-  endif
-endif
-
-###########################################################
 ## NOTICE files
 ###########################################################
 
diff --git a/core/definitions.mk b/core/definitions.mk
index 3c18a8c..b27c69e 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2726,18 +2726,6 @@
 $(hide) $(ZIPTIME) $@
 endef
 
-# Uncompress dex files embedded in an apk.
-#
-define uncompress-dexs
-$(hide) if (zipinfo $@ '*.dex' 2>/dev/null | grep -v ' stor ' >/dev/null) ; then \
-  rm -rf $(dir $@)uncompresseddexs && mkdir $(dir $@)uncompresseddexs; \
-  unzip $@ '*.dex' -d $(dir $@)uncompresseddexs && \
-  zip -d $@ '*.dex' && \
-  ( cd $(dir $@)uncompresseddexs && find -type f | sort | zip -D -X -0 ../$(notdir $@) -@ ) && \
-  rm -rf $(dir $@)uncompresseddexs; \
-  fi
-endef
-
 # Uncompress shared libraries embedded in an apk.
 #
 define uncompress-shared-libs
diff --git a/core/package_internal.mk b/core/package_internal.mk
index c8a3b0a..254179c 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -633,10 +633,6 @@
 	@# Keep a copy of apk with classes.dex unstripped
 	$(hide) cp -f $@ $(dir $@)package.dex.apk
 endif  # BUILD_PLATFORM_ZIP
-ifeq (true,$(LOCAL_PRIVILEGED_MODULE))
-	@# No need to align, sign-package below will do it.
-	$(uncompress-dexs)
-endif  # LOCAL_PRIVILEGED_MODULE
 ifneq (nostripping,$(LOCAL_DEX_PREOPT))
 	$(call dexpreopt-remove-classes.dex,$@)
 endif
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 01e3392..8caf0ee 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -374,9 +374,6 @@
 $(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(SIGNAPK_JAR)
 	$(transform-prebuilt-to-target)
 	$(uncompress-shared-libs)
-ifeq (true,$(LOCAL_PRIVILEGED_MODULE))
-	$(uncompress-dexs)
-endif  # LOCAL_PRIVILEGED_MODULE
 ifdef LOCAL_DEX_PREOPT
 ifneq ($(BUILD_PLATFORM_ZIP),)
 	@# Keep a copy of apk with classes.dex unstripped