diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6e2bd0c0..07a3b8b6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -72,7 +72,8 @@ android { ?: System.getenv("BITNAGIL_PROD_URL") ?: throw GradleException("bitnagil.prod.url 값이 없습니다.") buildConfigField("String", "BASE_URL", "\"$prodUrl\"") - isMinifyEnabled = false + isMinifyEnabled = true + isShrinkResources = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro", diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb434..da8d68a4 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,21 +1,45 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html +-keepattributes SourceFile,LineNumberTable +-renamesourcefileattribute SourceFile -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} +# [Kakao SDK 버그 방어] +# AccessTokenInterceptor에서 ClientErrorCause 상수를 리플렉션(getField)으로 찾기 때문에 난독화에서 제외함 +-keep enum com.kakao.sdk.common.model.ClientErrorCause { + *; +} -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable +# [Kotlinx Serialization] +# 모든 @Serializable 클래스의 직렬화 로직 및 serializer 메서드 유지 +-keepattributes Annotation, InnerClasses, Signature, Exceptions +-keepclassmembers class * { + @kotlinx.serialization.Serializable *; +} +-keepclassmembers class * { + kotlinx.serialization.KSerializer serializer(...); +} -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +# [Domain/Data Layer Enums] +# API 응답 매핑 및 리플렉션 방어를 위해 Enum 상수 이름 유지 +-keepclassmembers enum com.threegap.bitnagil.domain.**.model.** { + ; +} +-keepclassmembers enum com.threegap.bitnagil.data.**.model.** { + ; +} + +# [Compose Navigation Type-Safe Arguments] +# 네비게이션 인자 클래스 및 Route 객체 보존 +-keep class com.threegap.bitnagil.presentation.**.model.navarg.** { *; } +-keep class com.threegap.bitnagil.Route** { *; } +# HomeRoute는 navigation.home 패키지로 Route** 패턴 밖이므로 별도 보호 +# Compose Navigation이 내부적으로 serializer descriptor name을 route ID로 사용하므로 +# deep link 추가 시 repackaging으로 빌드마다 route string이 달라지는 문제 방어 +-keep class com.threegap.bitnagil.navigation.home.HomeRoute** { *; } + +# [Kotlin Result - Retrofit 반환 타입] +# suspend fun foo(): Result 형태의 Retrofit 인터페이스에서 +# R8이 kotlin.Result의 제네릭 타입 인자를 지워 call adapter 탐색 실패 방어 +-keep class kotlin.Result { *; } + +# [Network Libraries] +# Retrofit 및 OkHttp 어노테이션 유지 +-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations diff --git a/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/font/Font.kt b/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/font/Font.kt index f4b346f1..2a6629db 100644 --- a/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/font/Font.kt +++ b/core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/font/Font.kt @@ -1,23 +1,36 @@ package com.threegap.bitnagil.designsystem.font +import androidx.compose.ui.text.ExperimentalTextApi import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.text.font.FontVariation import androidx.compose.ui.text.font.FontWeight import com.threegap.bitnagil.designsystem.R +@OptIn(ExperimentalTextApi::class) val pretendard = FontFamily( - Font(R.font.pretendard_black, FontWeight.Black, FontStyle.Normal), - Font(R.font.pretendard_extra_bold, FontWeight.ExtraBold, FontStyle.Normal), - Font(R.font.pretendard_bold, FontWeight.Bold, FontStyle.Normal), - Font(R.font.pretendard_semi_bold, FontWeight.SemiBold, FontStyle.Normal), - Font(R.font.pretendard_medium, FontWeight.Medium, FontStyle.Normal), - Font(R.font.pretendard_regular, FontWeight.Normal, FontStyle.Normal), - Font(R.font.pretendard_light, FontWeight.Light, FontStyle.Normal), - Font(R.font.pretendard_extra_light, FontWeight.ExtraLight, FontStyle.Normal), - Font(R.font.pretendard_thin, FontWeight.Thin, FontStyle.Normal), + Font( + resId = R.font.pretendard_variable, + weight = FontWeight.Bold, + variationSettings = FontVariation.Settings(FontVariation.weight(700)), + ), + Font( + resId = R.font.pretendard_variable, + weight = FontWeight.SemiBold, + variationSettings = FontVariation.Settings(FontVariation.weight(600)), + ), + Font( + resId = R.font.pretendard_variable, + weight = FontWeight.Medium, + variationSettings = FontVariation.Settings(FontVariation.weight(500)), + ), + Font( + resId = R.font.pretendard_variable, + weight = FontWeight.Normal, + variationSettings = FontVariation.Settings(FontVariation.weight(400)), + ), ) val cafe24SsurroundAir = FontFamily( - Font(R.font.cafe_24_ssurround_air_v1_1, FontWeight.Light, FontStyle.Normal), + Font(R.font.cafe_24_ssurround_air_v1_1, FontWeight.Light), ) diff --git a/core/designsystem/src/main/res/font/pretendard_black.otf b/core/designsystem/src/main/res/font/pretendard_black.otf deleted file mode 100644 index a0d849e7..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_black.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_bold.otf b/core/designsystem/src/main/res/font/pretendard_bold.otf deleted file mode 100644 index 8e5e30a2..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_bold.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_extra_bold.otf b/core/designsystem/src/main/res/font/pretendard_extra_bold.otf deleted file mode 100644 index 388f3ca4..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_extra_bold.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_extra_light.otf b/core/designsystem/src/main/res/font/pretendard_extra_light.otf deleted file mode 100644 index 40c8b69c..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_extra_light.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_light.otf b/core/designsystem/src/main/res/font/pretendard_light.otf deleted file mode 100644 index 228679e9..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_light.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_medium.otf b/core/designsystem/src/main/res/font/pretendard_medium.otf deleted file mode 100644 index 05750698..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_medium.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_regular.otf b/core/designsystem/src/main/res/font/pretendard_regular.otf deleted file mode 100644 index 08bf4cfc..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_regular.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_semi_bold.otf b/core/designsystem/src/main/res/font/pretendard_semi_bold.otf deleted file mode 100644 index e7e36abc..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_semi_bold.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_thin.otf b/core/designsystem/src/main/res/font/pretendard_thin.otf deleted file mode 100644 index 77e792d7..00000000 Binary files a/core/designsystem/src/main/res/font/pretendard_thin.otf and /dev/null differ diff --git a/core/designsystem/src/main/res/font/pretendard_variable.ttf b/core/designsystem/src/main/res/font/pretendard_variable.ttf new file mode 100644 index 00000000..32b0811e Binary files /dev/null and b/core/designsystem/src/main/res/font/pretendard_variable.ttf differ diff --git a/core/network/consumer-rules.pro b/core/network/consumer-rules.pro index e69de29b..0d4d75f5 100644 --- a/core/network/consumer-rules.pro +++ b/core/network/consumer-rules.pro @@ -0,0 +1,4 @@ +# [ResultCallAdapter] +# Retrofit Call Adapter 팩토리 및 네트워크 모델 보존 +-keep class com.threegap.bitnagil.network.calladapter.** { *; } +-keep class com.threegap.bitnagil.network.model.** { *; } diff --git a/data/consumer-rules.pro b/data/consumer-rules.pro index e69de29b..4ffce34e 100644 --- a/data/consumer-rules.pro +++ b/data/consumer-rules.pro @@ -0,0 +1,4 @@ +# [Retrofit Service Interfaces] +# R8이 제네릭 시그니처를 제거하면 ResultCallAdapterFactory가 Call>의 +# 타입 인자를 런타임에 읽지 못해 "Unable to create call adapter" 에러 발생 +-keep interface com.threegap.bitnagil.data.**.service.** { *; }