From b5c1634320d109ff9c9b69bd3952d3f11636b7fe Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 14 Mar 2018 18:42:06 +0100 Subject: [PATCH] update: handle renameManifestPackage when extracting icons with androguard aapt --rename-manifest-package changes the applicationId for an app without changing the packageName listed in AndroidManifest.xml under --- fdroidserver/update.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 75f1c4a3..058cd5ea 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -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/(.*)/.*$")