From 7ee3a9678e7191c48f0ba4e04792fe97925c1aa1 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 11 Apr 2016 23:05:52 -0700 Subject: [PATCH] releasetools: Use fixed timestamp in otacerts.zip. We were using zipfile.write() to write system/etc/security/otacerts.zip when signing for release. It led to unexpected timestamp change in the generated otacerts.zip and non-idempotent signed images when signing the same target_files.zip. Replace with common.ZipWrite() to always use a fixed timestamp. Bug: 28122968 Change-Id: Ia6cf4b7d380cbf72ed7050ebb60c932dc8826d87 --- tools/releasetools/sign_target_files_apks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py index 8941e3569..f758ae04b 100755 --- a/tools/releasetools/sign_target_files_apks.py +++ b/tools/releasetools/sign_target_files_apks.py @@ -421,8 +421,8 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip, misc_info): temp_file = cStringIO.StringIO() certs_zip = zipfile.ZipFile(temp_file, "w") for k in mapped_keys: - certs_zip.write(k) - certs_zip.close() + common.ZipWrite(certs_zip, k) + common.ZipClose(certs_zip) common.ZipWriteStr(output_tf_zip, "SYSTEM/etc/security/otacerts.zip", temp_file.getvalue())