mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Handle with invalid manifests better
In other words, don't blow up and kill a whole checkupdates run just because one version of one package has some invalid xml.
This commit is contained in:
parent
5952c46bd0
commit
f6b9e46246
1 changed files with 16 additions and 13 deletions
|
|
@ -1072,19 +1072,22 @@ def parse_androidmanifests(paths, app):
|
||||||
if matches:
|
if matches:
|
||||||
vercode = matches.group(1)
|
vercode = matches.group(1)
|
||||||
else:
|
else:
|
||||||
xml = parse_xml(path)
|
try:
|
||||||
if "package" in xml.attrib:
|
xml = parse_xml(path)
|
||||||
s = xml.attrib["package"].encode('utf-8')
|
if "package" in xml.attrib:
|
||||||
if app_matches_packagename(app, s):
|
s = xml.attrib["package"].encode('utf-8')
|
||||||
package = s
|
if app_matches_packagename(app, s):
|
||||||
if "{http://schemas.android.com/apk/res/android}versionName" in xml.attrib:
|
package = s
|
||||||
version = xml.attrib["{http://schemas.android.com/apk/res/android}versionName"].encode('utf-8')
|
if "{http://schemas.android.com/apk/res/android}versionName" in xml.attrib:
|
||||||
base_dir = os.path.dirname(path)
|
version = xml.attrib["{http://schemas.android.com/apk/res/android}versionName"].encode('utf-8')
|
||||||
version = retrieve_string_singleline(base_dir, version)
|
base_dir = os.path.dirname(path)
|
||||||
if "{http://schemas.android.com/apk/res/android}versionCode" in xml.attrib:
|
version = retrieve_string_singleline(base_dir, version)
|
||||||
a = xml.attrib["{http://schemas.android.com/apk/res/android}versionCode"].encode('utf-8')
|
if "{http://schemas.android.com/apk/res/android}versionCode" in xml.attrib:
|
||||||
if string_is_integer(a):
|
a = xml.attrib["{http://schemas.android.com/apk/res/android}versionCode"].encode('utf-8')
|
||||||
vercode = a
|
if string_is_integer(a):
|
||||||
|
vercode = a
|
||||||
|
except Exception:
|
||||||
|
logging.warning("Problem with xml at {0}".format(path))
|
||||||
|
|
||||||
# Remember package name, may be defined separately from version+vercode
|
# Remember package name, may be defined separately from version+vercode
|
||||||
if package is None:
|
if package is None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue