mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
[Android] don't load forge.profile.properties when the user is using the obb directory
- until google permits unrestricted access outside the app-specific directory on certain apps via flag, the option to use obb as entrypoint is required since accessing outside the scoped storage is really not recommended (https://issuetracker.google.com/issues?q=scoped%20storage%20slow).
This commit is contained in:
@@ -212,7 +212,7 @@ public final class ForgeConstants {
|
||||
public static final String DECK_BASE_DIR;
|
||||
public static final String DECK_CONSTRUCTED_DIR;
|
||||
static {
|
||||
ForgeProfileProperties.load();
|
||||
ForgeProfileProperties.load(GuiBase.isUsingAppDirectory());
|
||||
USER_DIR = ForgeProfileProperties.getUserDir();
|
||||
CACHE_DIR = ForgeProfileProperties.getCacheDir();
|
||||
CACHE_CARD_PICS_DIR = ForgeProfileProperties.getCardPicsDir();
|
||||
|
||||
@@ -57,11 +57,11 @@ public class ForgeProfileProperties {
|
||||
//prevent initializing static class
|
||||
}
|
||||
|
||||
public static void load() {
|
||||
public static void load(boolean isUsingAppDirectory) {
|
||||
final Properties props = new Properties();
|
||||
final File propFile = new File(ForgeConstants.PROFILE_FILE);
|
||||
try {
|
||||
if (propFile.canRead()) {
|
||||
if (propFile.canRead() && !isUsingAppDirectory) {
|
||||
props.load(new FileInputStream(propFile));
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user