From 9a48182f8b1d4324045fa19c4fdd5ee8097d103d Mon Sep 17 00:00:00 2001 From: Ratchanan Srirattanamet Date: Sat, 17 Feb 2024 20:10:20 +0000 Subject: [PATCH] Allow installing debug-built app alongside release one This makes the life easier for the people that already have the app from e.g. Play Store installed. --- app/build.gradle | 10 ++++++++++ app/src/main/AndroidManifest.xml | 9 +++++++-- .../java/org/xbmc/kore/provider/MediaContract.java | 4 +++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f1e9ed2c1..81ca3a8c4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,6 +26,10 @@ android { "ko", "lt", "nl", "pl", "pt", "pt-BR", "ru", "sk", "sl", "zh-CN"] buildConfigField "String[]", "SUPPORTED_LOCALES", "new String[]{\""+ supportedLocales.join("\",\"")+"\"}" + + // Allow distinguishing between release and debug app when installed + // simultaneously (see below). + manifestPlaceholders = [appLabel: "@string/app_name"] } signingConfigs { @@ -58,6 +62,12 @@ android { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } + + debug { + // Allow installing debug version in parallel. + applicationIdSuffix ".debug" + manifestPlaceholders = [appLabel: "Kore (Debug)"] + } } buildFeatures { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3eaaefdbb..c622af012 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -26,10 +26,11 @@ + @@ -184,9 +185,13 @@ + diff --git a/app/src/main/java/org/xbmc/kore/provider/MediaContract.java b/app/src/main/java/org/xbmc/kore/provider/MediaContract.java index 915ffcd73..f286e9d43 100644 --- a/app/src/main/java/org/xbmc/kore/provider/MediaContract.java +++ b/app/src/main/java/org/xbmc/kore/provider/MediaContract.java @@ -18,12 +18,14 @@ import android.net.Uri; import android.provider.BaseColumns; +import org.xbmc.kore.BuildConfig; + /** * Contract class for interacting with {@link MediaProvider}. */ public class MediaContract { - public static final String CONTENT_AUTHORITY = "org.xbmc.kore.provider"; + public static final String CONTENT_AUTHORITY = BuildConfig.APPLICATION_ID + ".provider"; public static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY);