Android생활정보ZIP

[안드로이드]java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: 패키지명 오류 해결 방법?

구글맵을 사용중인데, 기존에는 지도에 표기할 마커데이터(위도, 경도)를

strig array로 가지고 있었다. 그런데 하나의 위도경도를 추가할 때 마다

앱을 배포해야는 귀찮이즘이 생기기 시작했다.

 

그리하여 특정 사이트에 JSON데이터로 만들어둔 후 가져오는 방식으로 처리하였다.

디버깅모드에서는 정상적으로 구글지도에 표기가 되었는데

이상하게도 릴리즈 버전에서는 SecurityException이 발생하였다.

 

오류의 자세한 내용은 다음과 같다.

Found duplicated class when checking oat files: 
'Landroid/support/v4/app/RemoteActionCompatParcelizer;'
 java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: pkg=com.test.bell, sha256=[755b4c1c0dd30844d26b07cc8edf48a217f92468461e830c0ab41cc39a4facc3], atk=false, ver=222413028.true (go/gsrlt)
        at aig.s(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):3)
        at aig.get(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):2)
        at ajq.g(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):2)
        at yf.d(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):1)
        at yh.run(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):0)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.SecurityException: GoogleCertificatesRslt: not allowed: pkg=com.test.bell, sha256=[755b4c1c0dd30844d26b07cc8edf48a217f92468461e830c0ab41cc39a4facc3], atk=false, ver=222413028.true (go/gsrlt)
        at android.os.Parcel.createException(Parcel.java:2071)
        at android.os.Parcel.readException(Parcel.java:2039)
        at android.os.Parcel.readException(Parcel.java:1987)
        at es.bc(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):2)
        at rs.a(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):4)
        at iz.e(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):2)
        at jy.t(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):2)
        at jy.u(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):3)
        at jy.e(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):2)
        at kc.handleMessage(:com.google.android.gms.dynamite_mapsdynamite@222413065@22.24.13 (100400-0):69)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:67)
2022-07-16 19:21:12.968 10347-11087/? I/Counters: exceeded sample count in FrameTime
2022-07-16 19:21:13.113 4598-5041/? I/MobileSignalController: isRoaming = false

 

 스택오버플로에 비슷한 오류가 있으나 해결책은 되지 못했다.

 

 

SecurityException – GoogleCertificatesRslt: not allowed

We have an app with some million users. Over the past week we have gotten around 30 “velocity alerts” from Firebase Crashlytics from older versions of the app with error messages like this:

stackoverflow.com

 

현재 사용중인 라이브러리 정보는 다음과 같다.

    implementation 'com.google.android.gms:play-services-maps:16.1.0'

    implementation 'com.squareup.retrofit2:retrofit:2.0.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
    implementation 'com.squareup.okhttp3:okhttp:3.4.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'

    implementation 'org.jsoup:jsoup:1.10.2'
    
// Retrofit
//    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
//    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
//    implementation "com.squareup.okhttp3:okhttp:4.9.0"

 

코드 난독화가 문제인 듯 하여 proguard-rules.pro 파일에 아래 내용들을 추가해 주었다.

 

# 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

# 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 *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

-keepattributes Signature, InnerClasses, EnclosingMethod

# Retrofit does reflection on method and parameter annotations.
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations

# Retain service method parameters when optimizing.
-keepclassmembers,allowshrinking,allowobfuscation interface * {
    @retrofit2.http.* <methods>;
}

-dontwarn com.squareup.okhttp3.**

-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepattributes Signature
-keepattributes Exceptions


# okhttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

-dontwarn android.support.v4.**,org.slf4j.**,com.google.android.gms.**

-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**


# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class com.google.android.gms.common.** { *; }

#look for a file in your project called proguard-project.txt open it and add
#-keep class com.google.android.gms.ads.**
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

-keep class org.jsoup.**


##---------------Begin: proguard configuration for Gson  ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

-keepattributes *Annotation*


# Gson specific classes
-dontwarn sun.misc.**
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }


# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }

# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

-keep class * implements com.google.gson.TypeAdapter

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}


##---------------End: proguard configuration for Gson  ----------
-keep class com.google.android.gms.common.** { *; }

#look for a file in your project called proguard-project.txt open it and add
#-keep class com.google.android.gms.ads.**
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**


-keep public class * extends java.lang.annotation

#-dontwarn android.support.v7.**
## don't process support library
#-keep class android.support.v7.** { *; }
#-keep interface android.support.v7.** { *; }

-keep class org.jsoup.**

#-keepnames class org.jsoup.nodes.Entities
#-keep public class org.jsoup.** { public *; }
#-keep class java.util.**

 #-keep class com.google.gson.**

#-keep class * implements ddolcat.app.hi.lotto.database.DownModel

-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception

-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

오류는 없어지지않았지만 해당오류와 관계없이

내가 원하는 json데이터가 구글지도 위에 마커가 정상적으로 표시되었다.

 

Leave a Reply

error: Content is protected !!