Skip to content

refactor(core): 생체 인증 프롬프트 래퍼를 core:common 으로 올린다 (#2195) - #2202

Merged
OnlyReadOneBook merged 8 commits into
developfrom
refactor/2195-core-biometric-prompt
Oct 6, 2026
Merged

OnlyReadOneBook merged 8 commits into
developfrom
refactor/2195-core-biometric-prompt

Conversation

@OnlyReadOneBook

@OnlyReadOneBook OnlyReadOneBook commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

먼저 볼 파일: core/common/.../biometric/BiometricAuth.kt, feature/setting/.../passkey/PassKeyMakingScreen.kt, feature/setting/presentation/src/main/res/values/strings.xml, feature/setting/.../passkey/PassKeyMakingApi29Test.kt입니다.

Closes #2195

무엇을

  • afternote shared/fingerprint/BiometricAuth.kt 의 FragmentActivity.authenticateBiometric, BiometricAuthResult, BiometricMessages 를 core:common biometric 패키지(BiometricCryptoGate.kt 옆)로 옮겼다. 바뀐 것은 패키지, public 명시, 같은 패키지가 되어 필요 없어진 import, 로그 태그(FingerprintLogin → BiometricAuth)뿐이다.
  • afternote 지문 관문은 import 만 바꿨고, 직접 쓰지 않게 된 biometric 의존을 걷었다(core:common 이 api 로 노출한다).
  • 설정 패스키 등록의 private authenticate·BiometricResult 사본을 지우고 core 래퍼를 부른다. 하드코딩돼 있던 제목·부제·검증 실패 문구는 값을 그대로 setting_biometric_* 리소스로 옮겼고, 래퍼가 요구하는 나머지 문구는 afternote 와 같은 문장으로 두었다.

동작 변화

afternote 는 바뀌지 않는다. 설정 패스키 등록만 afternote 가 이미 갖고 있던 방어를 얻는다.

  • 프롬프트 전에 canAuthenticate 로 하드웨어 없음·미등록·일시 불가를 가려 오류 팝업으로 끝낸다.
  • authenticate() 초기화 예외를 잡아 오류로 끝낸다. 지금은 Android 9·10 에서 BIOMETRIC_STRONG | DEVICE_CREDENTIAL 조합이 PromptInfo.build() 에서 예외를 던져 앱이 죽는다.

왜

#1166 본문이 이미 복제라고 적은 사본이고, 같은 CodeQL 수정이 afternote(914a440)와 설정(21df4d8)에 18일 간격으로 두 번 들어갔다. 그사이 설정 쪽만 방어가 빠져 위 크래시가 생겼다.

범위 밖

Android 9·10 에서 afternote 관문도 통과할 수 없는 문제(허용자 조합 자체)는 #2200 이 다룬다.

검증

  • 테스트가 다른 모듈의 data 구현을 직접 조립하던 참조를 제거했다. Hilt 테스트 그래프와 기존 domain testFixtures를 사용하며 전체 :konsist:test 56건, SDK 29 회귀 3건, setting presentation ktlintCheck를 다시 통과했다.
  • SDK 29 Robolectric 회귀 3건과 setting presentation ktlintCheck 통과: 실제 AndroidX의 미지원 허용자 조합 예외, core 래퍼의 오류 반환, 활성화된 지문 인증 버튼의 오류 팝업·닫기·재시도를 확인했다. 오류·닫기·재시도 후에도 패스키 미등록 상태가 유지되고 성공 팝업·화면 이동이 발생하지 않는다. ViewModel은 실제 Hilt Activity 그래프에서 생성하고, 저장 상태는 공개 UserProfileCacheRepository 계약으로 재조회한다. 테스트에서 Pixel 4 모델과 인증 가능한 프레임워크 상태를 구성했으며, AndroidX와 프로덕션 래퍼 반환값은 mock하지 않았다.
  • 위 회귀는 실제 API 29 기기나 AVD의 인증 실행 결과가 아니다. SDK 28~29에서 인증 자체를 가능하게 하는 변경과 해당 기기 검증은 fix(core): Android 9·10 에서 생체 인증 관문을 통과할 수 없다 #2200 범위다.
  • :core:common:testDebugUnitTest(47), :feature:afternote:presentation:testDebugUnitTest(333), :feature:setting:presentation:testDebugUnitTest(101), 세 모듈 ktlintCheck, :app:compileDebugUnitTestKotlin, :konsist:test --rerun-tasks(56) 통과
  • 스크린샷: passKeyMakingScreenScreenshot·Compact, fingerprintLoginScreenCompactScreenshot 통과. 로컬 validateDebugScreenshotTest 의 나머지 실패는 이 변경이 건드리지 않은 화면들이라 CI 결과로 판정한다.

CI Test Plan

{"androidTest": {"mode": "none", "reason": "생체 인증 래퍼의 모듈 이동과 두 소비처의 호출 교체다. 화면 레이아웃·네비게이션·계측 테스트 파일은 바뀌지 않았고, 래퍼 판정은 기존 core:common 유닛 테스트와 SDK 29 Robolectric 회귀 3건이 검증한다. 레이아웃은 기존 스크린샷 검증 범위다."}}

afternote 의 authenticateBiometric·BiometricAuthResult·BiometricMessages 를 동작 그대로 core:common biometric 패키지로 옮기고, 설정 패스키의 private authenticate 사본을 지워 core 래퍼를 부르게 했다.
설정 쪽 하드코딩 문구는 값 그대로 setting_biometric_* 리소스로 옮기고, 나머지 문구는 afternote 와 같은 문장으로 두었다.
설정 패스키는 이로써 canAuthenticate 사전 분기와 초기화 예외 처리를 얻어, 지원하지 않는 조합에서 크래시 대신 오류로 끝난다.
@OnlyReadOneBook
OnlyReadOneBook added this pull request to stack #2227 October 1, 2026 10:06
@github-actions github-actions Bot added the sibling-conflict 열린 형제 PR 과 같은 파일에서 충돌 — 나중에 머지되는 쪽이 base 를 병합해야 한다. 해소되면 자동으로 떨어진다 label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

형제 충돌이 해소됐다 — 지금은 이 PR 과 같은 파일을 서로 다르게 고친 열린 PR 이 없다 (#1750).
다시 생기면 이 코멘트를 현재 상태로 고쳐 쓴다.

@OnlyReadOneBook
OnlyReadOneBook removed this pull request from stack #2227 October 1, 2026 12:06
@OnlyReadOneBook
OnlyReadOneBook changed the base branch from develop to fix/708-setting-error-retry October 1, 2026 12:06
@OnlyReadOneBook
OnlyReadOneBook added this pull request to stack #2234 October 1, 2026 12:06
@github-actions github-actions Bot removed the sibling-conflict 열린 형제 PR 과 같은 파일에서 충돌 — 나중에 머지되는 쪽이 base 를 병합해야 한다. 해소되면 자동으로 떨어진다 label Oct 1, 2026

@Sadturtleman Sadturtleman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

core:common 으로의 이동과 설정 패스키 등록의 래퍼 교체가 기존 동작을 유지하면서 Android 9·10 크래시 방어를 얻는 것을 확인했습니다. 승인합니다.

Base automatically changed from fix/708-setting-error-retry to develop October 6, 2026 07:11
@OnlyReadOneBook
OnlyReadOneBook added this pull request to the merge queue Oct 6, 2026
Merged via the queue into develop with commit f4b37f7 Oct 6, 2026
38 of 39 checks passed
@OnlyReadOneBook
OnlyReadOneBook deleted the refactor/2195-core-biometric-prompt branch October 6, 2026 07:48
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.

refactor(core): 생체 인증 프롬프트 래퍼를 core:common 으로 올린다

2 participants