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 { *; }