使用EncryptedSharedPreferences时应使用任何Proguard规则吗? [英] Is there any proguard rules should use while using EncryptedSharedPreferences?

查看:128
本文介绍了使用EncryptedSharedPreferences时应使用任何Proguard规则吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 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日

现在应在版本中解决此问题1.0.0-rc03

这篇关于使用EncryptedSharedPreferences时应使用任何Proguard规则吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆