You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-30 18:30:54 +00:00
Fix storage scope for the obb directory
This commit is contained in:
@@ -77,6 +77,7 @@ internal enum class StorageScope {
|
||||
private val internalAppDir: String? = context.filesDir.canonicalPath
|
||||
private val internalCacheDir: String? = context.cacheDir.canonicalPath
|
||||
private val externalAppDir: String? = context.getExternalFilesDir(null)?.canonicalPath
|
||||
private val obbDir: String? = context.obbDir.canonicalPath
|
||||
private val sharedDir : String? = Environment.getExternalStorageDirectory().canonicalPath
|
||||
private val downloadsSharedDir: String? = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).canonicalPath
|
||||
private val documentsSharedDir: String? = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).canonicalPath
|
||||
@@ -140,6 +141,10 @@ internal enum class StorageScope {
|
||||
return APP
|
||||
}
|
||||
|
||||
if (obbDir != null && canonicalPathFile.startsWith(obbDir)) {
|
||||
return APP
|
||||
}
|
||||
|
||||
if (sharedDir != null && canonicalPathFile.startsWith(sharedDir)) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||
// Before R, apps had access to shared storage so long as they have the right
|
||||
|
||||
Reference in New Issue
Block a user