diff options
author | Doug Zongker <dougz@android.com> | 2011-11-11 09:51:37 -0800 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2011-11-11 09:51:37 -0800 |
commit | a5f534df07a598f3fc9d353a1a9a0ff6c09cfbc0 (patch) | |
tree | 365a5e5882dda66825c210c3e78f5cc9e071ff5b /tools/releasetools/check_target_files_signatures | |
parent | 278c9781ec5d2ef289fee635dfcfd8befcfe531b (diff) | |
download | build-a5f534df07a598f3fc9d353a1a9a0ff6c09cfbc0.zip build-a5f534df07a598f3fc9d353a1a9a0ff6c09cfbc0.tar.gz build-a5f534df07a598f3fc9d353a1a9a0ff6c09cfbc0.tar.bz2 |
use frozensets to represent APK cert sets
Change-Id: Ic92c83be0c3f6a76bf1bd21f0216cd1b87586959
Diffstat (limited to 'tools/releasetools/check_target_files_signatures')
-rwxr-xr-x | tools/releasetools/check_target_files_signatures | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/releasetools/check_target_files_signatures b/tools/releasetools/check_target_files_signatures index 7cb3e8a..ae372ba 100755 --- a/tools/releasetools/check_target_files_signatures +++ b/tools/releasetools/check_target_files_signatures @@ -187,15 +187,15 @@ def CertFromPKCS7(data, filename): class APK(object): def __init__(self, full_filename, filename): self.filename = filename - self.certs = set() Push(filename+":") try: - self.RecordCert(full_filename) + self.RecordCerts(full_filename) self.ReadManifest(full_filename) finally: Pop() - def RecordCert(self, full_filename): + def RecordCerts(self, full_filename): + out = set() try: f = open(full_filename) apk = zipfile.ZipFile(f, "r") @@ -205,12 +205,13 @@ class APK(object): (info.filename.endswith(".DSA") or info.filename.endswith(".RSA")): pkcs7 = apk.read(info.filename) cert = CertFromPKCS7(pkcs7, info.filename) - self.certs.add(cert) + out.add(cert) ALL_CERTS.Add(cert) if not pkcs7: AddProblem("no signature") finally: f.close() + self.certs = frozenset(out) def ReadManifest(self, full_filename): p = common.Run(["aapt", "dump", "xmltree", full_filename, |