使用EncryptedSharedPreferences时应使用任何Proguard规则吗? [英] Is there any proguard rules should use while using EncryptedSharedPreferences?
问题描述
在使用 EncryptedSharedPreferences 之前,在添加
before using EncryptedSharedPreferences my app works fine in release mode with (minifyEnabled = true), After adding the security library (version 1.0.0-rc01) to my application the app crash while opening and if i use (minifyEnabled = false) the app works fine, i think i missing something to add it in proguard-rules.pro but i have searched a lot did not found anything.
推荐答案
Tink混淆看起来有些问题.我当前的解决方法是将此规则添加到proguard:
Looks like something wrong with Tink obfuscation. My current workaround is add this rule to proguard:
-keep class com.google.crypto.tink.** { *; }
但还要在此处跟踪更新.
更新-2020年6月1日
有更有效的解决方案(感谢@jtsalva
指出):
There is more effective solution (thanks @jtsalva
to pointing out):
-keepclassmembers class * extends com.google.crypto.tink.shaded.protobuf.GeneratedMessageLite {
<fields>;
}
更新-2020年8月19日
这篇关于使用EncryptedSharedPreferences时应使用任何Proguard规则吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!