Giter VIP home page Giter VIP logo

fingerprint's Introduction

Fingerprint Download

Fingerprint is an Android library that simplifies the process of fingerprint authentications. The library provides a fingerprint view that you can use like regulars xml views. Furthermore, it can display dialogs to perform fingerprint authentication very easily.

In both cases the Fingerprint library implements in a simple way the use of a CryptoObject.

Gradle Dependency

implementation 'me.aflak.libraries:fingerprint:2.5.3'

Fingerprint View

The library provides a Fingerprint object which is a view that you can display the way you want and use for authentications. Customizations are at the end of the README.

<me.aflak.libraries.view.Fingerprint
    android:id="@+id/fingerprint"
    android:layout_width="200dp"
    android:layout_height="200dp"/>

Without CryptoObject

You only want to check if the user's fingerprint is enrolled in the phone.

Fingerprint fingerprint = findViewById(R.id.fingerprint);
fingerprint.callback(new FingerprintCallback(...));
fingerprint.authenticate();

EXAMPLE

With CryptoObject

Check if the user's fingerprint is enrolled in the phone and detect if a new fingerprint was added since last time authentication was used.

Fingerprint fingerprint = findViewById(R.id.fingerprint);
fingerprint.callback(new FingerprintDialogSecureCallback(...), "Key");
fingerprint.authenticate();

EXAMPLE

Fingerprint Dialog

Without CryptoObject

You only want to check if the user's fingerprint is enrolled in the phone.

FingerprintDialog.initialize(this)
    .title(R.string.title)
    .message(R.string.message)
    .callback(new FingerprintDialogCallback(...))
    .show();

EXAMPLE

With CryptoObject

Check if the user's fingerprint is enrolled in the phone and detect if a new fingerprint was added since last time authentication was used.

FingerprintDialog.initialize(this)
    .title(R.string.title)
    .message(R.string.message)
    .callback(new FingerprintDialogSecureCallback(...), "Key")
    .show();

EXAMPLE

Secure a CryptoObject via authentication

CryptoObject can be used to perform cryptographic operations on Android. You can set the CryptoObject to be valid only if the user has authenticated via fingerprint before. You have to use setUserAuthenticationRequired(true) when creating the CryptoObject.

FingerprintManager.CryptoObject cryptoObject;
// cryptoObject = ...

if(FingerprintDialog.isAvailable(this)) {
    FingerprintDialog.initialize(this)
        .title(R.string.fingerprint_title)
        .message(R.string.fingerprint_message)
        .callback(new FingerprintCallback(...))
        .cryptoObject(cryptoObject)
        .show();
}

Customization

You can customize the fingerprint view directly from the xml.

<me.aflak.libraries.view.Fingerprint
    xmlns:fingerprint="http://schemas.android.com/apk/res-auto"
    fingerprint:circleScanningColor="@android:color/black"
    fingerprint:fingerprintScanningColor="@color/colorAccent"
    android:id="@+id/fingerprint"
    android:layout_width="200dp"
    android:layout_height="200dp" />

Several functions are also available to customize your dialog.

FingerprintDialog.initialize(this)
    .title(R.string.fingerprint_title)
    .message(R.string.fingerprint_message)
    .enterAnimation(DialogAnimation.Enter.RIGHT)
    .exitAnimation(DialogAnimation.Exit.RIGHT)
    .circleScanningColor(R.color.colorAccent)
    .callback(this)
    .show();

Rendering

License

MIT License

Copyright (c) 2017 Michel Omar Aflak

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

fingerprint's People

Contributors

omaraflak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fingerprint's Issues

Issue with manifest file

There is some issue while adding this library to project.
I have multiple libraries added to my own project. Now, when I add this library, I show manifest merger error.
This might be because the library using some provider that conflict to existing providers (Not sure).

Please look at this issue and resolved it.

Thanks.

AndroidX

Please migrate this awesome lib to to AndroidX
Also Please use ConstraintLayout - performance issue and views overlapping

Automatically scanning

I have used it in my own Dialog box, when I open the Dialog box the first time then it works perfectly. But when I open my Dialog after dismiss it then it scans fingerprint automatic and calls method "onAuthenticationError" called with error code "5" and the error message "Fingerprint Operation cancelled".

Minimum SDK Version problem

I am going to use this library but my application use sdk 19.
Do you have certain reason why this library minimum sdk is 23?

Deprecation Notice

To make it easier for the newcomers:
This library is deprecated since the release of the androidx library for the BiometricPrompt API.

If you want to combine the BiometricPrompt API with a symmetric key,
then you can have a look at this fully functional Kotlin implementation:
https://github.com/fkirc/secure-zip-notes/

Cancel dialog

Hello, I am trying to cancel the fingerprint dialog when reach a limit with tryLimit() but I have no idea what does this function. I need some help please. Here is an extract of my code.
FingerprintDialog.initialize(this).tryLimit(1, () -> Toast.makeText(getApplicationContext(), "Has alcanzado el limite máximo de intentos", Toast.LENGTH_LONG).show())

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.