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

Commit a0411fcc authored by Kelvin Zhang's avatar Kelvin Zhang Committed by Automerger Merge Worker
Browse files

Merge "Make apex util detect if hashtree is present" am: 3645e89d am: 53e2ea9d

Original change: https://android-review.googlesource.com/c/platform/build/+/1784651

Change-Id: Ic3d7660c7326d6ae8e49daac686d21af6a8a993d
parents 6f267a3a 53e2ea9d
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -340,6 +340,8 @@ def SignUncompressedApex(avbtool, apex_file, payload_key, container_key,
    zip_items = apex_fd.namelist()

  payload_info = ParseApexPayloadInfo(avbtool, payload_file)
  if no_hashtree is None:
    no_hashtree = payload_info.get("Tree Size", 0) == 0
  SignApexPayload(
      avbtool,
      payload_file,
@@ -503,6 +505,7 @@ def SignApex(avbtool, apex_data, payload_key, container_key, container_pw,
    raise ApexInfoError(
        'Failed to get type for {}:\n{}'.format(apex_file, e))


def GetApexInfoFromTargetFiles(input_file, partition, compressed_only=True):
  """
  Get information about system APEX stored in the input_file zip
+25 −24
Original line number Diff line number Diff line
@@ -575,7 +575,7 @@ def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info,
            key_passwords,
            apk_keys,
            codename_to_api_level_map,
            no_hashtree=True,
            no_hashtree=None,  # Let apex_util determine if hash tree is needed
            signing_args=OPTIONS.avb_extra_args.get('apex'))
        common.ZipWrite(output_tf_zip, signed_apex, filename)

@@ -762,7 +762,8 @@ def ReplaceCerts(data):
  # it's only checking entries with global seinfo at the moment (i.e. ignoring
  # the ones with inner packages). (Bug: 69479366)
  root = ElementTree.fromstring(data)
  signatures = [signer.attrib['signature'] for signer in root.findall('signer')]
  signatures = [signer.attrib['signature']
                for signer in root.findall('signer')]
  assert len(signatures) == len(set(signatures)), \
      "Found duplicate entries after cert replacement: {}".format(data)