Skip to content

Commit

Permalink
fix: android support more sd path
Browse files Browse the repository at this point in the history
  • Loading branch information
zeromake committed May 22, 2024
1 parent 8ce7689 commit 2195863
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.zeromake.onscripter;

public class Globals {
public static String CurrentDirectoryPathForLauncher = null;
public static String CurrentDirectoryPath = null;
public static String[] CurrentDirectoryPathArray = null;
public static String[] CurrentDirectoryValidPathArray = null;
public static final String[] CURRENT_DIRECTORY_PATH_TEMPLATE_ARRAY = new String[]{"${SDCARD}/mine", "${SDCARD}/ons"};
public static boolean CurrentGameRunning = false;
}
package com.zeromake.onscripter;

public class Globals {
public static String CurrentDirectoryPathForLauncher = null;
public static String CurrentDirectoryPath = null;
public static String[] CurrentDirectoryPathArray = null;
public static String[] CurrentDirectoryValidPathArray = null;
public static final String[] CURRENT_DIRECTORY_PATH_TEMPLATE_ARRAY = new String[]{"${SDCARD}/mine", "${SDCARD}/ons"};
public static boolean CurrentGameRunning = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,12 @@ public void onClick(DialogInterface dialogInterface, int i) {
loadCurrentDirectory();
return;
} else if (Globals.CurrentDirectoryPathForLauncher == null || Globals.CurrentDirectoryPathForLauncher.equals("")) {
this.mDirBrowserCurDirPath = "/mnt";
File f = new File("/storage");
if (f.exists() && f.isDirectory() && f.canRead()) {
this.mDirBrowserCurDirPath = "/storage";
} else {
this.mDirBrowserCurDirPath = "/mnt";
}
} else {
this.mDirBrowserCurDirPath = Globals.CurrentDirectoryPathForLauncher;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ private static void setupCurrentDirectory() {
treeSet.add(str.replace("${SDCARD}", "/sdcard"));
treeSet.add(str.replace("${SDCARD}", "/sdcard/sd"));
treeSet.add(str.replace("${SDCARD}", "/storage/sdcard"));
treeSet.add(str.replace("${SDCARD}", "/storage/sdcard0"));
treeSet.add(str.replace("${SDCARD}", "/storage/sdcard1"));
treeSet.add(str.replace("${SDCARD}", "/storage/emulated/0"));
treeSet.add(str.replace("${SDCARD}", "/storage/emulated/legacy"));
treeSet.add(str.replace("${SDCARD}", "/storage/usb0"));
String str2 = System.getenv("EXTERNAL_STORAGE");
if (str2 != null) {
treeSet.add(str.replace("${SDCARD}", str2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 2;
private static final int SDL_MINOR_VERSION = 30;
private static final int SDL_MICRO_VERSION = 2;
private static final int SDL_MICRO_VERSION = 3;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
Expand Down
7 changes: 6 additions & 1 deletion project/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache=true

# systemProp.http.proxyHost=127.0.0.1
# systemProp.http.proxyPort=10808
# systemProp.https.proxyHost=127.0.0.1
# systemProp.https.proxyPort=10808
38 changes: 19 additions & 19 deletions project/android/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "onscripter"
rootProject.buildFileName = "build.gradle.kts"

include(":app")
include(":XXPermissions")
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "onscripter"
rootProject.buildFileName = "build.gradle.kts"

include(":app")
include(":XXPermissions")

0 comments on commit 2195863

Please sign in to comment.