1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +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
commit 18b8971d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) public static boolean testH3DataFolder(final File baseDir)
{ {
final File testH3Data = new File(baseDir, "Data"); 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){ public static String getH3DataFolder(Context context){

View File

@ -127,9 +127,21 @@ public class CopyDataController extends LauncherSettingController<Void, Void>
for (DocumentFile child : sourceDir.listFiles()) 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()); File exported = new File(targetDir, child.getName());