From 1a75fa6493dc87a32a19f13967f8530f9d03103a Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 27 Jul 2016 19:45:43 -0700 Subject: [PATCH] Handle multiple APKs from the same package in check_target_files_signatures.py. We were using the package name as the key to index APKs. APKs from the same package got messed up and gave wrong signature summary. Switch to using the package filename as the key, which is identical in a given build. Also fix the trailing space when printing the signature summary. Bug: 30418268 Test: Run with a target_files.zip that has multiple APKs from the same package. Change-Id: I6317e8c05e987c5690915e05c294153d10e2f0ab (cherry picked from commit 6a54299fbd16a3bd2051f08d5dbdaf94b95bf485) --- tools/releasetools/check_target_files_signatures.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/releasetools/check_target_files_signatures.py b/tools/releasetools/check_target_files_signatures.py index 5c541abc6..3048488d3 100755 --- a/tools/releasetools/check_target_files_signatures.py +++ b/tools/releasetools/check_target_files_signatures.py @@ -245,7 +245,7 @@ class TargetFiles(object): fullname = os.path.join(dirpath, fn) displayname = fullname[len(d)+1:] apk = APK(fullname, displayname) - self.apks[apk.package] = apk + self.apks[apk.filename] = apk self.apks_by_basename[os.path.basename(apk.filename)] = apk self.max_pkg_len = max(self.max_pkg_len, len(apk.package)) @@ -316,8 +316,7 @@ class TargetFiles(object): self.max_pkg_len, apk.package, apk.shared_uid) else: - print " %-*s %-*s" % (self.max_fn_len, apk.filename, - self.max_pkg_len, apk.package) + print " %-*s %s" % (self.max_fn_len, apk.filename, apk.package) print def CompareWith(self, other):