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

Commit 359862db authored by Tao Bao's avatar Tao Bao
Browse files

Revert^2 "releasetools: check_target_files_signatures.py checks APEXes."

This reverts commit 5516d37f.

The previous issue in unzipping non-matching files has been addressed
with commit a49054ca2f2959f50f3188914ec0faebc90ebcbe. This CL rolls
forward to allow dumping container certifcates for APEXes.

Bug: 128848294
Test: Run check_target_files_signatures.py on target_files.zips w/ and
      w/o APEX files.
Change-Id: I662aab3d96fc40ac8e5e206e32b73ac763220b70
parent 0ff15de3
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ def CertFromPKCS7(data, filename):


class APK(object):

  def __init__(self, full_filename, filename):
    self.filename = filename
    self.certs = None
@@ -244,12 +245,12 @@ class TargetFiles(object):
    # must decompress them individually before we perform any analysis.

    # This is the list of wildcards of files we extract from |filename|.
    apk_extensions = ['*.apk']
    apk_extensions = ['*.apk', '*.apex']

    self.certmap, compressed_extension = common.ReadApkCerts(
        zipfile.ZipFile(filename, "r"))
        zipfile.ZipFile(filename))
    if compressed_extension:
      apk_extensions.append("*.apk" + compressed_extension)
      apk_extensions.append('*.apk' + compressed_extension)

    d = common.UnzipTemp(filename, apk_extensions)
    self.apks = {}
@@ -272,7 +273,7 @@ class TargetFiles(object):
          os.remove(os.path.join(dirpath, fn))
          fn = uncompressed_fn

        if fn.endswith(".apk"):
        if fn.endswith(('.apk', '.apex')):
          fullname = os.path.join(dirpath, fn)
          displayname = fullname[len(d)+1:]
          apk = APK(fullname, displayname)