Skip to content

[Feat/#211] R8 난독화 및 코드 축소 도입#212

Open
wjdrjs00 wants to merge 2 commits intodevelopfrom
feat/#211-r8
Open

[Feat/#211] R8 난독화 및 코드 축소 도입#212
wjdrjs00 wants to merge 2 commits intodevelopfrom
feat/#211-r8

Conversation

@wjdrjs00
Copy link
Copy Markdown
Member

@wjdrjs00 wjdrjs00 commented Apr 2, 2026

[ PR Content ]

R8 난독화 및 코드 축소를 도입했습니다.

Related issue

Screenshot 📸

  • N/A

Work Description

  • app/build.gradle.kts: 릴리즈 빌드에 R8 활성화 (isMinifyEnabled = true, isShrinkResources = true)
  • app/proguard-rules.pro: 앱 레벨 keep 규칙 작성
  • 폰트: 개별 .otf 9종 → Pretendard Variable .ttf 단일 파일로 교체 (APK 크기 절감)

To Reviewers 📢

  • aab: 24.9MB -> 13.1MB / apk: 46.6MB -> 11.9MB
  • 궁금한 사항이 있다면 리뷰 남겨주십쇼~

Summary by CodeRabbit

릴리스 노트

  • 성능 최적화

    • 앱 크기 감소를 위해 코드 최소화 및 리소스 축소 기능 활성화
    • 폰트 시스템을 가변 폰트로 업그레이드하여 성능 개선
  • Chores

    • 빌드 구성 및 코드 보호 규칙 업데이트

@wjdrjs00 wjdrjs00 requested a review from l5x5l April 2, 2026 06:17
@wjdrjs00 wjdrjs00 self-assigned this Apr 2, 2026
@wjdrjs00 wjdrjs00 added ✨ Feature 새로운 기능 구현 🧤 대현 labels Apr 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Walkthrough

릴리즈 빌드에 R8 난독화 및 코드 축소를 활성화하고, Kakao SDK, kotlinx.serialization, Compose Navigation 등 필수 라이브러리를 보존하는 ProGuard/R8 규칙을 추가. 동시에 9개의 개별 폰트 파일을 단일 Variable 폰트로 최적화.

Changes

Cohort / File(s) Summary
Build Configuration
app/build.gradle.kts
Release 빌드에서 minification 활성화 (isMinifyEnabled = true) 및 리소스 축소 활성화 (isShrinkResources = true).
ProGuard/R8 Rules
app/proguard-rules.pro, core/network/consumer-rules.pro, data/consumer-rules.pro
Kakao SDK의 ClientErrorCause enum, kotlinx.serialization 메타데이터, Compose Navigation 타입, Retrofit 서비스 인터페이스, kotlin.Result, 네트워크 모델/call adapter 등을 난독화 방지 규칙으로 보존.
Font Optimization
core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/font/Font.kt
Pretendard 폰트를 개별 파일 9종에서 단일 Variable 폰트로 통합하고 FontVariation.Settings 기반 weight 매핑 추가. cafe24SsurroundAir에서 FontStyle.Normal 인자 제거.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 난독화와 축소의 마법이 펼쳐지고,
폰트는 하나로 우아하게 통일되네!
R8의 현명한 규칙들이
라이브러리를 아껴주며,
앱은 더 작고 빠르게 나는 구나!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 R8 난독화 및 코드 축소 도입이라는 주요 변경사항을 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명은 템플릿의 주요 섹션(Related issue, Work Description, To Reviewers)을 포함하며 구체적인 변경사항과 APK 크기 감소 결과를 명시하고 있습니다.
Linked Issues check ✅ Passed PR은 #211의 모든 코딩 목표를 충족합니다: app/build.gradle.kts 활성화, app/proguard-rules.pro 규칙 작성, consumer-rules.pro 추가, 폰트 최적화 완료.
Out of Scope Changes check ✅ Passed 모든 변경사항이 #211의 범위 내입니다: R8 활성화 설정, ProGuard 규칙, consumer-rules.pro 파일, 폰트 최적화는 모두 명시된 목표와 일치합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#211-r8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wjdrjs00
Copy link
Copy Markdown
Member Author

wjdrjs00 commented Apr 2, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/proguard-rules.pro`:
- Around line 1-45: The gradle.properties is missing the R8 optimization toggle
required by Issue `#211`; add the property
android.r8.optimizedResourceShrinking=true to gradle.properties so R8's
optimized resource shrinking is enabled (ensure this change aligns with existing
minifyEnabled/shrinkResources settings in your module build.gradle if present).
- Around line 10-18: The current proguard snippet includes an ineffective rule
"@kotlinx.serialization.Serializable *;" that targets members but `@Serializable`
is a class-level annotation; remove that incorrect line and either rely on
kotlinx.serialization's built-in ProGuard rules (1.6+) or replace it with the
correct class-level keep rule for classes annotated with
kotlinx.serialization.Serializable, while preserving the existing keepattributes
line ("keepattributes Annotation, InnerClasses, Signature, Exceptions") and the
serializer accessor rule ("keepclassmembers class * {
kotlinx.serialization.KSerializer serializer(...); }"); ensure the final rules
explicitly keep classes annotated with kotlinx.serialization.Serializable and
their generated serializer members when you need explicit rules for reflection
or generic collections.

In `@data/consumer-rules.pro`:
- Around line 1-4: Add R8 keep rules to preserve all request/response model
classes annotated with kotlinx.serialization annotations so JSON
field-to-property mappings are not broken: add a keep rule that targets classes
annotated with `@kotlinx.serialization.Serializable` (and those using
`@SerialName`), e.g., for packages like com.threegap.bitnagil.data.**.model.**,
ensuring the classes, their fields, constructors and generated serializer
metadata are retained (so types like VersionCheckResponse and other DTOs remain
intact and their generated serializers are kept). Also ensure serializer
implementation classes (kotlinx.serialization.KSerializer implementors) are
preserved so deserialization used by Retrofit works at runtime.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9a285265-7a81-4eb0-a104-87d6fe38647d

📥 Commits

Reviewing files that changed from the base of the PR and between be0d01e and 7628954.

⛔ Files ignored due to path filters (10)
  • core/designsystem/src/main/res/font/pretendard_black.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_bold.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_extra_bold.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_extra_light.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_light.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_medium.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_regular.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_semi_bold.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_thin.otf is excluded by !**/*.otf
  • core/designsystem/src/main/res/font/pretendard_variable.ttf is excluded by !**/*.ttf
📒 Files selected for processing (5)
  • app/build.gradle.kts
  • app/proguard-rules.pro
  • core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/font/Font.kt
  • core/network/consumer-rules.pro
  • data/consumer-rules.pro

Base automatically changed from feat/#209-coil-image-loader-setup to develop April 2, 2026 12:18
Copy link
Copy Markdown
Contributor

@l5x5l l5x5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다! 👍
커스텀 ImageLoader pr에서 추가한 CoilEntryPoint 관련 proguard-rules 수정 필요한지만 확인 부탁드립니다!
#210

@wjdrjs00
Copy link
Copy Markdown
Member Author

wjdrjs00 commented Apr 6, 2026

고생하셨습니다! 👍 커스텀 ImageLoader pr에서 추가한 CoilEntryPoint 관련 proguard-rules 수정 필요한지만 확인 부탁드립니다! #210

해당 브랜치 기반으로 생성한 브랜치여서 문제없습니다요~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능 구현 🧤 대현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] R8 난독화 및 코드 축소 도입

2 participants