Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit ac838158 authored by Brint E. Kriebel's avatar Brint E. Kriebel Committed by Michael Bestas
Browse files

releasetools: Replace key values in permission files during re-signing

Permission files may grant permissions based on signatures in the same
way mac_permissions grants selinux permissions. In order to have this
work properly with dev-key and production key signed builds, allow these
files to be re-written during the signing process to replace the value
of the keys in production signed builds.

Change-Id: Id0311e49f8bba5a9f71b2fa49b480cb74779c853
Ticket: CYNGNOS-1877, RM-179
parent dd60cd92
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -246,6 +246,10 @@ def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info,
      print "rewriting %s with new keys." % (info.filename,)
      new_data = ReplaceCerts(data)
      common.ZipWriteStr(output_tf_zip, out_info, new_data)
    elif info.filename.startswith("SYSTEM/etc/permissions/"):
      print("rewriting %s with new keys." % info.filename)
      new_data = ReplaceCerts(data)
      common.ZipWriteStr(output_tf_zip, out_info, new_data)

    # Trigger a rebuild of the recovery patch if needed.
    elif info.filename in ("SYSTEM/recovery-from-boot.p",