FingerprintManagerCompat.java 7.64 KB
package android.support.v4.hardware.fingerprint;

import android.content.Context;
import android.os.Build.VERSION;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.os.CancellationSignal;
import java.security.Signature;
import javax.crypto.Cipher;
import javax.crypto.Mac;

public final class FingerprintManagerCompat
{
  static final b a = new c();
  private Context b;
  
  static
  {
    if (Build.VERSION.SDK_INT >= 23)
    {
      a = new a();
      return;
    }
  }
  
  private FingerprintManagerCompat(Context paramContext)
  {
    this.b = paramContext;
  }
  
  public static FingerprintManagerCompat from(Context paramContext)
  {
    return new FingerprintManagerCompat(paramContext);
  }
  
  public final void authenticate(@Nullable CryptoObject paramCryptoObject, int paramInt, @Nullable CancellationSignal paramCancellationSignal, @NonNull AuthenticationCallback paramAuthenticationCallback, @Nullable Handler paramHandler)
  {
    a.a(this.b, paramCryptoObject, paramInt, paramCancellationSignal, paramAuthenticationCallback, paramHandler);
  }
  
  public final boolean hasEnrolledFingerprints()
  {
    return a.a(this.b);
  }
  
  public final boolean isHardwareDetected()
  {
    return a.b(this.b);
  }
  
  public static abstract class AuthenticationCallback
  {
    public void onAuthenticationError(int paramInt, CharSequence paramCharSequence) {}
    
    public void onAuthenticationFailed() {}
    
    public void onAuthenticationHelp(int paramInt, CharSequence paramCharSequence) {}
    
    public void onAuthenticationSucceeded(FingerprintManagerCompat.AuthenticationResult paramAuthenticationResult) {}
  }
  
  public static final class AuthenticationResult
  {
    private FingerprintManagerCompat.CryptoObject a;
    
    public AuthenticationResult(FingerprintManagerCompat.CryptoObject paramCryptoObject)
    {
      this.a = paramCryptoObject;
    }
    
    public final FingerprintManagerCompat.CryptoObject getCryptoObject()
    {
      return this.a;
    }
  }
  
  public static class CryptoObject
  {
    private final Signature a;
    private final Cipher b;
    private final Mac c;
    
    public CryptoObject(Signature paramSignature)
    {
      this.a = paramSignature;
      this.b = null;
      this.c = null;
    }
    
    public CryptoObject(Cipher paramCipher)
    {
      this.b = paramCipher;
      this.a = null;
      this.c = null;
    }
    
    public CryptoObject(Mac paramMac)
    {
      this.c = paramMac;
      this.b = null;
      this.a = null;
    }
    
    public Cipher getCipher()
    {
      return this.b;
    }
    
    public Mac getMac()
    {
      return this.c;
    }
    
    public Signature getSignature()
    {
      return this.a;
    }
  }
  
  static final class a
    implements FingerprintManagerCompat.b
  {
    public final void a(Context paramContext, FingerprintManagerCompat.CryptoObject paramCryptoObject, int paramInt, CancellationSignal paramCancellationSignal, FingerprintManagerCompat.AuthenticationCallback paramAuthenticationCallback, Handler paramHandler)
    {
      Object localObject = null;
      if (paramCryptoObject != null) {
        if (paramCryptoObject.getCipher() != null) {
          paramCryptoObject = new FingerprintManagerCompatApi23.CryptoObject(paramCryptoObject.getCipher());
        }
      }
      for (;;)
      {
        if (paramCancellationSignal != null) {
          localObject = paramCancellationSignal.getCancellationSignalObject();
        }
        FingerprintManagerCompatApi23.authenticate(paramContext, paramCryptoObject, paramInt, localObject, new FingerprintManagerCompatApi23.AuthenticationCallback()
        {
          public final void onAuthenticationError(int paramAnonymousInt, CharSequence paramAnonymousCharSequence)
          {
            this.a.onAuthenticationError(paramAnonymousInt, paramAnonymousCharSequence);
          }
          
          public final void onAuthenticationFailed()
          {
            this.a.onAuthenticationFailed();
          }
          
          public final void onAuthenticationHelp(int paramAnonymousInt, CharSequence paramAnonymousCharSequence)
          {
            this.a.onAuthenticationHelp(paramAnonymousInt, paramAnonymousCharSequence);
          }
          
          public final void onAuthenticationSucceeded(FingerprintManagerCompatApi23.AuthenticationResultInternal paramAnonymousAuthenticationResultInternal)
          {
            FingerprintManagerCompat.AuthenticationCallback localAuthenticationCallback = this.a;
            paramAnonymousAuthenticationResultInternal = paramAnonymousAuthenticationResultInternal.getCryptoObject();
            if (paramAnonymousAuthenticationResultInternal != null) {
              if (paramAnonymousAuthenticationResultInternal.getCipher() != null) {
                paramAnonymousAuthenticationResultInternal = new FingerprintManagerCompat.CryptoObject(paramAnonymousAuthenticationResultInternal.getCipher());
              }
            }
            for (;;)
            {
              localAuthenticationCallback.onAuthenticationSucceeded(new FingerprintManagerCompat.AuthenticationResult(paramAnonymousAuthenticationResultInternal));
              return;
              if (paramAnonymousAuthenticationResultInternal.getSignature() != null) {
                paramAnonymousAuthenticationResultInternal = new FingerprintManagerCompat.CryptoObject(paramAnonymousAuthenticationResultInternal.getSignature());
              } else if (paramAnonymousAuthenticationResultInternal.getMac() != null) {
                paramAnonymousAuthenticationResultInternal = new FingerprintManagerCompat.CryptoObject(paramAnonymousAuthenticationResultInternal.getMac());
              } else {
                paramAnonymousAuthenticationResultInternal = null;
              }
            }
          }
        }, paramHandler);
        return;
        if (paramCryptoObject.getSignature() != null) {
          paramCryptoObject = new FingerprintManagerCompatApi23.CryptoObject(paramCryptoObject.getSignature());
        } else if (paramCryptoObject.getMac() != null) {
          paramCryptoObject = new FingerprintManagerCompatApi23.CryptoObject(paramCryptoObject.getMac());
        } else {
          paramCryptoObject = null;
        }
      }
    }
    
    public final boolean a(Context paramContext)
    {
      return FingerprintManagerCompatApi23.hasEnrolledFingerprints(paramContext);
    }
    
    public final boolean b(Context paramContext)
    {
      return FingerprintManagerCompatApi23.isHardwareDetected(paramContext);
    }
  }
  
  static abstract interface b
  {
    public abstract void a(Context paramContext, FingerprintManagerCompat.CryptoObject paramCryptoObject, int paramInt, CancellationSignal paramCancellationSignal, FingerprintManagerCompat.AuthenticationCallback paramAuthenticationCallback, Handler paramHandler);
    
    public abstract boolean a(Context paramContext);
    
    public abstract boolean b(Context paramContext);
  }
  
  static final class c
    implements FingerprintManagerCompat.b
  {
    public final void a(Context paramContext, FingerprintManagerCompat.CryptoObject paramCryptoObject, int paramInt, CancellationSignal paramCancellationSignal, FingerprintManagerCompat.AuthenticationCallback paramAuthenticationCallback, Handler paramHandler) {}
    
    public final boolean a(Context paramContext)
    {
      return false;
    }
    
    public final boolean b(Context paramContext)
    {
      return false;
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/hardware/fingerprint/FingerprintManagerCompat.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */