From 39ca549e7c82e6082c6953412fd71592d94613f3 Mon Sep 17 00:00:00 2001 From: Heon Date: Fri, 9 Feb 2024 21:12:33 +0900 Subject: [PATCH] =?UTF-8?q?release-1.0.0=20chore:=20=EC=8B=A4=EB=B0=B0?= =?UTF-8?q?=ED=8F=AC=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ app/build.gradle.kts | 32 +++++++++++++++--- app/proguard-rules.pro | 18 +++++++++- app/src/live/google-services.json | 48 +++++++++++++++++++++++++++ app/{ => src/tb}/google-services.json | 0 core/network/build.gradle.kts | 9 +++++ 6 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 app/src/live/google-services.json rename app/{ => src/tb}/google-services.json (100%) diff --git a/.gitignore b/.gitignore index aa724b77..8b0e0770 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.iml .gradle /local.properties +/keystore.properties /.idea/caches /.idea/libraries /.idea/modules.xml @@ -13,3 +14,4 @@ .externalNativeBuild .cxx local.properties +keystore.properties \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7dc3b4f7..c95f559b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,4 +1,6 @@ import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties +import java.io.FileInputStream +import java.util.Properties @Suppress("DSL_SCOPE_VIOLATION") plugins { @@ -11,11 +13,16 @@ plugins { } -fun getApiKey(propertyKey : String): String { - return gradleLocalProperties(rootDir).getProperty(propertyKey) -} - android { + signingConfigs { + create("release") { + storeFile = + file(getKeyStore("storeFile")) + storePassword = getKeyStore("storePassword") + keyAlias = getKeyStore("keyAlias") + keyPassword = getKeyStore("keyPassword") + } + } namespace = "com.moneymong.moneymong" compileSdk = 34 @@ -43,6 +50,7 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) + signingConfig = signingConfigs.getByName("release") } } packaging { @@ -84,4 +92,20 @@ dependencies { testImplementation(libs.junit4) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.test.espresso.core) +} + +fun keystoreProperties(projectRootDir : File) : Properties { + val keystorePropertiesFile = rootProject.file("keystore.properties") + val keystoreProperties = Properties() + keystoreProperties.load(FileInputStream(keystorePropertiesFile)) + + return keystoreProperties +} + +fun getApiKey(propertyKey : String): String { + return gradleLocalProperties(rootDir).getProperty(propertyKey) +} + +fun getKeyStore(keystoreKey : String): String { + return keystoreProperties(rootDir).getProperty(keystoreKey) } \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 402e961c..de6d5853 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -26,4 +26,20 @@ # https://github.com/square/okhttp/pull/6792 -dontwarn org.bouncycastle.jsse.** -dontwarn org.conscrypt.* --dontwarn org.openjsse.** \ No newline at end of file +-dontwarn org.openjsse.** + +# With R8 full mode generic signatures are stripped for classes that are not +# kept. Suspend functions are wrapped in continuations where the type argument +# is used. + -keep,allowobfuscation,allowshrinking interface retrofit2.Call + -keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation + +# Kotlin Result Wrapper 예외 + -keep class kotlin.Result { *; } + +# R8 full mode strips generic signatures from return types if not kept. +-if interface * { @retrofit2.http.* public *** *(...); } +-keep,allowoptimization,allowshrinking,allowobfuscation class <3> + +# With R8 full mode generic signatures are stripped for classes that are not kept. +-keep,allowobfuscation,allowshrinking class retrofit2.Response \ No newline at end of file diff --git a/app/src/live/google-services.json b/app/src/live/google-services.json new file mode 100644 index 00000000..10028522 --- /dev/null +++ b/app/src/live/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "1091533625653", + "project_id": "moneymong-9e794", + "storage_bucket": "moneymong-9e794.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1091533625653:android:f8c3edecf6f6108fad547c", + "android_client_info": { + "package_name": "com.moneymong.moneymong.live" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAb9dOMs-B-u9YynEWdtV9nrq_VbMpAXtg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:1091533625653:android:435637da7f3d4352ad547c", + "android_client_info": { + "package_name": "com.moneymong.moneymong.tb" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyAb9dOMs-B-u9YynEWdtV9nrq_VbMpAXtg" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/google-services.json b/app/src/tb/google-services.json similarity index 100% rename from app/google-services.json rename to app/src/tb/google-services.json diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index 6bd8a042..4973c2b7 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -22,6 +22,15 @@ android { buildConfigField("String", "MONEYMONG_BASE_URL", "\"https://dev.moneymong.site/\"") } + buildTypes { + debug { + buildConfigField("String", "MONEYMONG_BASE_URL", "\"https://dev.moneymong.site/\"") + } + release { + buildConfigField("String", "MONEYMONG_BASE_URL", "\"https://moneymong.site/\"") + } + } + buildFeatures { buildConfig = true }