From 91e202e0e34d780dc5dd8356d1e5366bf7bd7d96 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Mon, 23 Oct 2023 19:10:24 +0300 Subject: [PATCH] Ignore case when checking whether path is white-listed. Fixes data import with H3 data that has different case in directory names --- .../vcmi/vcmi/settings/CopyDataController.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/android/vcmi-app/src/main/java/eu/vcmi/vcmi/settings/CopyDataController.java b/android/vcmi-app/src/main/java/eu/vcmi/vcmi/settings/CopyDataController.java index 9acf5e0a2..9b39f6e78 100644 --- a/android/vcmi-app/src/main/java/eu/vcmi/vcmi/settings/CopyDataController.java +++ b/android/vcmi-app/src/main/java/eu/vcmi/vcmi/settings/CopyDataController.java @@ -127,9 +127,21 @@ public class CopyDataController extends LauncherSettingController for (DocumentFile child : sourceDir.listFiles()) { - if (allowed != null && !allowed.contains(child.getName())) + if (allowed != null) { - continue; + boolean fileAllowed = false; + + for (String str : allowed) + { + if (str.equalsIgnoreCase(child.getName())) + { + fileAllowed = true; + break; + } + } + + if (fileAllowed) + continue; } File exported = new File(targetDir, child.getName());