Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b501d53 authored by dianlujitao's avatar dianlujitao
Browse files

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
parent db1caf45
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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}"