From 56c05933a2767af4d8f88edc8fadaf4de75d44e7 Mon Sep 17 00:00:00 2001
From: Marcus Hoffmann <bubu@bubu1.eu>
Date: Mon, 24 Feb 2020 16:44:44 +0100
Subject: [PATCH] ignore xml icons

They will never work, they should not be set by fdroidserver but we can
be defensive about not returning them to any views here.
---
 app/src/main/java/org/fdroid/fdroid/data/App.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/app/src/main/java/org/fdroid/fdroid/data/App.java b/app/src/main/java/org/fdroid/fdroid/data/App.java
index 130267336..77bf4560b 100644
--- a/app/src/main/java/org/fdroid/fdroid/data/App.java
+++ b/app/src/main/java/org/fdroid/fdroid/data/App.java
@@ -670,6 +670,11 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
             if (TextUtils.isEmpty(iconFromApk)){
                 return null;
             }
+            if (iconFromApk.endsWith(".xml")){
+                // We cannot use xml ressources as icons. F-Droid server should not include them
+                // https://gitlab.com/fdroid/fdroidserver/issues/344
+                return null;
+            }
             String iconsDir;
             if (repo.version >= Repo.VERSION_DENSITY_SPECIFIC_ICONS) {
                 iconsDir = Utils.getIconsDir(context, 1.0);