Repository navigation
[GMSS-326]release 빌드에 R8 난독화 적용 - #76
Merged
Merged
Conversation
9 of 11 tasks
seunghee17
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
작업 개요
Play Console에서 "DEX 코드 최적화가 기준점 미만입니다. 난독화(3%)" 경고를 받았습니다. 난독화 비율이 25% 미만이면 앱 공개 상태와 게시 기능이 영향을 받을 수 있고, 해결 기한은 2027년 2월입니다.
release buildType이
isMinifyEnabled = false로 설정되어 있어 R8이 전혀 적용되지 않은 것이 원인이었습니다. release에 R8 축소와 난독화를 켜고, 실기기 검증 중 확인된 문제에 필요한 keep 규칙을 추가했습니다.작업 유형
변경 사항
app/build.gradle.kts: release에isMinifyEnabled,isShrinkResources,proguardFiles(proguard-android-optimize.txt, proguard-rules.pro)를 설정했습니다.app/proguard-rules.pro를 추가했습니다.SourceFile,LineNumberTable을 유지해 Crashlytics 스택트레이스를 mapping으로 복원할 수 있게 했습니다.-keep class * extends androidx.room.RoomDatabase { <init>(); }: WorkManager 2.9.1이 함께 가져오는 Room 2.5의 consumer rule은 생성자를 지정하지 않습니다. 그래서 R8 full mode에서WorkDatabase_Impl.<init>()이 제거되고, 앱 시작 시Failed to create an instance of class androidx.work.impl.WorkDatabase크래시가 났습니다. 앱 DB는 room3이라 이 규칙의 대상이 아닙니다.ai.onnxruntime.**,org.tensorflow.lite.**전체 keep: 두 라이브러리는 네이티브 코드가 JNI로 자바 클래스를 이름으로 찾습니다. onnxruntime-android에는 consumer rule이 없고 LiteRT는@UsedByReflection대상만 유지해서, 규칙이 없으면OrtException,OnnxJavaType,Tensor등의 이름이 바뀝니다.internalbuildType은initWith(release)라서 R8 축소가 함께 적용됩니다.isDebuggable = true라 R8이 DEBUG 모드로 동작해 이름 난독화는 대부분 적용되지 않습니다. 테스터 빌드를 배포본과 가깝게 유지하려고 그대로 두었습니다. Crashlytics mapping 업로드 태스크(uploadCrashlyticsMappingFileInternal)가 실행되는 것을 확인했습니다.관련 이슈
관련 작업 (Notion)
스크린샷 / 동작 화면
없음
난독화 비율 (로컬
:app:bundleRelease결과물의 mapping 기준)com.gamss) 클래스Play Console이 계산하는 단위는 공개되어 있지 않아 콘솔 수치와 같다고 보장할 수는 없습니다. 다만 어느 기준으로도 25%를 넘습니다. mapping은 AAB의
BUNDLE-METADATA/com.android.tools.build.obfuscation/proguard.map에 포함됩니다.실기기 검증 (SM-S937N, Android 16)
release와 같은 R8 조건(
isDebuggable = false)으로 만든 internal APK를 설치해 확인했습니다. Google 로그인을 위해 검증 빌드에서만 applicationId를.dev로 바꿨습니다.libLiteRt.so로드, Interpreter와 XNNPACK delegate 생성, 분류 결과로 카드 캐릭터 결정libonnxruntime4j_jni.so로드, 요약 결과로 카드 생성전 과정에서 크래시는 없었습니다.
체크리스트
develop으로 설정되어 있다feat:,fix:등)을 따른다리뷰 요청 사항
아래 경로는 R8 적용 상태로 확인하지 못했습니다. 머지 후 첫 release 빌드에서 확인이 필요합니다.
notification페이로드로 표시되는 알림. 서버가 아이콘이나 사운드를 리소스 이름으로 보내면shrinkResources로 제거될 수 있습니다. 서버 페이로드는 확인하지 못했습니다.assembleRelease assembleInternal)에서 R8이 두 번 실행되어 빌드 시간이 늘어납니다.