All Projects → ajalt → Reprint

ajalt / Reprint

Licence: apache-2.0
A unified fingerprint library for android.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Reprint

Rxfingerprint
Android Fingerprint authentication and encryption with RxJava
Stars: ✭ 373 (-20.13%)
Mutual labels:  rxjava, fingerprint, fingerprint-authentication
sourceafis-net
Fingerprint recognition engine for .NET that takes a pair of human fingerprint images and returns their similarity score. Supports efficient 1:N search.
Stars: ✭ 43 (-90.79%)
Mutual labels:  fingerprint, fingerprint-authentication
TMDB-App
Demo app using TMDB api
Stars: ✭ 13 (-97.22%)
Mutual labels:  reactivex, rxjava
Fingerprintauthhelper
A small library that allows You to easily manage fingererprint authentication inside your Activity or Fragment on devices with fingerprint scanner and Android M and higher. Min sdk 14
Stars: ✭ 444 (-4.93%)
Mutual labels:  fingerprint, fingerprint-authentication
Rxkotlinfx
Kotlin extensions to the RxJavaFX framework
Stars: ✭ 177 (-62.1%)
Mutual labels:  rxjava, reactivex
SSBiometricsAuthentication
Biometric factors allow for secure authentication on the Android platform.
Stars: ✭ 87 (-81.37%)
Mutual labels:  fingerprint, fingerprint-authentication
RxJava-Codelab
Codelab project for demonstration of RxJava features
Stars: ✭ 44 (-90.58%)
Mutual labels:  reactivex, rxjava
Rxjavafx
RxJava bindings for JavaFX
Stars: ✭ 489 (+4.71%)
Mutual labels:  rxjava, reactivex
fingerprint-gui
Use fingerprint readers with a Linux desktop environment
Stars: ✭ 47 (-89.94%)
Mutual labels:  fingerprint, fingerprint-authentication
Reactive
Reactive: Examples of the most famous reactive libraries that you can find in the market.
Stars: ✭ 256 (-45.18%)
Mutual labels:  rxjava, reactivex
Web3j
Lightweight Java and Android library for integration with Ethereum clients
Stars: ✭ 3,537 (+657.39%)
Mutual labels:  rxjava, reactivex
Rxjava2 Extras
Utilities for use with RxJava 2
Stars: ✭ 167 (-64.24%)
Mutual labels:  rxjava, reactivex
Rxanimationbinding
RxJava binding APIs for Android's animations
Stars: ✭ 82 (-82.44%)
Mutual labels:  rxjava, reactivex
servant
Serving you with GoogleApiClients any way you like them
Stars: ✭ 17 (-96.36%)
Mutual labels:  reactivex, rxjava
Rxkotlinfx Tornadofx Demo
A demo application demonstrating TornadoFX and Rx usage
Stars: ✭ 75 (-83.94%)
Mutual labels:  rxjava, reactivex
rxkotlin-jdbc
Fluent RxJava JDBC extension functions for Kotlin
Stars: ✭ 27 (-94.22%)
Mutual labels:  reactivex, rxjava
Fingerlock
Android fingerprint authentication library
Stars: ✭ 203 (-56.53%)
Mutual labels:  fingerprint, fingerprint-authentication
Cordova Plugin Fingerprint Aio
👆 📱 Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
Stars: ✭ 236 (-49.46%)
Mutual labels:  fingerprint, fingerprint-authentication
reactor-go
A golang implementation for reactive-streams.
Stars: ✭ 48 (-89.72%)
Mutual labels:  reactivex, rxjava
Rxbiometric
☝️ RxJava and RxKotlin bindings for Biometric Prompt (Fingerprint Scanner) on Android
Stars: ✭ 295 (-36.83%)
Mutual labels:  rxjava, fingerprint

Deprecated

Use androidx.biometric instead, which supports other forms of biometric authentication such as iris scanning an facial recognition, and provides a UI that is consistent across applications.

A simple, unified fingerprint authentication library for Android with RxJava extensions.

  • Eliminates the need to deal with the different available Fingerprint APIs, including Imprint and Samsung Pass.
  • Fixes undocumented bugs and idiosyncrasies in the underlying APIs.
  • Supports more Imprint devices than FingerprintManagerCompat from the androidx library.
  • Comes with help messages translated in over 80 locales that work with all APIs.
  • Provides optional RxJava interfaces.

Usage

See the sample app for a complete example.

In your Application.onCreate, initialize Reprint with Reprint.initialize(this). This will load the Marshmallow module, and the Spass module if you included it.

Then, anywhere in your code, you can call Reprint.authenticate to turn on the fingerprint reader and listen for a fingerprint. You can call Reprint.cancelAuthentication to turn the reader off before it finishes normally.

There are two ways to be notified of authentication results: traditional callback, and a ReactiveX Observable.

RxJava interface

If you include the reactive reprint library, you can be notified of authentication results through an Observable (or Flowable with RxJava 2) by calling RxReprint.authenticate. In this case, the subscriber's onNext will be called after each failure and after success.

RxReprint.authenticate()
    .subscribe(result -> {
        switch (result.status) {
            case SUCCESS:
                showSuccess();
                break;
            case NONFATAL_FAILURE:
                showHelp(result.failureReason, result.errorMessage);
                break;
            case FATAL_FAILURE:
                showError(result.failureReason, result.errorMessage);
                break;
        }
    });

The failureReason is an enum value with general categories of reason that the authentication failed. This is useful for displaying custom help messages in your UI.

The errorMessage is a string that will contain some help text provided by the underlying SDK about the failure. You should show this text to the user, or some other message of your own based on the failureReason. This string will never be null from a failure, and will be localized into the current locale.

For detail on the other parameters, see the Javadocs.

One advantage that this interface has is that when the subscriber unsubscribes, the authentication request is automatically canceled. So you could, for example, use the RxLifecycle library to bind the observable, and the authentication will be canceled when your activity pauses.

Traditional Callbacks

If you want to use Reprint without RxJava, you can pass an AuthenticationListener to authenticate. The onFailure callback will be called repeatedly until the sensor is disabled or a fingerprint is authenticated correctly, at which point onSuccess will be called.

Reprint.authenticate(new AuthenticationListener() {
    public void onSuccess(int moduleTag) {
        showSuccess();
    }

    public void onFailure(AuthenticationFailureReason failureReason, boolean fatal,
                          CharSequence errorMessage, int moduleTag, int errorCode) {
        showError(failureReason, fatal, errorMessage, errorCode);
    }
});

Documentation

The javadocs for the Reprint modules are available online:

Installation

Reprint is distributed with jitpack and split up into several libraries, so you can include only the parts that you use.

First, add Jitpack to your gradle repositories.

repositories {
    maven { url "https://jitpack.io" }
}

Then add the core library and optionally the Samsung Pass interface and the ReactiveX interface. Reprint provides support for both RxJava 1 and 2; you should include the module that matches the version of RxJava that you use in your project.

dependencies {
   compile 'com.github.ajalt.reprint:core:[email protected]' // required: supports marshmallow devices
   compile 'com.github.ajalt.reprint:reprint_spass:[email protected]' // optional: deprecated support for pre-marshmallow Samsung devices
   compile 'com.github.ajalt.reprint:rxjava:[email protected]' // optional: the RxJava 1 interface
   compile 'com.github.ajalt.reprint:rxjava2:[email protected]' // optional: the RxJava 2 interface
}

Permissions

Reprint requires the following permissions be declared in your AndroidManifest.xml. As long as you use the aar artifacts, these permissions will be included automatically.

<!-- Marshmallow fingerprint permission-->
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>

<!-- Samsung fingerprint permission, only required if you include the Spass module -->
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>

Spass SDK deprecation

Samsung has deprecated the Spass SDK in favor of the standard Android APIs. Although Reprint still provides a module that uses the the Spass SDK if the standard APIs aren't available, you should be aware that the Spass SDK has a known bug. If you don't need fingerprint support on devices running KitKat, you should not include the reprint_spass module.

License

Copyright 2015-2019 AJ Alt

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].