content: package com.example.vault.Fingerprint;
  
  
  import android.Manifest;
  import android.app.Activity;
  import android.content.Context;
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.hardware.fingerprint.FingerprintManager;
  import android.os.Build;
  import android.os.CancellationSignal;
  import android.widget.Toast;
  
  import androidx.annotation.RequiresApi;
  import androidx.core.app.ActivityCompat;
  
  import com.example.vault.features.MainiFeaturesActivity;
  import com.example.vault.securitylocks.SecurityLocksCommon;
  
  
  public class FingerprintHandler extends FingerprintManager.AuthenticationCallback {
  
      private CancellationSignal cancellationSignal;
      private Context context;
  
  
      public FingerprintHandler(Context mContext) {
          context = mContext;
      }
  
      public void startAuth(FingerprintManager manager, FingerprintManager.CryptoObject cryptoObject) {
          cancellationSignal = new CancellationSignal();
          if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
              return;
          }
          manager.authenticate(cryptoObject, cancellationSignal, 0, this, null);
      }
  
      @Override
      public void onAuthenticationError(int errMsgId,
                                        CharSequence errString) {
          Toast.makeText(context,
                  "Authentication error\n" + errString,
                  Toast.LENGTH_LONG).show();
      }
  
      @Override
      public void onAuthenticationFailed() {
          Toast.makeText(context,
                  "Authentication failed",
                  Toast.LENGTH_LONG).show();
      }
  
      @Override
      public void onAuthenticationHelp(int helpMsgId,
                                       CharSequence helpString) {
          Toast.makeText(context,
                  "Authentication help\n" + helpString,
                  Toast.LENGTH_LONG).show();
      }
  
  
      @Override
      public void onAuthenticationSucceeded(
              FingerprintManager.AuthenticationResult result) {
  
          Toast.makeText(context,
                  "Success!",
                  Toast.LENGTH_LONG).show();
  
  
          SecurityLocksCommon.IsnewloginforAd = true;
          SecurityLocksCommon.IsFakeAccount = 0;
          Intent intent = new Intent(context, MainiFeaturesActivity.class);
          ((Activity) context).overridePendingTransition(17432576, 17432577);
          context.startActivity(intent);
          ((Activity) context).finish();
      }
  
  
  }
  