update.py: Still aapt output parsing, setting regex to catch 'name=' without prefixes, needed for build-tools 28.0.3

build-tools 28.0.3 added a new field in the end 'compileSdkVersionCodename=', which also accidentally ends with the string 'name='.
The purpose of this regex was to catch the 'packageName' field, which is in ht eaapt ouput the exact ' name=', therefore added whe non-caracter \W prefix match.

sample aapt output (28.0.3):
package: name='com.a.b.app' versionCode='1' versionName='1.0' compileSdkVersion='28' compileSdkVersionCodename='9'

previously, regex was catching second occurence, so '9'

See merge request !582
This commit is contained in:
Francesco Cervigni 2018-11-13 02:33:11 +00:00 committed by henry
parent 357dea762d
commit 64445520b0
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ METADATA_VERSION = 21
# less than the valid range of versionCode, i.e. Java's Integer.MIN_VALUE
UNSET_VERSION_CODE = -0x100000000
APK_NAME_PAT = re.compile(".*name='([a-zA-Z0-9._]*)'.*")
APK_NAME_PAT = re.compile(".*\Wname='([a-zA-Z0-9._]*)'.*")
APK_VERCODE_PAT = re.compile(".*versionCode='([0-9]*)'.*")
APK_VERNAME_PAT = re.compile(".*versionName='([^']*)'.*")
APK_LABEL_ICON_PAT = re.compile(r".*\s+label='(.*)'\s+icon='(.*?)'")