카테고리 없음

React Native : android play-services-safetynet (com.google.android.gms:play-services-safetynet) 경고

빠릿베짱이 2022. 7. 12. 19:18
반응형

play-services-safetynet (com.google.android.gms:play-services-safetynet) 개발자가 17.0.0 버전에 심각한 문제가 있다고 신고했습니다. 신규 버전을 게시하기 전에 업그레이드하는 것이 좋습니다.


SDK 개발자가 신고한 내용은 다음과 같습니다.
The SafetyNet Attestation API is being discontinued and replaced by the new Play Integrity API. Begin migration as soon as possible to avoid user disruption. The Play Integrity API includes all the integrity signals that SafetyNet Attestation offers and more, like Google Play licensing and better error messaging. Learn more and start migrating at https://developer.android.com/training/safetynet/deprecation-timeline
 

Discontinuing the SafetyNet Attestation API  |  Android Developers

The SafetyNet Attestation API is deprecated and has been replaced by the Play Integrity API. Learn more. Discontinuing the SafetyNet Attestation API In order to help you safely grow your business, Google builds tools to protect your Android apps and games

developer.android.com

 

간만에 안드로이드 업데이트를 진행하는데, 위와 같은 경고가 발생했다.

찾아보니, firebase auth랑 관련이 있는듯 했다.

문제는 이를 해결하고, 어떻게 검증하느냐 였다. 

도무지 방법을 찾지 못했다.

정말 무식하게, 안드로이드에 app bundle을 업로드 후 버전 검토하고, 경고가 뜨면,  버전 삭제 후 App Bundle 탐색기에서  좀 전에 올린 버전을 삭제  => 이것을 경고가 없어질 때까지 무한 반복했다.

 

요 코드는 @react-native-firebase\auth\android에 있는 build.gradle 파일 이다.

원본은 주석처리한 부분처럼 되어있는데, 아래 코드로 변경하였다.

dependencies {
  api appProject
  implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
//   implementation "com.google.firebase:firebase-auth"
    implementation ('com.google.firebase:firebase-auth'){
        exclude group: 'com.google.android.gms', module: 'play-services-safetynet'
    }
}

 

설치된 라이브러리 파일의 설정을 변경하는게 좀 찜찜해서, 프로젝트내에서 같은 방법으로 시도를 했으나,

되지 않았다. 

너무도 여러번 테스트를 해서, 어떤 경우에 되고, 어떤 경우에 안되는지 설명할 수는 없으나,

마지막 버전은 라이브러리 내의 build.gradle 파일을 변경했을 때 적용되었다.

그리고, 번들로 빌드 할 경우, 기존 빌드 폴더에 남은 기존 파일들은 삭제 후 재시도 했다.

한가지, 번들 업로드 전에 정상 동작하는지 확인 하는 방법으로 짐작되는 건

안드로이드 스튜디오에서 우측에 gradle 메뉴를 보면 아래와 같은 화면을 볼 수 있다.

react-native-firsebase_auth에서 com.google.android.gms:play-services-safetynet:17.0.0 이 존재하는 경우에는

스토어에 업로드 시 경고가 떴다. 성공한 후에 한번 확인해보니, 해당 라이브러리가 사라졌음을 알 수 있었다.따라서, 업로드 하기전에, 일단 여기서 한번 보고 해당 설정이 정상적으로 되는지 확인 할 수 있을 듯 하다.부모 프로젝트에서 하위 프로젝트의 라이브러리 설정을 컨트롤 하고 싶은데 방법을 찾지 못했습니다.혹시 이 방법 아시는 분 계시다면 댓글로  공유 부탁드려요~

 

 

반응형