a revelation

This commit is contained in:
Anuken 2020-01-11 23:41:12 -05:00
commit bbf87df373
19 changed files with 355 additions and 280 deletions

View file

@ -146,6 +146,30 @@ public class AndroidLauncher extends AndroidApplication{
hideStatusBar = true;
}});
checkFiles(getIntent());
//new external folder
Fi data = Core.files.absolute(getContext().getExternalFilesDir(null).getAbsolutePath());
//moved to internal storage if there's no file indicating that it moved
if(!Core.files.local("files_moved").exists()){
Log.info("Moving files to external storage...");
try{
//current local storage folder
Fi src = Core.files.absolute(Core.files.getLocalStoragePath());
for(Fi fi : src.list()){
fi.copyTo(data.child(fi.name()));
}
//create marker
Core.files.local("files_moved").writeString("files moved to " + data);
Log.info("Files moved.");
}catch(Throwable t){
Log.err("Failed to move files!");
t.printStackTrace();
}
}else{
Core.settings.setDataDirectory(data);
}
}
@Override