chiark / gitweb /
update: handle renameManifestPackage when extracting icons with androguard
authorHans-Christoph Steiner <hans@eds.org>
Wed, 14 Mar 2018 17:42:06 +0000 (18:42 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 14 Mar 2018 17:43:05 +0000 (18:43 +0100)
aapt --rename-manifest-package changes the applicationId for an app without
changing the packageName listed in AndroidManifest.xml under
<application android:package="">

fdroidserver/update.py

index 75f1c4a39f2ec35b23c79512600f31103f56bd1a..058cd5ea7bd11b7e567e0fb67389eab807898a7a 100644 (file)
@@ -1228,7 +1228,11 @@ def scan_apk_androguard(apk, apkfile):
     icon_id_str = apkobject.get_element("application", "icon")
     if icon_id_str:
         icon_id = int(icon_id_str.replace("@", "0x"), 16)
-        icon_name = arsc.get_id(apk['packageName'], icon_id)[1]
+        resource_id = arsc.get_id(apk['packageName'], icon_id)
+        if resource_id:
+            icon_name = arsc.get_id(apk['packageName'], icon_id)[1]
+        else:
+            icon_name = os.path.splitext(os.path.basename(apkobject.get_app_icon()))[0]
         apk['icons_src'] = _get_apk_icons_src(apkfile, icon_name)
 
     arch_re = re.compile("^lib/(.*)/.*$")