diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f982505..fd08d2f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,3 @@ -import com.android.build.gradle.internal.dsl.SigningConfig - plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -14,11 +12,17 @@ android { compileSdk = 33 signingConfigs { + getByName("debug") { + storeFile = file("../debug.keystore") + storePassword = "123456" + keyAlias = "debug" + keyPassword = "123456" + } create("pixelized") { - storeFile = file(project.properties["PIXELIZED_RELEASE_STORE_FILE"] as String) - storePassword = project.properties["PIXELIZED_RELEASE_STORE_PASSWORD"] as String - keyAlias = project.properties["PIXELIZED_RELEASE_KEY_ALIAS"] as String - keyPassword = project.properties["PIXELIZED_RELEASE_KEY_PASSWORD"] as String + storeFile = (project.properties["PIXELIZED_RELEASE_STORE_FILE"] as? String)?.let { file(it) } + storePassword = project.properties["PIXELIZED_RELEASE_STORE_PASSWORD"] as? String + keyAlias = project.properties["PIXELIZED_RELEASE_KEY_ALIAS"] as? String + keyPassword = project.properties["PIXELIZED_RELEASE_KEY_PASSWORD"] as? String } } @@ -36,19 +40,19 @@ android { } buildTypes { - release { - isDebuggable = false - isMinifyEnabled = true - signingConfig = signingConfigs.pixelized - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" - ) - } debug { applicationIdSuffix = ".dev" isDebuggable = true isMinifyEnabled = false - signingConfig = signingConfigs.pixelized + signingConfig = signingConfigs.getByName("debug") + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" + ) + } + release { + isDebuggable = false + isMinifyEnabled = true + signingConfig = signingConfigs.getByName("pixelized") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) @@ -126,13 +130,12 @@ dependencies { kapt("com.github.bumptech.glide:compiler:4.14.2") // this have to be align with landscapist-glide } -private val NamedDomainObjectContainer.pixelized get() = this.getByName("pixelized") - -val gitBuildNumber: Int get() { - val stdout = org.apache.commons.io.output.ByteArrayOutputStream() - rootProject.exec { - commandLine("git", "rev-list", "--count", "HEAD") - standardOutput = stdout - } - return stdout.toString().trim().toInt() -} \ No newline at end of file +val gitBuildNumber: Int + get() { + val stdout = org.apache.commons.io.output.ByteArrayOutputStream() + rootProject.exec { + commandLine("git", "rev-list", "--count", "HEAD") + standardOutput = stdout + } + return stdout.toString().trim().toInt() + } \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json index 585f264..df0d6b0 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -55,7 +55,7 @@ "client_type": 1, "android_info": { "package_name": "com.pixelized.rplexicon.dev", - "certificate_hash": "39ee1766d2225263052d4a4e82182d1c3e886f35" + "certificate_hash": "b5bd860f1f89de118613c3e94b3f6c8cbd6d876a" } }, { diff --git a/app/src/main/java/com/pixelized/rplexicon/ui/screens/authentication/AuthenticationScreen.kt b/app/src/main/java/com/pixelized/rplexicon/ui/screens/authentication/AuthenticationScreen.kt index 7051c88..df167fa 100644 --- a/app/src/main/java/com/pixelized/rplexicon/ui/screens/authentication/AuthenticationScreen.kt +++ b/app/src/main/java/com/pixelized/rplexicon/ui/screens/authentication/AuthenticationScreen.kt @@ -387,7 +387,7 @@ private fun AuthenticationScreenContentPreview() { modifier = Modifier .fillMaxSize() .padding(all = 16.dp), - version = VersionViewModel.Version(R.string.app_name, "0.0.0", "0"), + version = VersionViewModel.Version(R.string.app_name, "0.0.0", "0", true), onGoogleSignIn = { }, ) } diff --git a/app/src/main/java/com/pixelized/rplexicon/ui/screens/authentication/VersionViewModel.kt b/app/src/main/java/com/pixelized/rplexicon/ui/screens/authentication/VersionViewModel.kt index 92705d3..091f014 100644 --- a/app/src/main/java/com/pixelized/rplexicon/ui/screens/authentication/VersionViewModel.kt +++ b/app/src/main/java/com/pixelized/rplexicon/ui/screens/authentication/VersionViewModel.kt @@ -16,7 +16,8 @@ class VersionViewModel @Inject constructor() : ViewModel() { val version = Version( appName = R.string.app_name, version = BuildConfig.VERSION_NAME, - code = BuildConfig.VERSION_CODE.toString() + code = BuildConfig.VERSION_CODE.toString(), + debug = BuildConfig.DEBUG, ) @Stable @@ -24,11 +25,12 @@ class VersionViewModel @Inject constructor() : ViewModel() { @StringRes val appName: Int, val version: String, val code: String, + val debug: Boolean, ) { @Composable @Stable fun toText(): String { - return "${stringResource(id = appName)} ${version}.${code}" + return "${stringResource(id = appName)}${if (debug) "-dev" else ""} ${version}.${code}" } } } \ No newline at end of file diff --git a/debug.keystore b/debug.keystore new file mode 100644 index 0000000..03cdaab Binary files /dev/null and b/debug.keystore differ