Loading tools/releasetools/apex_utils.py +2 −2 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ class ApexApkSigner(object): # Add the payload image back to the apex file. common.ZipDelete(self.apex_path, APEX_PAYLOAD_IMAGE) with zipfile.ZipFile(self.apex_path, 'a') as output_apex: with zipfile.ZipFile(self.apex_path, 'a', allowZip64=True) as output_apex: common.ZipWrite(output_apex, payload_img, APEX_PAYLOAD_IMAGE, compress_type=zipfile.ZIP_STORED) return self.apex_path Loading Loading @@ -351,7 +351,7 @@ def SignApex(avbtool, apex_data, payload_key, container_key, container_pw, common.ZipDelete(apex_file, APEX_PAYLOAD_IMAGE) if APEX_PUBKEY in zip_items: common.ZipDelete(apex_file, APEX_PUBKEY) apex_zip = zipfile.ZipFile(apex_file, 'a') apex_zip = zipfile.ZipFile(apex_file, 'a', allowZip64=True) common.ZipWrite(apex_zip, payload_file, arcname=APEX_PAYLOAD_IMAGE) common.ZipWrite(apex_zip, payload_public_key, arcname=APEX_PUBKEY) common.ZipClose(apex_zip) Loading tools/releasetools/check_ota_package_signature.py +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ def VerifyPackage(cert, package): def VerifyAbOtaPayload(cert, package): """Verifies the payload and metadata signatures in an A/B OTA payload.""" package_zip = zipfile.ZipFile(package, 'r') package_zip = zipfile.ZipFile(package, 'r', allowZip64=True) if 'payload.bin' not in package_zip.namelist(): common.ZipClose(package_zip) return Loading tools/releasetools/check_target_files_vintf.py +1 −1 Original line number Diff line number Diff line Loading @@ -252,7 +252,7 @@ def HasTrebleEnabled(target_files, target_info): if os.path.isdir(target_files): return os.path.isdir(os.path.join(target_files, "VENDOR")) if zipfile.is_zipfile(target_files): return HasPartition(zipfile.ZipFile(target_files), "vendor") return HasPartition(zipfile.ZipFile(target_files, allowZip64=True), "vendor") raise ValueError("Unknown target_files argument") return (HasVendorPartition(target_files) and Loading tools/releasetools/common.py +1 −1 Original line number Diff line number Diff line Loading @@ -1568,7 +1568,7 @@ def UnzipToDir(filename, dirname, patterns=None): cmd = ["unzip", "-o", "-q", filename, "-d", dirname] if patterns is not None: # Filter out non-matching patterns. unzip will complain otherwise. with zipfile.ZipFile(filename) as input_zip: with zipfile.ZipFile(filename, allowZip64=True) as input_zip: names = input_zip.namelist() filtered = [ pattern for pattern in patterns if fnmatch.filter(names, pattern)] Loading tools/releasetools/ota_from_target_files.py +7 −7 Original line number Diff line number Diff line Loading @@ -656,7 +656,7 @@ def GetTargetFilesZipForSecondaryImages(input_file, skip_postinstall=False): target_file = common.MakeTempFile(prefix="targetfiles-", suffix=".zip") target_zip = zipfile.ZipFile(target_file, 'w', allowZip64=True) with zipfile.ZipFile(input_file, 'r') as input_zip: with zipfile.ZipFile(input_file, 'r', allowZip64=True) as input_zip: infolist = input_zip.infolist() input_tmp = common.UnzipTemp(input_file, UNZIP_PATTERN) Loading Loading @@ -719,7 +719,7 @@ def GetTargetFilesZipWithoutPostinstallConfig(input_file): The filename of target-files.zip that doesn't contain postinstall config. """ # We should only make a copy if postinstall_config entry exists. with zipfile.ZipFile(input_file, 'r') as input_zip: with zipfile.ZipFile(input_file, 'r', allowZip64=True) as input_zip: if POSTINSTALL_CONFIG not in input_zip.namelist(): return input_file Loading Loading @@ -754,7 +754,7 @@ def GetTargetFilesZipForRetrofitDynamicPartitions(input_file, target_file = common.MakeTempFile(prefix="targetfiles-", suffix=".zip") shutil.copyfile(input_file, target_file) with zipfile.ZipFile(input_file) as input_zip: with zipfile.ZipFile(input_file, allowZip64=True) as input_zip: namelist = input_zip.namelist() input_tmp = common.UnzipTemp(input_file, RETROFIT_DAP_UNZIP_PATTERN) Loading Loading @@ -822,7 +822,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): else: staging_file = output_file output_zip = zipfile.ZipFile(staging_file, "w", compression=zipfile.ZIP_DEFLATED) compression=zipfile.ZIP_DEFLATED, allowZip64=True) if source_file is not None: assert "ab_partitions" in OPTIONS.source_info_dict, \ Loading Loading @@ -893,7 +893,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): # If dm-verity is supported for the device, copy contents of care_map # into A/B OTA package. target_zip = zipfile.ZipFile(target_file, "r") target_zip = zipfile.ZipFile(target_file, "r", allowZip64=True) if (target_info.get("verity") == "true" or target_info.get("avb_enable") == "true"): care_map_list = [x for x in ["care_map.pb", "care_map.txt"] if Loading Loading @@ -1069,7 +1069,7 @@ def main(argv): if OPTIONS.extracted_input is not None: OPTIONS.info_dict = common.LoadInfoDict(OPTIONS.extracted_input) else: with zipfile.ZipFile(args[0], 'r') as input_zip: with zipfile.ZipFile(args[0], 'r', allowZip64=True) as input_zip: OPTIONS.info_dict = common.LoadInfoDict(input_zip) logger.info("--- target info ---") Loading @@ -1078,7 +1078,7 @@ def main(argv): # Load the source build dict if applicable. if OPTIONS.incremental_source is not None: OPTIONS.target_info_dict = OPTIONS.info_dict with zipfile.ZipFile(OPTIONS.incremental_source, 'r') as source_zip: with zipfile.ZipFile(OPTIONS.incremental_source, 'r', allowZip64=True) as source_zip: OPTIONS.source_info_dict = common.LoadInfoDict(source_zip) logger.info("--- source info ---") Loading Loading
tools/releasetools/apex_utils.py +2 −2 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ class ApexApkSigner(object): # Add the payload image back to the apex file. common.ZipDelete(self.apex_path, APEX_PAYLOAD_IMAGE) with zipfile.ZipFile(self.apex_path, 'a') as output_apex: with zipfile.ZipFile(self.apex_path, 'a', allowZip64=True) as output_apex: common.ZipWrite(output_apex, payload_img, APEX_PAYLOAD_IMAGE, compress_type=zipfile.ZIP_STORED) return self.apex_path Loading Loading @@ -351,7 +351,7 @@ def SignApex(avbtool, apex_data, payload_key, container_key, container_pw, common.ZipDelete(apex_file, APEX_PAYLOAD_IMAGE) if APEX_PUBKEY in zip_items: common.ZipDelete(apex_file, APEX_PUBKEY) apex_zip = zipfile.ZipFile(apex_file, 'a') apex_zip = zipfile.ZipFile(apex_file, 'a', allowZip64=True) common.ZipWrite(apex_zip, payload_file, arcname=APEX_PAYLOAD_IMAGE) common.ZipWrite(apex_zip, payload_public_key, arcname=APEX_PUBKEY) common.ZipClose(apex_zip) Loading
tools/releasetools/check_ota_package_signature.py +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ def VerifyPackage(cert, package): def VerifyAbOtaPayload(cert, package): """Verifies the payload and metadata signatures in an A/B OTA payload.""" package_zip = zipfile.ZipFile(package, 'r') package_zip = zipfile.ZipFile(package, 'r', allowZip64=True) if 'payload.bin' not in package_zip.namelist(): common.ZipClose(package_zip) return Loading
tools/releasetools/check_target_files_vintf.py +1 −1 Original line number Diff line number Diff line Loading @@ -252,7 +252,7 @@ def HasTrebleEnabled(target_files, target_info): if os.path.isdir(target_files): return os.path.isdir(os.path.join(target_files, "VENDOR")) if zipfile.is_zipfile(target_files): return HasPartition(zipfile.ZipFile(target_files), "vendor") return HasPartition(zipfile.ZipFile(target_files, allowZip64=True), "vendor") raise ValueError("Unknown target_files argument") return (HasVendorPartition(target_files) and Loading
tools/releasetools/common.py +1 −1 Original line number Diff line number Diff line Loading @@ -1568,7 +1568,7 @@ def UnzipToDir(filename, dirname, patterns=None): cmd = ["unzip", "-o", "-q", filename, "-d", dirname] if patterns is not None: # Filter out non-matching patterns. unzip will complain otherwise. with zipfile.ZipFile(filename) as input_zip: with zipfile.ZipFile(filename, allowZip64=True) as input_zip: names = input_zip.namelist() filtered = [ pattern for pattern in patterns if fnmatch.filter(names, pattern)] Loading
tools/releasetools/ota_from_target_files.py +7 −7 Original line number Diff line number Diff line Loading @@ -656,7 +656,7 @@ def GetTargetFilesZipForSecondaryImages(input_file, skip_postinstall=False): target_file = common.MakeTempFile(prefix="targetfiles-", suffix=".zip") target_zip = zipfile.ZipFile(target_file, 'w', allowZip64=True) with zipfile.ZipFile(input_file, 'r') as input_zip: with zipfile.ZipFile(input_file, 'r', allowZip64=True) as input_zip: infolist = input_zip.infolist() input_tmp = common.UnzipTemp(input_file, UNZIP_PATTERN) Loading Loading @@ -719,7 +719,7 @@ def GetTargetFilesZipWithoutPostinstallConfig(input_file): The filename of target-files.zip that doesn't contain postinstall config. """ # We should only make a copy if postinstall_config entry exists. with zipfile.ZipFile(input_file, 'r') as input_zip: with zipfile.ZipFile(input_file, 'r', allowZip64=True) as input_zip: if POSTINSTALL_CONFIG not in input_zip.namelist(): return input_file Loading Loading @@ -754,7 +754,7 @@ def GetTargetFilesZipForRetrofitDynamicPartitions(input_file, target_file = common.MakeTempFile(prefix="targetfiles-", suffix=".zip") shutil.copyfile(input_file, target_file) with zipfile.ZipFile(input_file) as input_zip: with zipfile.ZipFile(input_file, allowZip64=True) as input_zip: namelist = input_zip.namelist() input_tmp = common.UnzipTemp(input_file, RETROFIT_DAP_UNZIP_PATTERN) Loading Loading @@ -822,7 +822,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): else: staging_file = output_file output_zip = zipfile.ZipFile(staging_file, "w", compression=zipfile.ZIP_DEFLATED) compression=zipfile.ZIP_DEFLATED, allowZip64=True) if source_file is not None: assert "ab_partitions" in OPTIONS.source_info_dict, \ Loading Loading @@ -893,7 +893,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): # If dm-verity is supported for the device, copy contents of care_map # into A/B OTA package. target_zip = zipfile.ZipFile(target_file, "r") target_zip = zipfile.ZipFile(target_file, "r", allowZip64=True) if (target_info.get("verity") == "true" or target_info.get("avb_enable") == "true"): care_map_list = [x for x in ["care_map.pb", "care_map.txt"] if Loading Loading @@ -1069,7 +1069,7 @@ def main(argv): if OPTIONS.extracted_input is not None: OPTIONS.info_dict = common.LoadInfoDict(OPTIONS.extracted_input) else: with zipfile.ZipFile(args[0], 'r') as input_zip: with zipfile.ZipFile(args[0], 'r', allowZip64=True) as input_zip: OPTIONS.info_dict = common.LoadInfoDict(input_zip) logger.info("--- target info ---") Loading @@ -1078,7 +1078,7 @@ def main(argv): # Load the source build dict if applicable. if OPTIONS.incremental_source is not None: OPTIONS.target_info_dict = OPTIONS.info_dict with zipfile.ZipFile(OPTIONS.incremental_source, 'r') as source_zip: with zipfile.ZipFile(OPTIONS.incremental_source, 'r', allowZip64=True) as source_zip: OPTIONS.source_info_dict = common.LoadInfoDict(source_zip) logger.info("--- source info ---") Loading