From 36d04f5c87032c961a45e9b24c2c0cc1de4e8c90 Mon Sep 17 00:00:00 2001 From: rasputin Date: Mon, 8 Jun 2026 23:05:04 +0200 Subject: [PATCH] fix: production build config --- app/build.gradle.kts | 18 +++++++++++++++++- app/proguard-rules.pro | 5 ++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6bc7742..152e1dc 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,4 +1,9 @@ import com.google.protobuf.gradle.* +import java.util.Properties + +val localProps = Properties().apply { + load(rootProject.file("local.properties").inputStream()) +} configurations.all { resolutionStrategy { @@ -36,13 +41,24 @@ android { testBuildType = "benchmark" + signingConfigs { + create("release") { + storeFile = file(localProps["KEYSTORE_PATH"] as String) + storePassword = localProps["KEYSTORE_PASSWORD"] as String + keyAlias = localProps["KEY_ALIAS"] as String + keyPassword = localProps["KEY_PASSWORD"] as String + } + } + buildTypes { release { - isMinifyEnabled = false + // isMinifyEnabled = true // Enables R8/ProGuard shrinking + // isShrinkResources = true // Removes unused resources proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) + signingConfig = signingConfigs.getByName("release") } create("benchmark") { initWith(buildTypes.getByName("release")) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb43..4d11340 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -18,4 +18,7 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# Keep all protobuf generated message classes and their fields +-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }