From 068be1ddb2418d4dffedd82a02210bc6c925ed05 Mon Sep 17 00:00:00 2001 From: unam98 Date: Sat, 4 Apr 2026 13:47:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20R8=20=EB=82=9C=EB=8F=85=ED=99=94=20?= =?UTF-8?q?=EB=B0=8F=20=EB=A6=AC=EC=86=8C=EC=8A=A4=20=EC=B6=95=EC=86=8C=20?= =?UTF-8?q?=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 릴리즈 빌드에 minifyEnabled true, shrinkResources true 적용. 공식 문서 기반 ProGuard rules 작성 (Firebase Crashlytics, Kakao SDK, Gson). AAB 용량 54MB → 46.8MB (14% 감소). --- app/build.gradle | 3 ++- app/proguard-rules.pro | 45 +++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 30cca0cc7..4823fa700 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -63,7 +63,8 @@ android { buildTypes { release { - minifyEnabled false + minifyEnabled true + shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 39325c2f5..3bb52eeb9 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,25 +1,26 @@ -# 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 +# =========================== +# Runnect ProGuard/R8 Rules +# =========================== +# 각 라이브러리의 공식 문서 또는 공식 저장소에 근거한 규칙만 포함합니다. +# consumer rules로 자동 적용되는 라이브러리는 별도 규칙을 추가하지 않습니다. +# (Retrofit, OkHttp, Kotlin Serialization, Glide, Naver Map SDK, DataBinding, Hilt) -# 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 *; -#} +# --- Firebase Crashlytics --- +# 난독화된 스택 트레이스를 읽을 수 있도록 소스 파일명/라인 번호 유지 +# 공식 문서: https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=android +-keepattributes SourceFile,LineNumberTable +-keep public class * extends java.lang.Exception +-renamesourcefileattribute SourceFile -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - -# https://developers.kakao.com/docs/latest/en/getting-started/sdk-android#configure-for-shrinking-and-obfuscation-(optional) +# --- Kakao SDK --- +# 공식 문서: https://developers.kakao.com/docs/latest/en/android/getting-started#configure-for-shrinking-and-obfuscation-(optional) -keep class com.kakao.sdk.**.model.* { ; } --keep class * extends com.google.gson.TypeAdapter \ No newline at end of file + +# --- Gson --- +# Gson 2.13.x JAR에 consumer rules가 포함되어 있지 않으므로 수동 추가 필요 +# 공식 규칙 파일: https://github.com/google/gson/blob/main/gson/src/main/resources/META-INF/proguard/gson.pro +# 공식 트러블슈팅: https://github.com/google/gson/blob/main/Troubleshooting.md#r8-agp +-keep class * extends com.google.gson.TypeAdapter +-keepclassmembers,allowobfuscation class * { + @com.google.gson.annotations.SerializedName ; +} From adc6078ed1e3fe193922c54fae52e29a01d5ad0d Mon Sep 17 00:00:00 2001 From: unam98 Date: Sat, 4 Apr 2026 14:06:45 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=A4=91=EB=B3=B5=20Gson=20ProGuard?= =?UTF-8?q?=20=EA=B7=9C=EC=B9=99=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20rename?= =?UTF-8?q?sourcefileattribute=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Gson 2.13.2 JAR에 consumer rules(gson.pro)가 포함되어 있으므로 수동 규칙 제거 - -renamesourcefileattribute는 Firebase 공식 문서 근거가 아니므로 제거 --- app/proguard-rules.pro | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 3bb52eeb9..63fa64238 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -3,24 +3,14 @@ # =========================== # 각 라이브러리의 공식 문서 또는 공식 저장소에 근거한 규칙만 포함합니다. # consumer rules로 자동 적용되는 라이브러리는 별도 규칙을 추가하지 않습니다. -# (Retrofit, OkHttp, Kotlin Serialization, Glide, Naver Map SDK, DataBinding, Hilt) +# (Retrofit, OkHttp, Kotlin Serialization, Glide, Naver Map SDK, DataBinding, Hilt, Gson) # --- Firebase Crashlytics --- # 난독화된 스택 트레이스를 읽을 수 있도록 소스 파일명/라인 번호 유지 # 공식 문서: https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=android -keepattributes SourceFile,LineNumberTable -keep public class * extends java.lang.Exception --renamesourcefileattribute SourceFile # --- Kakao SDK --- # 공식 문서: https://developers.kakao.com/docs/latest/en/android/getting-started#configure-for-shrinking-and-obfuscation-(optional) -keep class com.kakao.sdk.**.model.* { ; } - -# --- Gson --- -# Gson 2.13.x JAR에 consumer rules가 포함되어 있지 않으므로 수동 추가 필요 -# 공식 규칙 파일: https://github.com/google/gson/blob/main/gson/src/main/resources/META-INF/proguard/gson.pro -# 공식 트러블슈팅: https://github.com/google/gson/blob/main/Troubleshooting.md#r8-agp --keep class * extends com.google.gson.TypeAdapter --keepclassmembers,allowobfuscation class * { - @com.google.gson.annotations.SerializedName ; -}