encrypted-shared-preference

check value exists or not using EncryptedSharedPreferences android

旧街凉风 提交于 2021-01-29 15:26:20
问题 I use the EncryptedSharedPreferences to store value while login...i want to change text in navigation drawer of home activity so when user is loggedin it will show logout else it will show login navigation drawer Loginactivity:-------- sharedPreferences = EncryptedSharedPreferences.create( "secret_shared_prefs", masterKeyAlias, baseContext, EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM ) as

How to create masterKey after MasterKeys deprecated in Android

风流意气都作罢 提交于 2020-07-30 07:02:33
问题 I am using the following code to store some information encrypted in my app. val masterKey = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC) val sharedPreferences = EncryptedSharedPreferences.create( "secret_shared_prefs", masterKey, this, EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM ) Since the MasterKeys class deprecated in Android, I should use the MasterKey class and but I cannot figure out what is the

How to create masterKey after MasterKeys deprecated in Android

一笑奈何 提交于 2020-07-30 06:58:41
问题 I am using the following code to store some information encrypted in my app. val masterKey = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC) val sharedPreferences = EncryptedSharedPreferences.create( "secret_shared_prefs", masterKey, this, EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM ) Since the MasterKeys class deprecated in Android, I should use the MasterKey class and but I cannot figure out what is the

Secured Android SharedPreferences Error: 'Caused by: java.lang.RuntimeException: Field keySize_ for…'

人盡茶涼 提交于 2020-07-08 11:09:07
问题 In an Android Kotlin project, I implemented EncryptedSharedPreference feature based on this link using the androidx.security library and it worked well in debug mode. But in release mode, I keep getting this error java.lang.ExceptionInInitializerError at com.package_name.i.a.f(:46) at com.package_name.i.a.j(:52) at com.package_name.i.a.e(:82) at com.package_name.MyApplication.onCreate(:37) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013) at android.app

Secured Android SharedPreferences Error: 'Caused by: java.lang.RuntimeException: Field keySize_ for…'

删除回忆录丶 提交于 2020-07-08 11:08:42
问题 In an Android Kotlin project, I implemented EncryptedSharedPreference feature based on this link using the androidx.security library and it worked well in debug mode. But in release mode, I keep getting this error java.lang.ExceptionInInitializerError at com.package_name.i.a.f(:46) at com.package_name.i.a.j(:52) at com.package_name.i.a.e(:82) at com.package_name.MyApplication.onCreate(:37) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013) at android.app