security-samples
security-samples copied to clipboard
What's the ProGuard config?
Set "minifyEnabled" to true(no problem if set false) before running release apk, there would be a FC:
2020-05-18 13:10:21.228 1992-1992/com.my.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.my.app, PID: 1992
java.lang.ExceptionInInitializerError
at androidx.security.crypto.EncryptedSharedPreferences$PrefKeyEncryptionScheme.<clinit>(:146)
at c.c.d.f.i.g.<clinit>(:35)
at c.c.d.f.i.g.a(:110)
at c.c.d.f.f.l(:148)
at c.c.d.f.f.m(:120)
at c.c.d.f.f.a(:63)
at com.my.app.MyApp$a.a(:69)
at d.a.a.onCreate(:181)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1190)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6609)
at android.app.ActivityThread.access$1400(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1892)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:228)
at android.app.ActivityThread.main(ActivityThread.java:7589)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)
Caused by: java.lang.RuntimeException: Field keySize_ for c.b.c.a.g.ja not found. Known fields are [public int c.b.c.a.g.ja.g, public static final c.b.c.a.g.ja c.b.c.a.g.ja.e, public static volatile c.b.e.ea c.b.c.a.g.ja.f]
at c.b.e.Y.a(:608)
at c.b.e.Y.a(:502)
at c.b.e.Y.a(:221)
at c.b.e.N.a(:85)
at c.b.e.N.a(:71)
at c.b.e.ga.a(:93)
at c.b.e.ga.a(:107)
at com.google.protobuf.GeneratedMessageLite.l(:171)
at com.google.protobuf.GeneratedMessageLite$a.d(:391)
at com.google.protobuf.GeneratedMessageLite$a.c(:399)
at c.b.c.a.c.e.a(:45)
at c.b.c.a.c.e.<clinit>(:38)
at androidx.security.crypto.EncryptedSharedPreferences$PrefKeyEncryptionScheme.<clinit>(:146)
at c.c.d.f.i.g.<clinit>(:35)
at c.c.d.f.i.g.a(:110)
at c.c.d.f.f.l(:148)
at c.c.d.f.f.m(:120)
at c.c.d.f.f.a(:63)
at com.my.app.MyApp$a.a(:69)
at d.a.a.onCreate(:181)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1190)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6609)
at android.app.ActivityThread.access$1400(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1892)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:228)
at android.app.ActivityThread.main(ActivityThread.java:7589)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)
I tried:
-keep class androidx.security.crypto.** {*;}
-keep public enum androidx.security.crypto.EncryptedSharedPreferences$** {
**[] $VALUES;
public *;
}
but not working.
@ysy950803 is your issue resolved? i am also facing above issue?
@ysy950803 is your issue resolved? i am also facing above issue?
I had solved, and you can look this: https://github.com/android/security-samples/pull/59