Don't use the same temp directory to uncompress dex

This was ok for apk because they are in different parent directory.

Test: marlin built
Bug: 63920015
Bug: 30972906
Change-Id: I5ed00824fda9e7e0a99c825402753c21a06ba6c5
This commit is contained in:
Victor Hsieh 2018-02-08 12:21:37 -08:00
parent b5751e4bd7
commit 7aecf33efd
1 changed files with 5 additions and 4 deletions

View File

@ -2601,11 +2601,12 @@ endef
#
define uncompress-dexs
$(hide) if (zipinfo $@ '*.dex' 2>/dev/null | grep -v ' stor ' >/dev/null) ; then \
rm -rf $(dir $@)uncompresseddexs && mkdir $(dir $@)uncompresseddexs; \
unzip -q $@ '*.dex' -d $(dir $@)uncompresseddexs && \
tmpdir=$@.tmpdir; \
rm -rf $$tmpdir && mkdir $$tmpdir; \
unzip -q $@ '*.dex' -d $$tmpdir && \
zip -qd $@ '*.dex' && \
( cd $(dir $@)uncompresseddexs && find . -type f | sort | zip -qD -X -0 ../$(notdir $@) -@ ) && \
rm -rf $(dir $@)uncompresseddexs; \
( cd $$tmpdir && find . -type f | sort | zip -qD -X -0 ../$(notdir $@) -@ ) && \
rm -rf $$tmpdir; \
fi
endef