apk['nativecode'].extend(sorted(list(arch)))
xml = apkobject.get_android_manifest_xml()
+ xmlns = xml.nsmap.get('android')
+ if not xmlns:
+ xmlns = 'http://schemas.android.com/apk/res/android'
for item in xml.findall('uses-permission'):
- name = str(item.attrib['{' + xml.nsmap['android'] + '}name'])
- maxSdkVersion = item.attrib.get('{' + xml.nsmap['android'] + '}maxSdkVersion')
+ name = str(item.attrib['{' + xmlns + '}name'])
+ maxSdkVersion = item.attrib.get('{' + xmlns + '}maxSdkVersion')
maxSdkVersion = int(maxSdkVersion) if maxSdkVersion else None
permission = UsesPermission(
name,
apk['uses-permission'].append(permission)
for item in xml.findall('uses-permission-sdk-23'):
- name = str(item.attrib['{' + xml.nsmap['android'] + '}name'])
- maxSdkVersion = item.attrib.get('{' + xml.nsmap['android'] + '}maxSdkVersion')
+ name = str(item.attrib['{' + xmlns + '}name'])
+ maxSdkVersion = item.attrib.get('{' + xmlns + '}maxSdkVersion')
maxSdkVersion = int(maxSdkVersion) if maxSdkVersion else None
permission_sdk_23 = UsesPermissionSdk23(
name,
apk['uses-permission-sdk-23'].append(permission_sdk_23)
for item in xml.findall('uses-feature'):
- key = '{' + xml.nsmap['android'] + '}name'
+ key = '{' + xmlns + '}name'
if key not in item.attrib:
continue
feature = str(item.attrib[key])
and feature != "android.hardware.screen.landscape":
if feature.startswith("android.feature."):
feature = feature[16:]
- required = item.attrib.get('{' + xml.nsmap['android'] + '}required')
+ required = item.attrib.get('{' + xmlns + '}required')
if required is None or required == 'true':
apk['features'].append(feature)