From d68830418b5fc755e0a88a9ba26a968d6ba5bf56 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 3 Jun 2014 13:28:35 -0400 Subject: [PATCH] apps with no get strange values of minSdkVersion Using this example app which does not have : https://android.googlesource.com/platform/development/+log/master/samples/ApiDemos/assets/HelloActivity.apk aapt then returns "sdkVersion:'IceCreamSandwich'". minSdkVersion is only ever supposed to be an integer, so this is a bizarre APK. It is included only as a binary in the git repo for Android sample code. But who knows what else is out there, so report and error and carry on with the update process. --- fdroidserver/update.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 839a84f8..aca6b994 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -419,7 +419,12 @@ def scan_apks(apps, apkcache, repodir, knownapks): path = match.group(2) thisinfo['icons_src'][density] = path elif line.startswith("sdkVersion:"): - thisinfo['sdkversion'] = re.match(sdkversion_pat, line).group(1) + m = re.match(sdkversion_pat, line) + if m is None: + logging.error(line.replace('sdkVersion:', '') + + ' is not a valid minSdkVersion!') + else: + thisinfo['sdkversion'] = m.group(1) elif line.startswith("maxSdkVersion:"): thisinfo['maxsdkversion'] = re.match(sdkversion_pat, line).group(1) elif line.startswith("native-code:"):