Lines Matching refs:filename

259 def IsApexFile(filename):  argument
260 return filename.endswith(".apex") or filename.endswith(".capex")
272 def IsEntryOtaPackage(input_zip, filename): argument
273 with input_zip.open(filename, "r") as fp:
274 external_attr = input_zip.getinfo(filename).external_attr
277 os.path.join(os.path.dirname(filename), fp.read().decode()))
281 def GetApexFilename(filename): argument
282 name = os.path.basename(filename)
377 def GetApkFileInfo(filename, compressed_extension, skipped_prefixes): argument
411 is_apk = (filename.endswith(".apk") or
413 filename.endswith(compressed_apk_extension)))
418 filename.endswith(compressed_apk_extension))
419 should_be_skipped = filename.startswith(tuple(skipped_prefixes))
441 if IsApexFile(info.filename):
442 name = GetApexFilename(info.filename)
449 info.filename, compressed_extension, OPTIONS.skip_apks_with_path_prefix)
453 name = os.path.basename(info.filename)
473 if not IsApexFile(info.filename):
476 name = GetApexFilename(info.filename)
556 def IsBuildPropFile(filename): argument
557 return filename in (
577 filename.endswith("build.prop") or \
578 filename.endswith("/default.prop") or \
579 filename.endswith("/prop.default")
590 [len(os.path.basename(i.filename)) for i in input_tf_zip.infolist()
591 if GetApkFileInfo(i.filename, compressed_extension, [])[0]])
597 filename = info.filename
598 if filename.startswith("IMAGES/"):
603 if filename.startswith("OTA/") and filename.endswith(".img"):
606 data = input_tf_zip.read(filename)
609 filename, compressed_extension, OPTIONS.skip_apks_with_path_prefix)
615 " (skipped due to matching prefix)" % (filename,))
620 name = os.path.basename(filename)
638 elif IsApexFile(filename):
639 name = GetApexFilename(filename)
662 common.ZipWrite(output_tf_zip, signed_apex, filename)
670 elif filename.endswith(".zip") and IsEntryOtaPackage(input_tf_zip, filename):
671 logger.info("Re-signing OTA package {}".format(filename))
673 with input_tf_zip.open(filename, "r") as in_fp:
677 common.ZipWrite(output_tf_zip, output_ota.name, filename,
680 elif IsBuildPropFile(filename):
681 print("Rewriting %s:" % (filename,))
690 elif filename.endswith("mac_permissions.xml"):
691 print("Rewriting %s with new keys." % (filename,))
696 elif filename in ("SYSTEM/recovery-from-boot.p",
708 elif OPTIONS.replace_ota_keys and filename.endswith("/otacerts.zip"):
712 elif filename == "META/misc_info.txt":
716 (filename.startswith("BOOT/RAMDISK/avb/") or
717 filename.startswith("BOOT/RAMDISK/first_stage_ramdisk/avb/"))):
720 if filename.endswith(key_to_remove):
722 print("Removing AVB public key from ramdisk: %s" % filename)
729 elif filename == "META/vbmeta_digest.txt":
733 elif filename in ["META/care_map.pb", "META/care_map.txt"]:
737 elif filename == "META/apex_info.pb":
741 elif filename in (
751 common.ZipWrite(output_tf_zip, public_key, filename)
754 elif filename == "PREBUILT_IMAGES/pvmfw.img":
761 print("Removing %s from ramdisk: virt APEX not found" % filename)
763 print("Replacing %s embedded key with %s key" % (filename, virt_apex))
772 old_pubkey = input_tf_zip.read(pubkey_info.filename)
783 elif filename == "PREBUILT_IMAGES/pvmfw_embedded.avbpubkey":
787 elif filename in (
793 elif filename in (
803 elif filename == "VENDOR/etc/avf/microdroid/microdroid_vendor.img":
811 common.ZipWrite(output_tf_zip, image.name, filename)
963 "%s.x509.pem." % (e.filename, e.strerror, old, new))
1053 def WriteOtacerts(output_zip, filename, keys): argument
1066 common.ZipWriteStr(output_zip, filename, temp_file.getvalue())
1124 if info.filename.endswith("/otacerts.zip")]
1126 if info.filename.startswith(("BOOT/", "RECOVERY/", "VENDOR_BOOT/")):
1130 print("Rewriting OTA key:", info.filename, mapped_keys + extra_keys)
1131 WriteOtacerts(output_tf_zip, info.filename, mapped_keys + extra_keys)