Skip to content

Commit

Permalink
feat: remove deprecated use of MasterKey
Browse files Browse the repository at this point in the history
  • Loading branch information
ViscousPot committed Aug 29, 2024
1 parent dd60dcc commit a1e2885
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package com.viscouspot.gitsync.util

import android.content.Context
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKeys
import androidx.security.crypto.MasterKey

class SettingsManager internal constructor(context: Context) {
private val masterKey = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC)
private val masterKey = MasterKey.Builder(context, MasterKey.DEFAULT_MASTER_KEY_ALIAS)
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
.build()
private val settingsSharedPref = EncryptedSharedPreferences.create(
context,
"git_sync_settings",
masterKey,
context,
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
)
Expand Down

0 comments on commit a1e2885

Please sign in to comment.