diff --git a/app/src/main/java/com/money/manager/ex/passcode/PasscodeActivity.java b/app/src/main/java/com/money/manager/ex/passcode/PasscodeActivity.java index f383be3d1..f72f84d7b 100644 --- a/app/src/main/java/com/money/manager/ex/passcode/PasscodeActivity.java +++ b/app/src/main/java/com/money/manager/ex/passcode/PasscodeActivity.java @@ -21,7 +21,6 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.hardware.fingerprint.FingerprintManager; -import android.os.Build; import android.os.Bundle; import androidx.core.app.ActivityCompat; @@ -147,10 +146,16 @@ protected void onCreate(Bundle savedInstanceState) { buttonKeyBack.setImageDrawable(ui.getIcon(GoogleMaterial.Icon.gmd_backspace) .color(ui.getPrimaryTextColor())); - // Handle fingerprint authentication - findViewById(R.id.fpImageView).setVisibility(View.GONE); - findViewById(R.id.fingerprintInfo).setVisibility(View.GONE); - setupLegacyFingerprintAuth(); + try { + // Handle fingerprint authentication + findViewById(R.id.fpImageView).setVisibility(View.GONE); + findViewById(R.id.fingerprintInfo).setVisibility(View.GONE); + setupLegacyFingerprintAuth(); + } catch (Exception e) + { + // handle java.lang.RuntimeException on + // void android.view.View.setVisibility(int) + } // TODO setupBiometricPrompt(); } @@ -181,6 +186,7 @@ private void onBackspaceClick() { } else nullRequestFocus = true; //quick-fix convert 'switch' to 'if-else' if (getFocus.getId() == R.id.editTextPasscode1) { + // no action } else if (getFocus.getId() == R.id.editTextPasscode2) { findViewById(R.id.editTextPasscode1).requestFocus(); if (nullRequestFocus) { @@ -228,7 +234,7 @@ private void setupLegacyFingerprintAuth() { try { generateKey(); } catch (FingerprintException e) { - e.printStackTrace(); + Timber.e(e, "Error generating key"); } if (initCipher()) { FingerprintManager.CryptoObject cryptoObject = new FingerprintManager.CryptoObject(cipher); @@ -265,7 +271,7 @@ private void generateKey() throws FingerprintException { | InvalidAlgorithmParameterException | CertificateException | IOException exc) { - exc.printStackTrace(); + Timber.e(exc, "Error KeySoreException"); throw new FingerprintException(exc); }