-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#211] R8 난독화 및 코드 축소 도입 #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wjdrjs00
wants to merge
2
commits into
develop
Choose a base branch
from
feat/#211-r8
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| # [Domain/Data Layer Enums] | ||
| # API 응답 매핑 및 리플렉션 방어를 위해 Enum 상수 이름 유지 | ||
| -keepclassmembers enum com.threegap.bitnagil.domain.**.model.** { | ||
| <fields>; | ||
| } | ||
| -keepclassmembers enum com.threegap.bitnagil.data.**.model.** { | ||
| <fields>; | ||
| } | ||
|
|
||
| # [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<T> 형태의 Retrofit 인터페이스에서 | ||
| # R8이 kotlin.Result의 제네릭 타입 인자를 지워 call adapter 탐색 실패 방어 | ||
| -keep class kotlin.Result { *; } | ||
|
|
||
| # [Network Libraries] | ||
| # Retrofit 및 OkHttp 어노테이션 유지 | ||
| -keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations | ||
wjdrjs00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
35 changes: 24 additions & 11 deletions
35
core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/font/Font.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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), | ||
| ) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # [ResultCallAdapter] | ||
| # Retrofit Call Adapter 팩토리 및 네트워크 모델 보존 | ||
| -keep class com.threegap.bitnagil.network.calladapter.** { *; } | ||
| -keep class com.threegap.bitnagil.network.model.** { *; } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # [Retrofit Service Interfaces] | ||
| # R8이 제네릭 시그니처를 제거하면 ResultCallAdapterFactory가 Call<Result<T>>의 | ||
| # 타입 인자를 런타임에 읽지 못해 "Unable to create call adapter" 에러 발생 | ||
| -keep interface com.threegap.bitnagil.data.**.service.** { *; } | ||
wjdrjs00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.