Revert "Remove all ZIP64LIMIT hack"

This reverts commit 37a4290909.

Reason for revert: b/278156419

Change-Id: I67ea667619a9623be849d911993010ef0f0bfd88
This commit is contained in:
Kelvin Zhang
2023-04-14 21:32:54 +00:00
committed by Gerrit Code Review
parent 37a4290909
commit f92f7f046a
9 changed files with 101 additions and 67 deletions

View File

@@ -842,13 +842,14 @@ def ReplaceUpdatedFiles(zip_filename, files_list):
SYSTEM/ after rebuilding recovery.
"""
common.ZipDelete(zip_filename, files_list)
with zipfile.ZipFile(zip_filename, "a",
output_zip = zipfile.ZipFile(zip_filename, "a",
compression=zipfile.ZIP_DEFLATED,
allowZip64=True) as output_zip:
for item in files_list:
file_path = os.path.join(OPTIONS.input_tmp, item)
assert os.path.exists(file_path)
common.ZipWrite(output_zip, file_path, arcname=item)
allowZip64=True)
for item in files_list:
file_path = os.path.join(OPTIONS.input_tmp, item)
assert os.path.exists(file_path)
common.ZipWrite(output_zip, file_path, arcname=item)
common.ZipClose(output_zip)
def HasPartition(partition_name):
@@ -1175,7 +1176,7 @@ def AddImagesToTargetFiles(filename):
AddVbmetaDigest(output_zip)
if output_zip:
output_zip.close()
common.ZipClose(output_zip)
if OPTIONS.replace_updated_files_list:
ReplaceUpdatedFiles(output_zip.filename,
OPTIONS.replace_updated_files_list)