diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 39c1dcd4..ecf4629c 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1846,20 +1846,21 @@ def parse_androidmanifests(paths, app): else: try: xml = parse_xml(path) - if "package" in xml.attrib: - s = xml.attrib["package"] - if app_matches_packagename(app, s): - package = s - if XMLNS_ANDROID + "versionName" in xml.attrib: - version = xml.attrib[XMLNS_ANDROID + "versionName"] - base_dir = os.path.dirname(path) - version = retrieve_string_singleline(base_dir, version) - if XMLNS_ANDROID + "versionCode" in xml.attrib: - a = xml.attrib[XMLNS_ANDROID + "versionCode"] - if string_is_integer(a): - vercode = a except Exception: logging.warning(_("Problem with xml at '{path}'").format(path=path)) + continue + if "package" in xml.attrib: + s = xml.attrib["package"] + if app_matches_packagename(app, s): + package = s + if XMLNS_ANDROID + "versionName" in xml.attrib: + version = xml.attrib[XMLNS_ANDROID + "versionName"] + base_dir = os.path.dirname(path) + version = retrieve_string_singleline(base_dir, version) + if XMLNS_ANDROID + "versionCode" in xml.attrib: + a = xml.attrib[XMLNS_ANDROID + "versionCode"] + if string_is_integer(a): + vercode = a # Remember package name, may be defined separately from version+vercode if package is None: