mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 16:32:39 +00:00
more google play changes
This commit is contained in:
4 files changed
+14
-4
No files matched your search
@@ -60,6 +60,7 @@ android {
|
|||||||
|
|
||||||
create("googlePlay") {
|
create("googlePlay") {
|
||||||
dimension = "distribution"
|
dimension = "distribution"
|
||||||
|
applicationId = "com.geode.launcher.play"
|
||||||
buildConfigField("boolean", "GOOGLE_PLAY_BUILD", "true")
|
buildConfigField("boolean", "GOOGLE_PLAY_BUILD", "true")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,7 +238,7 @@
|
|||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name=".UserDirectoryProvider"
|
android:name=".UserDirectoryProvider"
|
||||||
android:authorities="com.geode.launcher.user"
|
android:authorities="${applicationId}.user"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:grantUriPermissions="true"
|
android:grantUriPermissions="true"
|
||||||
android:permission="android.permission.MANAGE_DOCUMENTS">
|
android:permission="android.permission.MANAGE_DOCUMENTS">
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
</provider>
|
</provider>
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="com.geode.launcher.fileprovider"
|
android:authorities="${applicationId}.fileprovider"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:grantUriPermissions="true">
|
android:grantUriPermissions="true">
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|||||||
@@ -215,7 +215,11 @@ object GeodeUtils {
|
|||||||
val relativePath = pathFile.relativeTo(baseDirectory)
|
val relativePath = pathFile.relativeTo(baseDirectory)
|
||||||
val uri = DocumentsContract.buildDocumentUri(
|
val uri = DocumentsContract.buildDocumentUri(
|
||||||
"com.android.externalstorage.documents",
|
"com.android.externalstorage.documents",
|
||||||
|
if (BuildConfig.GOOGLE_PLAY_BUILD) {
|
||||||
|
"primary:Android/data/${context.packageName}/$relativePath"
|
||||||
|
} else {
|
||||||
"primary:Android/media/${context.packageName}/$relativePath"
|
"primary:Android/media/${context.packageName}/$relativePath"
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Intent(Intent.ACTION_VIEW).apply {
|
Intent(Intent.ACTION_VIEW).apply {
|
||||||
@@ -409,7 +413,7 @@ object GeodeUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun isGeodeUri(uri: Uri): Boolean {
|
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"
|
private const val INTERNAL_PERMISSION_PREFIX = "geode.permission_internal"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.geode.launcher.utils
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import com.geode.launcher.BuildConfig
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
@@ -48,10 +49,14 @@ object LaunchUtils {
|
|||||||
* Returns the directory that Geode/the game should base itself off of.
|
* Returns the directory that Geode/the game should base itself off of.
|
||||||
*/
|
*/
|
||||||
fun getBaseDirectory(context: Context, ignoreProfile: Boolean = false): File {
|
fun getBaseDirectory(context: Context, ignoreProfile: Boolean = false): File {
|
||||||
|
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)
|
// 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
|
// also, is getting the first item the correct choice here?? what do they mean
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
val dir = context.externalMediaDirs.first()
|
context.externalMediaDirs.first()
|
||||||
|
}
|
||||||
|
|
||||||
// prevent having resources added to system gallery
|
// prevent having resources added to system gallery
|
||||||
// accessing this file every time the directory is read may be a little wasteful...
|
// accessing this file every time the directory is read may be a little wasteful...
|
||||||
|
|||||||
Reference in new issue
Block a user