From 2c8008356bbc23b3c0010d93ccea5dce036d92b1 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 11 Mar 2018 22:10:46 +0100 Subject: [PATCH] update: handle bad XML when using androguard repo/ch.swift.willi_417101.apk had a C/Java comment in the AndroidManifest.xml rather than an XML comment: // Remove permissions introduced by the appsflyer library --- fdroidserver/update.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 168ef31f..7203fbcc 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -1264,7 +1264,10 @@ def scan_apk_androguard(apk, apkfile): apk['uses-permission-sdk-23'].append(permission_sdk_23) for item in xml.findall('uses-feature'): - feature = str(item.attrib['{' + xml.nsmap['android'] + '}name']) + key = '{' + xml.nsmap['android'] + '}name' + if key not in item.attrib: + continue + feature = str(item.attrib[key]) if feature != "android.hardware.screen.portrait" \ and feature != "android.hardware.screen.landscape": if feature.startswith("android.feature."):