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
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user