Use zip2zip for uncompress-dexs and uncompress-shared-libs

Unzipping and rezipping files causes the umask of the host machine
to affect the permissions in the APK.  Use the new zip2zip -0 feature
to rewrite the zip file with selected files uncompressed.

Bug: 69500920
Test: m checkbuild
Change-Id: I82dd3aa441712772a1d1ddd6aaf5f41179facaa7
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 9343415..84d1c2c 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -620,6 +620,9 @@
 ifdef LOCAL_COMPRESSED_MODULE
 $(LOCAL_BUILT_MODULE) : $(MINIGZIP)
 endif
+ifeq (true, $(LOCAL_UNCOMPRESS_DEX))
+$(LOCAL_BUILT_MODULE) : $(ZIP2ZIP)
+endif
 ifneq ($(BUILD_PLATFORM_ZIP),)
 $(LOCAL_BUILT_MODULE) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package.dex.apk
 endif
@@ -685,6 +688,9 @@
 ## Rule to build the odex file
 ifdef LOCAL_DEX_PREOPT
 $(built_odex): PRIVATE_DEX_FILE := $(built_dex)
+ifeq (true, $(LOCAL_UNCOMPRESS_DEX))
+$(built_odex): $(ZIP2ZIP)
+endif
 # Use pattern rule - we may have multiple built odex files.
 $(built_odex) : $(dir $(LOCAL_BUILT_MODULE))% : $(built_dex)
 	$(hide) mkdir -p $(dir $@) && rm -f $@