forked from thijooree/android
auto unlock on correct pin
This commit is contained in:
@@ -215,9 +215,10 @@ class SecuritySetupFragment : Fragment() {
|
||||
val salt = ByteArray(16).also { SecureRandom().nextBytes(it) }
|
||||
val saltB64 = Base64.encodeToString(salt, Base64.NO_WRAP)
|
||||
val hash = pbkdf2(input, salt)
|
||||
requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE).edit()
|
||||
val edit = requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE).edit()
|
||||
.putString("security_method", method)
|
||||
.apply()
|
||||
if (method == "pin") edit.putInt("pin_length", input.length)
|
||||
edit.apply()
|
||||
CredentialStore(requireContext()).saveSecurityHash(saltB64, hash)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user