From 0b501d534ab9b761ddba57b81e7095c8bdac1818 Mon Sep 17 00:00:00 2001 From: dianlujitao Date: Mon, 6 Apr 2020 12:45:36 +0800 Subject: [PATCH] extract_utils: Generate deodexed apk/jar with consistent checksum * zip stores timestamp for all included files. The timestamps of dex files are different across different runs, result in inconsistent checksum of output apk/jar. * Workaround the issue by using fixed timestamp for dex files. Change-Id: I21f3a7e32cdfdb07c5f5c140df2e797efd4a8005 --- build/tools/extract_utils.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh index 08ef3ddc..47116b29 100644 --- a/build/tools/extract_utils.sh +++ b/build/tools/extract_utils.sh @@ -1590,6 +1590,7 @@ function extract() { if [[ "$FULLY_DEODEXED" -ne "1" && "${VENDOR_REPO_FILE}" =~ .(apk|jar)$ ]]; then oat2dex "${VENDOR_REPO_FILE}" "${SRC_FILE}" "$SRC" if [ -f "$TMPDIR/classes.dex" ]; then + touch -t 200901010000 "$TMPDIR/classes"* zip -gjq "${VENDOR_REPO_FILE}" "$TMPDIR/classes"* rm "$TMPDIR/classes"* printf ' (updated %s from odex files)\n' "${SRC_FILE}"