signatures: future-proof fetching app ID info from APK

We're not using platformBuildVersionName and it might go away just like it
appeared: with no good reason or announcement.
This commit is contained in:
Hans-Christoph Steiner 2018-02-22 14:30:39 +01:00
parent 88e24dc4e3
commit e75bf70be6
2 changed files with 35 additions and 5 deletions

View file

@ -1990,7 +1990,7 @@ def get_apk_id_aapt(apkfile):
:param apkfile: path to an APK file.
:returns: triplet (appid, version code, version name)
"""
r = re.compile("package: name='(?P<appid>.*)' versionCode='(?P<vercode>.*)' versionName='(?P<vername>.*)' platformBuildVersionName='.*'")
r = re.compile("^package: name='(?P<appid>.*)' versionCode='(?P<vercode>.*)' versionName='(?P<vername>.*)'.*")
p = SdkToolsPopen(['aapt', 'dump', 'badging', apkfile], output=False)
for line in p.output.splitlines():
m = r.match(line)