Skip to content

Conversation

@PeraSite
Copy link
Member

Summary

https://eat-ssu.slack.com/archives/C0517NBULDR/p1764037363649059

  • [Refactor] SharedPreference에서 datastore로 마이그레이션 (#396)
  • [Refactor] firebase remote config 활용 코드 개선 (#398)

에서 문제가 발생했습니다. 정확한 이유는 다음과 같습니다.

  • dto 관련 파일들이 com.eatssu.android.data.dto에서 com.eatssu.android.data.remote.dto로 이동했는데, proguard-rules.pro에는 여전히 -keep class com.eatssu.android.data.dto.** 를 유지시켰음
  • FirebaseRemoteConfigRepositoryImpl#parseCafeteriaJson 에서 기존 org.json.JSONArray 파싱 방식에서 Gson의 TypeToken을 사용하는 방식으로 변경했는데, Proguard가 TypeToken에 대한 제네릭스 정보를 strip해서 다음 오류 발생
Failed to parse cafeteria JSON
java.lang.IllegalStateException: TypeToken must be created with a type argument: new TypeToken<...>() {}; When using code shrinkers (ProGuard, R8, ...) make sure that generic signatures are preserved.

Describe your changes

Proguard Rule를 수정하고, Gson 사용 시 TypeToken이 아니라 Java Class를 사용하게 해 해결했습니다.
급히 3.1.8을 배포해야했으므로 3.1.8(48) 버전업 후 배포까지 이 브랜치에서 한번에 진행했습니다.

Issue

  • Resolves #

To reviewers

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @PeraSite, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 풀 리퀘스트는 최근 릴리즈에서 발생한 두 가지 주요 문제를 해결하는 핫픽스입니다. Proguard 규칙의 불일치와 Gson의 TypeToken 사용 시 제네릭 정보 손실로 인한 런타임 오류를 수정하여 애플리케이션의 안정성을 확보하고, 긴급하게 3.1.8 버전을 배포하기 위해 버전 정보를 업데이트했습니다.

Highlights

  • Proguard 규칙 수정: 이전 리팩토링으로 인해 발생한 DTO 클래스 패스 불일치 문제를 해결하기 위해 Proguard 규칙을 업데이트했습니다.
  • Gson 파싱 방식 개선: TypeToken 사용 시 Proguard에 의해 제네릭 정보가 제거되어 발생하던 런타임 오류를 해결하기 위해 Gson 파싱 방식을 Array::class.java를 사용하는 방식으로 변경했습니다.
  • 버전 업데이트: 긴급 핫픽스 배포를 위해 애플리케이션 버전을 3.1.7에서 3.1.8로 업데이트했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 릴리즈 빌드에서 발생하던 두 가지 중요한 문제를 해결합니다. 첫째, DTO 클래스의 패키지 경로 변경 후 업데이트되지 않았던 Proguard 규칙을 수정하여 R8/Proguard에 의해 클래스가 난독화되는 것을 방지합니다. 둘째, Firebase Remote Config에서 JSON을 파싱할 때 TypeToken 사용으로 인해 발생하던 IllegalStateExceptionArray<T>::class.java를 사용하도록 변경하여 해결했습니다. 또한, 핫픽스 릴리즈를 위해 앱 버전을 3.1.8로 업데이트했습니다. 전반적으로 변경 사항들은 설명된 문제를 정확히 해결하는 것으로 보이며, 안정성을 높이는 중요한 수정입니다. 다만, JSON 파싱 시 발생할 수 있는 NPE 가능성에 대한 리뷰 의견을 하나 남겼습니다.

val gson = Gson()
val listType = object : TypeToken<List<RestaurantInfo>>() {}.type
val dtoList: List<RestaurantInfo> = gson.fromJson(json, listType)
val dtoList = gson.fromJson(json, Array<RestaurantInfo>::class.java)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

gson.fromJson은 JSON 문자열이 "null"일 경우 null을 반환할 수 있습니다. 이 경우 dtoListnull이 되어 다음 줄의 dtoList.map 호출 시 NullPointerException이 발생할 수 있습니다. try-catch 블록이 이 예외를 처리하겠지만, null을 명시적으로 처리하는 것이 더 안전하고 코드의 의도를 명확하게 합니다. Elvis 연산자(?:)를 사용하여 null일 경우 빈 배열을 반환하도록 수정하는 것을 권장합니다.

Suggested change
val dtoList = gson.fromJson(json, Array<RestaurantInfo>::class.java)
val dtoList = gson.fromJson(json, Array<RestaurantInfo>::class.java) ?: emptyArray()

-keep class com.eatssu.android.data.dto.** {
*;
}
-keep class com.eatssu.android.data.enums.** {
Copy link
Member

Choose a reason for hiding this comment

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

이거 enum core 모듈에 있는데 이거는 따로 안해도 문제 없는건가요??

Copy link
Member Author

Choose a reason for hiding this comment

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

놓쳤나해서 확인해보니 core 모듈의 enum은 com.eatssu.common.enums 에요!
지운건 core 분리 리팩토링 이전에 있던 com.eatssu.android.data.enums 니까 영향 없을 것 같아용
릴리즈 빌드해서 기능 정상 작동하는 것도 확인했어요!

Copy link
Member

Choose a reason for hiding this comment

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

굿입니다~👍

@PeraSite PeraSite self-assigned this Nov 25, 2025
Copy link
Member

@HI-JIN2 HI-JIN2 left a comment

Choose a reason for hiding this comment

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

굿굿

-keep class com.eatssu.android.data.dto.** {
*;
}
-keep class com.eatssu.android.data.enums.** {
Copy link
Member

Choose a reason for hiding this comment

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

굿입니다~👍

@PeraSite PeraSite merged commit 6881061 into develop Nov 25, 2025
1 check passed
@PeraSite PeraSite deleted the hotfix/proguard-issue branch November 25, 2025 04:02
@kangyuri1114
Copy link
Member

확인했습니다~! 수고하셨습니다!!

kangyuri1114 pushed a commit that referenced this pull request Nov 25, 2025
* fix: DTO 파일 이동에 따른 Proguard Rule 수정

* fix: Generics 관련 정보가 유실되는 TypeToken 대신 Java Class 사용

* release: 3.1.8(46)

* refactor: unused import 삭제

* fix: 제미니 대응
kangyuri1114 added a commit that referenced this pull request Dec 17, 2025
* feat: 제휴지도 학과/전체 토글 디폴트값 변경 및 토글 UI 위치 변경

* feat: PartnershipFilterToggle에서 toggleItem 생성방식 변경 및 UI수정, 불필요 코드 삭제

* delete: 사용하지 않는 위치 권한 코드 삭제

* feat: compose 라이브러리 버전 업데이트

* feat: compose router-screen 분리

* feat: 학과 선택을 하지 않은 경우, default 토글이 "전체"로 수정. 학과 토글 선택 시 바텀시트 보여주기

* feat: 제휴지도 학과/전체 토글 디폴트값 변경 및 토글 UI 위치 변경

* feat: PartnershipFilterToggle에서 toggleItem 생성방식 변경 및 UI수정, 불필요 코드 삭제

* delete: 사용하지 않는 위치 권한 코드 삭제

* feat: compose 라이브러리 버전 업데이트

* feat: compose router-screen 분리

* feat: 학과 선택을 하지 않은 경우, default 토글이 "전체"로 수정. 학과 토글 선택 시 바텀시트 보여주기

* feat: compose 버전 업데이트 롤백

* feat: 학과 정보가 업데이트될 때마다 토글 상태 없데이트하도록 key 변경

* feat: init 내부에서 전체 제휴정보 load하는 코드 제거(compose LaunchedEffect로 이동)

* feat: BottomSheet 표시는 View의 SheetState로만 관리 (ViewModel은 데이터만 제공), 제휴정보, 학과 입력 바텀시트 상태 변수 분리

* feat: Domain 모델(RestaurantType)을 UI 모델(PlaceType)로 변환 로직을 뷰모델로 이동

* feat: 토글 필터 상태, 이벤트 로거를 ViewModel로 이동. departmentId, collegeId flow 방출로 수정

* [Hotfix] Release에서 발생하던 문제 해결 및 3.1.8 릴리즈 (#418)

* fix: DTO 파일 이동에 따른 Proguard Rule 수정

* fix: Generics 관련 정보가 유실되는 TypeToken 대신 Java Class 사용

* release: 3.1.8(46)

* refactor: unused import 삭제

* fix: 제미니 대응

* chore: material 의존성 제거 (#423)

* feat: 코드 리뷰 반영 (네이밍 변경 및 scope 전달 -> 람다 전달로 수정, 최초 정보 load 시 state copy가 아닌 mapState 객체 생성 및 초기화)

* feat: 제휴정보 토글 변경 시 선택했던 식당의 제휴정보 state 초기화

* feat: MapScreen 접근 제어자 private -> internal 변경

---------

Co-authored-by: 정제훈 <pretocki3@gmail.com>
Co-authored-by: 유진 <qldls0307@naver.com>
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.

4 participants