Skip to content
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

kuring-139 [수정] 난독화 보호 경로 수정 #100

Merged
merged 2 commits into from
Mar 1, 2024
Merged

Conversation

mwy3055
Copy link
Member

@mwy3055 mwy3055 commented Mar 1, 2024

https://kuring.atlassian.net/browse/KURING-139?atlOrigin=eyJpIjoiMzBjMzViM2JjYmE1NGU0ZmE2MjE4YWY5NWI2ZWRkY2EiLCJwIjoiaiJ9

문제 상황

1.3.6 버전에서, 온보딩 화면에서 공지 알림 설정하기 화면을 누르면 앱이 강제 종료되는 문제가 있습니다.

Unable to create call adapter for class kc.o

난독화 해제하고 확인해 보니, RxJava에서 발생하는 문제였습니다.

java.lang.IllegalArgumentException: Unable to create call adapter for class io.reactivex.rxjava3.core.Single

원인

Retrofit에서 사용하는 request, response 클래스는 난독화로부터 보호되어야 합니다. 따라서 지금까지는 다음과 같이 proguard-rules.pro 파일에 보호 규칙을 작성하고 있었습니다.

-keep class com.ku_stacks.ku_ring.data.api.request.** { *; }
-keep class com.ku_stacks.ku_ring.data.api.response.** { *; }
-keep class com.ku_stacks.ku_ring.data.db.** { *; }
-keep class com.ku_stacks.ku_ring.data.model.** { *; }
-keep class com.ku_stacks.ku_ring.data.websocket.response.** { *; }
-keep class com.ku_stacks.ku_ring.data.websocket.request.** { *; }

그런데 모듈화로 인해 request와 response 클래스의 경로가 바뀌었습니다. 따라서 바뀐 경로를 작성해야 합니다.

해결 방법

  1. Requset, response 파일의 바뀐 경로를 작성했습니다.
  2. 일부 RxJava 및 Retrofit, Coroutines 클래스도 같은 문제가 있어서 규칙을 추가했습니다.

참고한 자료

square/retrofit#3774 (comment)

https://stackoverflow.com/questions/76532972/java-lang-classcastexception-java-lang-class-cannot-be-cast-to-java-lang-reflec

@auto-assign auto-assign bot requested a review from yeon-kyu March 1, 2024 08:04
Copy link
Member

@yeon-kyu yeon-kyu left a comment

Choose a reason for hiding this comment

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

LGTM! 마이너한거니 괜찮습니다

@mwy3055 mwy3055 merged commit 6414be7 into develop Mar 1, 2024
2 checks passed
@mwy3055 mwy3055 deleted the fix/kuring-139 branch March 1, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants