• Home
  • Raw
  • Download

Lines Matching refs:filename

81       Replace the private key used for verity signing. It expects a filename
87 for devices using system_root_image). It expects the key filename WITH
220 def IsApexFile(filename):
221 return filename.endswith(".apex") or filename.endswith(".capex")
224 def GetApexFilename(filename):
225 name = os.path.basename(filename)
307 def GetApkFileInfo(filename, compressed_extension, skipped_prefixes):
308 """Returns the APK info based on the given filename.
310 Checks if the given filename (with path) looks like an APK file, by taking the
316 filename: Path to the file.
323 given filename is an APK file. is_compressed indicates whether the APK file
325 indicates whether the filename matches any of the given prefixes to be
341 is_apk = (filename.endswith(".apk") or
343 filename.endswith(compressed_apk_extension)))
348 filename.endswith(compressed_apk_extension))
349 should_be_skipped = filename.startswith(tuple(skipped_prefixes))
371 if IsApexFile(info.filename):
372 name = GetApexFilename(info.filename)
379 info.filename, compressed_extension, OPTIONS.skip_apks_with_path_prefix)
383 name = os.path.basename(info.filename)
403 if not IsApexFile(info.filename):
406 name = GetApexFilename(info.filename)
485 def IsBuildPropFile(filename):
486 return filename in (
501 "RECOVERY/RAMDISK/default.prop") or filename.endswith("build.prop")
508 # maxsize measures the maximum filename length, including the ones to be
511 [len(os.path.basename(i.filename)) for i in input_tf_zip.infolist()
512 if GetApkFileInfo(i.filename, compressed_extension, [])[0]])
516 filename = info.filename
517 if filename.startswith("IMAGES/"):
522 if filename.startswith("OTA/") and filename.endswith(".img"):
525 data = input_tf_zip.read(filename)
528 filename, compressed_extension, OPTIONS.skip_apks_with_path_prefix)
534 " (skipped due to matching prefix)" % (filename,))
539 name = os.path.basename(filename)
557 elif IsApexFile(filename):
558 name = GetApexFilename(filename)
580 common.ZipWrite(output_tf_zip, signed_apex, filename)
589 elif IsBuildPropFile(filename):
590 print("Rewriting %s:" % (filename,))
599 elif filename.endswith("mac_permissions.xml"):
600 print("Rewriting %s with new keys." % (filename,))
605 elif filename in ("SYSTEM/recovery-from-boot.p",
617 elif OPTIONS.replace_ota_keys and filename.endswith("/otacerts.zip"):
621 elif filename == "META/misc_info.txt":
626 filename in ("BOOT/RAMDISK/verity_key",
630 (filename.startswith("BOOT/RAMDISK/avb/") or
631 filename.startswith("BOOT/RAMDISK/first_stage_ramdisk/avb/"))):
634 if filename.endswith(key_to_remove):
636 print("Removing AVB public key from ramdisk: %s" % filename)
643 elif OPTIONS.replace_verity_keyid and filename == "BOOT/cmdline":
647 elif filename == "META/vbmeta_digest.txt":
651 elif filename in ["META/care_map.pb", "META/care_map.txt"]:
655 elif filename == "META/apex_info.pb":
659 elif filename in (
669 common.ZipWrite(output_tf_zip, public_key, filename)
672 elif filename in (
750 "%s.x509.pem." % (e.filename, e.strerror, old, new))
840 def WriteOtacerts(output_zip, filename, keys):
845 filename: The archive name in the output zip.
853 common.ZipWriteStr(output_zip, filename, temp_file.getvalue())
895 if info.filename.endswith("/otacerts.zip")]
897 print("Rewriting OTA key:", info.filename, mapped_keys)
898 WriteOtacerts(output_tf_zip, info.filename, mapped_keys)
901 def ReplaceVerityPublicKey(output_zip, filename, key_path):
906 filename: The archive name in the output zip.
910 common.ZipWrite(output_zip, key_path, arcname=filename)