mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
fix "cannot identify image file" with XML icons
This commit is contained in:
parent
56a53055be
commit
6f5b539a54
@ -1473,6 +1473,12 @@ def extract_apk_icons(icon_filename, apk, apkzip, repo_dir):
|
|||||||
if '-1' in apk['icons_src']:
|
if '-1' in apk['icons_src']:
|
||||||
icon_src = apk['icons_src']['-1']
|
icon_src = apk['icons_src']['-1']
|
||||||
icon_path = os.path.join(get_icon_dir(repo_dir, '0'), icon_filename)
|
icon_path = os.path.join(get_icon_dir(repo_dir, '0'), icon_filename)
|
||||||
|
if icon_src.endswith('.xml'):
|
||||||
|
for f in apkzip.namelist():
|
||||||
|
if f.endswith(png):
|
||||||
|
m = re.match(r'res/(drawable|mipmap)-(x*[hlm]dpi).*/', f)
|
||||||
|
if m:
|
||||||
|
icon_src = f
|
||||||
with open(icon_path, 'wb') as f:
|
with open(icon_path, 'wb') as f:
|
||||||
f.write(get_icon_bytes(apkzip, icon_src))
|
f.write(get_icon_bytes(apkzip, icon_src))
|
||||||
im = None
|
im = None
|
||||||
|
Loading…
Reference in New Issue
Block a user