1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #3101 from IvanSavenko/fix_android_data_import

Fix data import on Android
This commit is contained in:
Ivan Savenko
2023-10-29 13:46:48 +02:00
committed by GitHub
2 changed files with 17 additions and 3 deletions

View File

@@ -22,7 +22,9 @@ public class Storage
public static boolean testH3DataFolder(final File baseDir)
{
final File testH3Data = new File(baseDir, "Data");
return testH3Data.exists();
final File testH3data = new File(baseDir, "data");
final File testH3DATA = new File(baseDir, "DATA");
return testH3Data.exists() || testH3data.exists() || testH3DATA.exists();
}
public static String getH3DataFolder(Context context){

View File

@@ -127,9 +127,21 @@ public class CopyDataController extends LauncherSettingController<Void, Void>
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());