Skip to content

Commit 16a3373

Browse files
committed
Replace deprecated API use
1 parent 52d0c82 commit 16a3373

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ android {
3333
sourceCompatibility JavaVersion.VERSION_1_8
3434
targetCompatibility JavaVersion.VERSION_1_8
3535
}
36+
37+
packagingOptions {
38+
jniLibs {
39+
useLegacyPackaging true
40+
}
41+
}
3642
}
3743

3844
dependencies {

app/src/main/java/com/appliedrec/credentials/app/SecureStorage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import android.content.SharedPreferences;
55

66
import androidx.security.crypto.EncryptedSharedPreferences;
7-
import androidx.security.crypto.MasterKeys;
7+
import androidx.security.crypto.MasterKey;
88

99
import java.io.IOException;
1010
import java.security.GeneralSecurityException;
@@ -19,7 +19,7 @@ static class CommonKeys {
1919
}
2020

2121
SecureStorage(Context context) throws GeneralSecurityException, IOException {
22-
sharedPreferences = EncryptedSharedPreferences.create("credentialsAppSecureStore", MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC), context, EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM);
22+
sharedPreferences = EncryptedSharedPreferences.create(context, "credentialsAppSecureStore", new MasterKey.Builder(context).setKeyScheme(MasterKey.KeyScheme.AES256_GCM).build(), EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM);
2323
}
2424

2525
void setValueForKey(String value) {

0 commit comments

Comments
 (0)