Skip to content

Commit

Permalink
MMA-3883 Applied as much as I could understand of the suggested fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jesuscc1993 committed Dec 18, 2023
1 parent 00eb5c6 commit c2712d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ protected KeyGenParameterSpec.Builder getKeyGenSpecBuilder(@NonNull final String
.setEncryptionPaddings(PADDING_PKCS1)
.setRandomizedEncryptionRequired(true)
.setUserAuthenticationRequired(true)
.setUserAuthenticationValidityDurationSeconds(5)
.setUserAuthenticationValidityDurationSeconds(-1)
.setKeySize(keySize);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,13 @@ protected FragmentActivity getCurrentActivity() {

protected BiometricPrompt authenticateWithPrompt(@NonNull final FragmentActivity activity) {
final BiometricPrompt prompt = new BiometricPrompt(activity, executor, this);
prompt.authenticate(this.promptInfo);

try {
this.storage.getCachedInstance().init(Cipher.DECRYPT_MODE, context.key);
prompt.authenticate(this.promptInfo, new BiometricPrompt.CryptoObject(this.storage.getCachedInstance()));
}
catch (final Throwable fail) {
this.onDecrypt(null, fail);
}
return prompt;
}

Expand Down

0 comments on commit c2712d3

Please sign in to comment.