diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index eff43ff4..d7c89eec 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -197,7 +197,11 @@ def check_repomanifest(app, branch=None): if not vercode: return (None,"Couldn't find latest version code") - return (version, str(int(vercode))) + vercode = str(int(vercode)) + + print "Manifest exists. Found version %s (%s)" % (version, vercode) + + return (version, vercode) except BuildException as be: msg = "Could not scan app %s due to BuildException: %s" % (app['id'], be) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index f648ef7d..6b82a701 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -683,9 +683,9 @@ def parse_androidmanifests(paths): vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').search psearch = re.compile(r'.*package="([^"]+)".*').search - vcsearch_g = re.compile(r'.*versionCode[ =]*([0-9]+?)[^\d].*').search - vnsearch_g = re.compile(r'.*versionName[ =]*"([^"]+?)".*').search - psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search + vcsearch_g = re.compile(r'.*versionCode[ ]*=[ ]*["\']*([0-9]+?)[^\d].*').search + vnsearch_g = re.compile(r'.*versionName[ ]*=[ ]*(["\'])((?:(?=(\\?))\3.)*?)\1.*').search + psearch_g = re.compile(r'.*packageName[ ]*=[ ]*["\']([^"]+)["\'].*').search max_version = None max_vercode = None @@ -713,7 +713,7 @@ def parse_androidmanifests(paths): else: matches = vnsearch(line) if matches: - version = matches.group(1) + version = matches.group(2 if gradle else 1) if not vercode: if gradle: matches = vcsearch_g(line)