Skip to content

Commit

Permalink
switch base directory to media directory
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Jan 16, 2024
1 parent e7ebea1 commit 6168fa4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/src/main/java/com/geode/launcher/utils/LaunchUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,17 @@ object LaunchUtils {
* Returns the directory that Geode/the game should base itself off of.
*/
fun getBaseDirectory(context: Context): File {
return context.getExternalFilesDir("")!!
// deprecated, but seems to be the best choice of directory (i forced mat to test it)
// also, is getting the first item the correct choice here?? what do they mean
@Suppress("DEPRECATION")
val dir = context.externalMediaDirs.first()

// prevent having resources added to system gallery
// accessing this file every time the directory is read may be a little wasteful...
val noMediaPath = File(dir, ".nomedia")
noMediaPath.createNewFile()

return dir
}

fun getSaveDirectory(context: Context): File {
Expand Down

0 comments on commit 6168fa4

Please sign in to comment.