more google play changes

This commit is contained in:
prevter committed 2026-07-01 11:46:54 +03:00
1 parent 0dba4f0606
commit 72f74fa084
4 files changed
+18 -8

No files matched your search

+1
View File
@@ -60,6 +60,7 @@ android {
create("googlePlay") {
dimension = "distribution"
applicationId = "com.geode.launcher.play"
buildConfigField("boolean", "GOOGLE_PLAY_BUILD", "true")
}
}
+2 -2
View File
@@ -238,7 +238,7 @@
<provider
android:name=".UserDirectoryProvider"
android:authorities="com.geode.launcher.user"
android:authorities="${applicationId}.user"
android:exported="true"
android:grantUriPermissions="true"
android:permission="android.permission.MANAGE_DOCUMENTS">
@@ -248,7 +248,7 @@
</provider>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.geode.launcher.fileprovider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
@@ -215,7 +215,11 @@ object GeodeUtils {
val relativePath = pathFile.relativeTo(baseDirectory)
val uri = DocumentsContract.buildDocumentUri(
"com.android.externalstorage.documents",
"primary:Android/media/${context.packageName}/$relativePath"
if (BuildConfig.GOOGLE_PLAY_BUILD) {
"primary:Android/data/${context.packageName}/$relativePath"
} else {
"primary:Android/media/${context.packageName}/$relativePath"
}
)
Intent(Intent.ACTION_VIEW).apply {
@@ -409,7 +413,7 @@ object GeodeUtils {
}
fun isGeodeUri(uri: Uri): Boolean {
return "com.geode.launcher.user" == uri.authority
return "${BuildConfig.APPLICATION_ID}.user" == uri.authority
}
private const val INTERNAL_PERMISSION_PREFIX = "geode.permission_internal"
@@ -2,6 +2,7 @@ package com.geode.launcher.utils
import android.content.Context
import android.os.Build
import com.geode.launcher.BuildConfig
import java.io.File
import java.io.Serializable
@@ -48,10 +49,14 @@ object LaunchUtils {
* Returns the directory that Geode/the game should base itself off of.
*/
fun getBaseDirectory(context: Context, ignoreProfile: Boolean = false): File {
// 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()
val dir = if (BuildConfig.GOOGLE_PLAY_BUILD) {
context.getExternalFilesDir(null)!!.parentFile!!
} else {
// 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")
context.externalMediaDirs.first()
}
// prevent having resources added to system gallery
// accessing this file every time the directory is read may be a little wasteful...