mjwheatley / cordova-plugin-android-fingerprint-auth Goto Github PK
View Code? Open in Web Editor NEWA cordova plugin for fingerprint authentication using the hardware fingerprint scanner on devices running Android 6+
License: Apache License 2.0
A cordova plugin for fingerprint authentication using the hardware fingerprint scanner on devices running Android 6+
License: Apache License 2.0
Hello,
I admit, I dont have a deep knowledge about Encryption Techniques, but I would like to ask the following:
Thanks!
Christoph
While testing this plugin on Android 6 emulator, I get unexpected app termination attempting to call FingerprintAuth.show() (after a successful call to FingerprintAuth.isAvailable() that indicates fingerprints are available and enrolled):
V/FingerprintAuth: Init FingerprintAuth
V/FingerprintAuth: FingerprintAuth action: availability
W/CordovaPlugin: Attempted to send a second callback for ID: FingerprintAuth1796866245
Result was: "OK"
V/FingerprintAuth: FingerprintAuth action: authenticate
W/CordovaPlugin: Attempted to send a second callback for ID: FingerprintAuth1796866267
Result was: "Error"
W/CordovaPlugin: Attempted to send a second callback for ID: FingerprintAuth1796866267
Result was: "InvalidKeyException"
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp, PID: 1019
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.cordova.plugin.android.fingerprintauth.FingerprintAuthenticationDialogFragment.setCryptoObject(android.hardware.fingerprint.FingerprintManager$CryptoObject)' on a null object reference
at com.cordova.plugin.android.fingerprintauth.FingerprintAuth$1.run(FingerprintAuth.java:196)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Details:
Investigating with debugger shows InvalidAlgorithmParameterException raised (and caught) in createKey() method with this message (when executing the "authenticate" action):
"java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use"
Since this error case is never acted on to abort the call, this in turn causes initCipher() to fail with InvalidKeyException (message "Unsupported key: null"), falling through to the "else" statement, whereby mFragment is null as it is never initialised (hence crash).
Any idea what is causing this or how to fix it? Thanks!
Could you provide a little more detail in the README regarding the use of the clientSecret?
I'm guessing this key needs to be protected and probably stored securely... recommendations would be nice.
Hi Guys,
Would like to seek help on using this plugin, when i call the function
FingerprintAuth.isAvailable
it returns
Object {isAvailable: false, isHardwareDetected: false, hasEnrolledFingerprints: false}
I am using Cordova and Samsung S5, my screenlock is fingerprint enabled also, anything i missed? tia!
Steps to replicate:
Note: the clientId and clientSecret remained unchanged for all steps.
I am using this plugin for finger print authentication when i pass the params clientid and client secret as empty that time also its recognize the finger print. Then what is the purpose of client id and client secret
Hi,
Issue 1 :
When I add new Finger Prints in my device, then I am getting the following exception.
Failed to init Cipher : invalidKeyException
If I changed my ClientID and Key then it was working fine...
So, can I know what it is doing after adding finger prints ....?
Issue 2 :
If I placed wrong finger, it allows up to five attempts after that I waited for 30 seconds and then I placed my finger but it is not doing any thing. It is again reactivating only after relaunch the popup.
Can you please help me in fixing these two issues.
While trying to validate through fingerprint on device(Lenovo K5 note), it recognizes fingerprint but it give below error:
"Authentication invalid Failed to encrypt the data with the generated key: IllegalBlockSizeException: null"
I have set clientid as alias of keystore and clientsecret as "android".
Please give some suggestion to resolve issue.
We are using samsung device with android version 6. Fingerprint is available. However, when isAvailabeSuccess method is called, we are not getting fingerprint scan dialogue box to validate fingerprint and login into app. Also, result.isAvailable is true.
For testing purpose, we are using clientId: "AppName" and clientSecret: "123456789".
How should we get this fixed and get fingerprint scan dialogue box?
function isAvailableSuccess(result) { alert("FingerprintAuth available: " + JSON.stringify(result) + "Result: " + result.isAvailable); if (result.isAvailable) { FingerprintAuth.show({ clientId: "CargoTrak", clientSecret: "123456789" , }, successCallback, errorCallback); } }
Currently, it's:
cordova plugin add cordova-plugin-candroid-fingerprint-auth
but it should really be:
cordova plugin add cordova-plugin-android-fingerprint-auth
๐
Hi, thanks for take the time to write a plugin for this android feature !
I would like to know specifically which values should have the clientId and clientSecret parameters.
FingerprintAuth.show({
clientId: "My Super App",// or is the package instead ???? : com.mycompany.mysuperapp
clientSecret: "a_very_secret_encryption_key" // how do i get a client secret?
}, successCallback, errorCallback);
I'm searching on the google documentation but it is not clear to me. Can i set any value for clientId and clientSecret ?.
I mean with a random secret id it is working, but this is the best practice? I would really appreciate if you give me info about this.
Thanks !
Hi,
When the fingerprint auth screen is shown , I get the pop up with enter passcode and cancel button . However when I tap on cancel there is no callback available where if I want to perform another operation . Is there a callback functionality available for cancel ?
I can't reproduce this consistently. It's usually when the app is launching after it's been backgrounded for a while.
I'm essentially using version 1.2.2 of the plugin. So far only seen on Android 7.1, Nexus 5X (bullhead).
java.lang.RuntimeException: Unable to start activity ComponentInfo{ca.koho/ca.koho.Koho}: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:190)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2101)
at android.content.res.Resources.getLayout(Resources.java:1115)
at android.view.LayoutInflater.inflate(LayoutInflater.java:424)
at com.cordova.plugin.android.fingerprintauth.FingerprintAuthenticationDialogFragment.onCreateView(FingerprintAuthenticationDialogFragment.java:85)
at android.app.Fragment.performCreateView(Fragment.java:2353)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153)
at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2039)
at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:176)
at android.app.Activity.performCreateCommon(Activity.java:6673)
at android.app.Activity.performCreate(Activity.java:6681)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
... 9 more
I am using following code,
FingerprintAuth.isAvailable(function(result) { if (result.isAvailable) { if(result.hasEnrolledFingerprints){ FingerprintAuth.show({ clientId: client_id, clientSecret: client_secret }, function (result) { if (result.withFingerprint) { alert("Successfully authenticated using a fingerprint"); } else if (result.withPassword) { alert("Authenticated with backup password"); } }, function(error) { alert("ERROR : " + error); console.log(error); // "Fingerprint authentication not available" }); }else{ alert("Fingerprint auth available, but no fingerprint registered on the device"); } } }, function(message) { alert("Cannot detect fingerprint device : "+ message); });
I'm getting this error:
Error: FingerprintAuth is not defined
@http://192.168.0.5:8100/js/controllers.js:99:1
e@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:67:313
h/<.instantiate@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:67:432
Fe/this.$get</<@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:107:3
I.appendViewElement@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:385:1024
L.create/z.render@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:384:15511
L.create/z.init@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:384:14746
I.render@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:385:62
I.register@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:384:31838
a@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:386:2325
.compile/<@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:386:2485
$@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:101:149
v@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:90:203
g@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:82:299
v@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:90:147
g@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:82:299
v@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:90:147
g@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:82:299
E/<@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:81:413
I.appendViewElement@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:385:1098
L.create/z.render@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:384:15511
L.create/z.init@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:384:14746
I.render@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:385:62
I.register@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:384:31838
a@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:386:2325
.compile/</<@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:386:2430
Pe/this.$get</l.prototype.$broadcast@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:159:120
u/x.transitionTo/x.transition<@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:361:17403
f/<@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:143:20
Pe/this.$get</l.prototype.$eval@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:156:301
Pe/this.$get</l.prototype.$digest@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:153:390
Pe/this.$get</l.prototype.$apply@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:157:56
l@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:112:169
P@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:116:301
vf/</w.onload@http://192.168.0.5:8100/lib/ionic/js/ionic.bundle.min.js:117:315
Hi there!
First of all, great job man. There are lots of people waiting for this :)
There is any plan to port this to ng-cordova? I could be great to make it work in a easy way with ionic or a stand alone angular app.
Thank you
Hi,
I'm testing a bare sample of this plugin, I just want to ask what to ask if I'm missing something because I'm getting an error of BadPaddingException: javax.crypto.AEADBadTagException, error callback of encrypt is called.
I'm sure fingerprint is available: {"isAvailable":true,"isHardwareDetected":true,"hasEnrolledFingerprints":true}
This is my config:
var encryptConfig = {
clientId: "com.phonegap.sample.Sample",
username: "currentUser",
password: "currentUserPassword"
};
and I called it with FingerprintAuth.encrypt(encryptConfig, encryptSuccessCallback, encryptErrorCallback);
encryptErrorCallback is called after dialog is showed and I successfully scanned my fingerprint. I'm using a rooted xiaomi 3s if it's any help.
Thanks
Hi,
Plugin is crashing when the power button is pressed and the fingerprint fragment is displayed. It's treating this as an error (' Fingerprint operation canceled.') and then trying to dismiss the fragment, but it appears that dismissing is not valid at that point.
Relevant guidance:
http://www.androiddesignpatterns.com/2013/08/fragment-transaction-commit-state-loss.html
Android: 7.1.1
Plugin: 1.2.2
01-09 13:03:16.808 26489 26489 E AndroidRuntime: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1434)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1452)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.app.BackStackRecord.commitInternal(BackStackRecord.java:708)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.app.BackStackRecord.commit(BackStackRecord.java:672)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.app.DialogFragment.dismissInternal(DialogFragment.java:301)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.app.DialogFragment.dismiss(DialogFragment.java:267)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at com.cordova.plugin.android.fingerprintauth.FingerprintAuthenticationDialogFragment.onError(FingerprintAuthenticationDialogFragment.java:271)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at com.cordova.plugin.android.fingerprintauth.FingerprintUiHelper$1.run(FingerprintUiHelper.java:113)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:751)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6119)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 01-09 13:03:16.808 26489 26489 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
01-09 13:03:16.808 26489 26489 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Hi,
I am using the plugin but it is not working for me. I am using S7 Edge with Android 6.0.1 and Ionic View to test the authentication.
Regards
Matthias
I have Samsung Galaxy S5 and my issue is that isAvailableSuccess()
always results in 3x false through I have fingerprints set up on my device and using them for unlock. I run Ionic debug build as ionic run android -lsc
Do I need some special permission for this?
Thanks
Hello Matthew Wheatley.
I am using the plugin however when I change the language to French or Chines it does not alter the strings. Only Spanish and English this ok
var params = {
clientId: deviceUtils.ANDROID_FINGERPRINT_ID,
clientSecret: clientSecret,
locale: 'fr'
};
FingerprintAuth.show(params, vm.sucess vm.error);
I do not know if I'm doing something wrong?
This is the code i have provided but my doubt is when you will pass the client id and secret key what will we get because i am not getting the encoded base 64 format value when i passed it and giving the error "illegal block size exception".
$(document).ready(function(){
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady()
{
function successCallback(result) {
console.log(result);
console.log("successCallback(): " + JSON.stringify(result));
if (result.withFingerprint) {
console.log("Successfully authenticated using a fingerprint");
} else if (result.withPassword) {
console.log("Authenticated with backup password");
}
}
function errorCallback(error) {
console.log(error); // "Fingerprint authentication not available"
}
if (device.platform === "Android" && device.version.startsWith("6.")) {
FingerprintAuth.isAvailable(isAvailableSuccess, isAvailableError);
}
function isAvailableSuccess(result) {
console.log("FingerprintAuth available: " + JSON.stringify(result));
if (result.isAvailable) {
FingerprintAuth.show({
clientId :"myAppName",
clientSecret: "a_very_secret_encryption_key"
}, successCallback, errorCallback);
}
}
function isAvailableError(message) {
console.log("isAvailableError(): " + message);
}
}
});
here in the place of client id and secret key i am passing the value which is given by one backhand team and not able to get the output.
Getting the following error when including the fingerprint-auth plugin.
/officeWork/Mac/ionic app tirals/test/platforms/android/src/com/cordova/plugin/android/fingerprintauth/FingerprintAuth.java:399: error: method does not override or implement a method from a supertype
@Override
^
/officeWork/Mac/ionic app tirals/test/platforms/android/src/com/cordova/plugin/android/fingerprintauth/FingerprintAuth.java:402: error: cannot find symbol
super.onRequestPermissionResult(requestCode, permissions, grantResults);
^
symbol: method onRequestPermissionResult(int,String[],int[])Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.15 secs
/officeWork/Mac/ionic app tirals/test/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /officeWork/Mac/ionic app tirals/test/platforms/android/gradlew with args: cdvBuildDebug,-b,/officeWork/Mac/ionic app tirals/test/platforms/android/build.gradle,-Dorg.gradle.daemon=true
Error: /officeWork/Mac/ionic app tirals/test/platforms/android/cordova/build: Command failed with exit code 1
ionic info gives the following details
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.46
ios-deploy version: 1.7.0
ios-sim version: 4.1.1
OS: macOS Sierra
Node Version: v4.1.2
Xcode version: Xcode 7.3.1 Build version 7D1014
sudo cordova --version
6.4.0
also made sure that android SDK is updated
android update sdk --no-ui --all --filter "extra-android-m2repository"
Using the example code, I modified it for my phonegap "app". I'm running this on my Android device (Galaxy s7). The .isAvailable() code runs fine.
However, the .show() always calls the callback before the fingerprint has even been used. So, when cancelling, these are the 2 alerts print every time:
success: OK withFingerprint: undefined
fail: Cancelled
Is this the desired behavior?
are we to watch for specific messages to know if it is truly success or failure?
FingerprintAuth.isAvailable(isAvailableSuccess, isAvailableError);
isAvailableSuccess: function(result) {
console.log("FingerprintAuth available: " + JSON.stringify(result));
if (result.isAvailable) {
FingerprintAuth.show({
clientId: "myAppName",
clientSecret: "a_very_secret_encryption_key"
}, app.successcallback, app.failcallback);
}
},
successcallback: function(msg) {
app.showData();
alert("success: "+msg + " withFingerprint:" + msg.withFingerprint);
},
failcallback: function(msg) {
alert("fail: " + msg);
},
When I add a new fingerprint Plugin shows the backup validation (not regular fingerprint dialog). But the problem is it has fingerprint option too. That means I can use fingerprint as the backup validation when fingerprint are changed.
Is it possible to ignore fingerprint changes and show fingerprint dialog as normal?
Or would it be possible to show only the PIN or passcode in backup validation?
Device: HTC 10
Version: 6.0.1
Thank you.
Hi,
Using plugin version 1.2.2.
Android version 7.1.1 (Nexus 5X)
When I set 'userAuthRequired' to false, the PIN is still being required on the first use of the key. I was expected that not to be the case.
Here's a snippet of the call to encrypt:
$window.FingerprintAuth.encrypt({
clientId: ENV.appId,
dialogMessage: 'Message',
userAuthRequired: false,
disableBackup: true
},
Since backup is disabled, the call to encrypt fails.
@mjwheatley, I'm I understanding the intention of 'userAuthRequired' correctly? If so, any idea what's happening?
Thanks for your work on this!
while clicking the fingerprint sensor it is going to this function
function errorCallback(error) {
console.log(error); // "Fingerprint authentication not available"
}
and giving the error in console Failed to encrypt the data with the generated key: IllegalBlockSizeException: null
Hi,
The scenario where the application is crashing is such that when we keep on scanning for the wrong fingerprint and after 5 or 6 times and then when i click on cancel ; the app crashes.
Regards
My cordova project already contains a build-extras.gradle
file. When I cordova plugin add cordova-plugin-android-fingerprint-auth
it results in the following error:
Fetching plugin "cordova-plugin-android-fingerprint-auth" via npm
Installing "cordova-plugin-android-fingerprint-auth" for android
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-android-fingerprint-auth':Error: Uh oh!
"/Users/me/Documents/Projects/project-name/platforms/android/build-extras.gradle" already exists!
I've had to manually remove my existing build-extras.gradle file, then merge in the contents for this plugin - is this something that could be handled automatically?
Hey guys,
I'm not sure if this is an issue, but wouldn't be logic that if the plugin does not detect fingerprint hardware to fallback to backup methods (PIN, Pattern or Password) ... I've been looking for a way to do this.
Can anyone point me to the right direction?
There should be a FingerprintAuth.hide() method to hide the dialog.
HI
I have added this fingerprint authentication plugin in my worklight application,But i am getting below errors in logcat. Please let me know what need to be done to solve this issue
11-14 11:12:47.671: W/PluginManager(30565): THREAD WARNING: exec() call to FingerprintAuth.authenticate blocked the main thread for 33ms. Plugin should use CordovaInterface.getThreadPool().
11-14 11:12:47.671: D/FingerprintAuth(30565): mFragment = new FingerprintAuthenticationDialogFragment()
11-14 11:12:47.692: D/FingerprintAuth(30565): insdie initCipher()
11-14 11:12:47.712: D/FingerprintAuthDialog(30565): disableBackup: false
11-14 11:12:47.713: W/ResourceType(30565): No package identifier when getting value for resource number 0x00000000
11-14 11:12:47.713: D/AndroidRuntime(30565): Shutting down VM
11-14 11:12:47.716: E/AndroidRuntime(30565): FATAL EXCEPTION: main
11-14 11:12:47.716: E/AndroidRuntime(30565): Process: com.fingerPrint, PID: 30565
11-14 11:12:47.716: E/AndroidRuntime(30565): android.content.res.Resources$NotFoundException: Resource ID #0x0
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.content.res.Resources.getValue(Resources.java:1351)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2777)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.content.res.Resources.getLayout(Resources.java:1165)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.view.LayoutInflater.inflate(LayoutInflater.java:421)
11-14 11:12:47.716: E/AndroidRuntime(30565): at com.fingerPrint.FingerprintAuthenticationDialogFragment.onCreateView(FingerprintAuthenticationDialogFragment.java:87)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.app.Fragment.performCreateView(Fragment.java:2220)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.app.BackStackRecord.run(BackStackRecord.java:793)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1537)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.app.FragmentManagerImpl$1.run(FragmentManager.java:482)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.os.Handler.handleCallback(Handler.java:746)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.os.Handler.dispatchMessage(Handler.java:95)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.os.Looper.loop(Looper.java:148)
11-14 11:12:47.716: E/AndroidRuntime(30565): at android.app.ActivityThread.main(ActivityThread.java:5443)
11-14 11:12:47.716: E/AndroidRuntime(30565): at java.lang.reflect.Method.invoke(Native Method)
11-14 11:12:47.716: E/AndroidRuntime(30565): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
11-14 11:12:47.716: E/AndroidRuntime(30565): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): Logger$UncaughtExceptionHandler.uncaughtException in Logger.java:471 :: Uncaught Exception
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): android.content.res.Resources$NotFoundException: Resource ID #0x0
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.content.res.Resources.getValue(Resources.java:1351)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2777)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.content.res.Resources.getLayout(Resources.java:1165)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.view.LayoutInflater.inflate(LayoutInflater.java:421)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at com.fingerPrint.FingerprintAuthenticationDialogFragment.onCreateView(FingerprintAuthenticationDialogFragment.java:87)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.app.Fragment.performCreateView(Fragment.java:2220)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.app.BackStackRecord.run(BackStackRecord.java:793)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1537)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.app.FragmentManagerImpl$1.run(FragmentManager.java:482)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.os.Handler.handleCallback(Handler.java:746)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.os.Handler.dispatchMessage(Handler.java:95)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.os.Looper.loop(Looper.java:148)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at android.app.ActivityThread.main(ActivityThread.java:5443)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at java.lang.reflect.Method.invoke(Native Method)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
11-14 11:12:47.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(30565): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
11-14 11:12:47.723: D/com.worklight.wlclient.api.WLLifecycleHelper(30565): WLLifecycleHelper.logAppSession in WLLifecycleHelper.java:109 :: Tried to record an app crash without a starting timestamp
For example i call function FingerprintAuth.show
with maxAttempts = 3
. Then i failed all attempts. After error message about too many attempts, dialog was closed. And this is fine.
But after i called this function the second time with the same parameters, then i receive the same message after only 2 failed attempts. I guess this happens because there are exists some system counter in Android, that ingores our custom counter.
Hi,
Any thoughts about the following crash:
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1411)
at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1429)
at android.app.BackStackRecord.commitInternal(BackStackRecord.java:687)
at android.app.BackStackRecord.commit(BackStackRecord.java:663)
at android.app.DialogFragment.show(DialogFragment.java:231)
at com.cordova.plugin.android.fingerprintauth.FingerprintAuth$1.run(FingerprintAuth.java:300)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Here's a snippet around the line from FingerprintAuth:
// This happens if the lock screen has been disabled or or a fingerprint got
// enrolled. Thus show the dialog to authenticate with their password
mFragment.setCryptoObject(new FingerprintManager.CryptoObject(mCipher));
mFragment.setStage(FingerprintAuthenticationDialogFragment.Stage.NEW_FINGERPRINT_ENROLLED);
mFragment.show(cordova.getActivity().getFragmentManager(), DIALOG_FRAGMENT_TAG);
My quick attempt at research seems to suggest that showing the fragment is happening asynchronously after such actions should be taken?
Seems to be affecting a variety of 6+ devices.
Thanks for any help.
I am using this plugin in my cordova project using visual studio.
The code below seems to failed when run in any device where as the finger print is supported on the device.
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkID=397704
// To debug code on page load in Ripple or on Android devices/emulators: launch your app, set breakpoints,
// and then run "window.location.reload()" in the JavaScript Console.
(function () {
"use strict";
document.addEventListener( 'deviceready', onDeviceReady.bind( this ), false );
function onDeviceReady() {
// Handle the Cordova pause and resume events
document.addEventListener( 'pause', onPause.bind( this ), false );
document.addEventListener( 'resume', onResume.bind( this ), false );
// TODO: Cordova has been loaded. Perform any initialization that requires Cordova here.
var parentElement = document.getElementById('deviceready');
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
alert(FingerprintAuth);
FingerprintAuth.isAvailable(isAvailableSuccess, isAvailableError);
};
function isAvailableSuccess(result) {
console.log("FingerprintAuth available: " + JSON.stringify(result));
alert(result.isAvailable);
if (result.isAvailable) {
var encryptConfig = {
clientId: "myAppName",
username: "currentUser",
password: "currentUserPassword"
}; // See config object for required parameters
FingerprintAuth.encrypt(encryptConfig, successCallback, errorCallback);
}
}
function isAvailableError(message) {
console.log("isAvailableError(): " + message);
}
function successCallback(result) {
console.log("successCallback(): " + JSON.stringify(result));
if (result.withFingerprint) {
console.log("Successfully encrypted credentials.");
console.log("Encrypted credentials: " + result.token);
} else if (result.withBackup) {
console.log("Authenticated with backup password");
}
}
function errorCallback(error) {
if (error === "Cancelled") {
console.log("FingerprintAuth Dialog Cancelled!");
} else {
console.log("FingerprintAuth Error: " + error);
}
}
function onPause() {
// TODO: This application has been suspended. Save application state here.
};
function onResume() {
// TODO: This application has been reactivated. Restore application state here.
};
} )();
What could possibly be wrong as the android emulator also able to run plugin, really can't figure out the issue.
The plugin execute but simple return false that fingerprint not supported.
Do I have to give special permission to App or inside mobile allow some option.
any help would be appreciated.
Do we have any feature to get notified when finger print change happend in android device setting through cordova plugin?
I use following config:
var decryptConfig = {
clientId: getServiceName(),
username: getEmail(),
token: getToken(),
disableBackup: true,
dialogTitle: TOUCH_VIA_ANDROID,
locale: 'de'
};
FP-Dialog show all strings on english! But if I try to do it quickly, so I can see error-text on germany language.
if I change locale config on "ru" or "es" it work fine!
In our use of your excellent app, our test team discovered that Japanese is not one of your supported translation languages. Is this correct and if so, do you have plans to add. We do have translation services available and might be able to provide the string translations....
How to change texts in Fingerprint dialog (e.g. "Confirm fingerprint to continue")?
Can we set custom text when authenticating using FingerprintAuth.show() ?
Thank you.
Using samsung Galaxy s5 and I do have registered fingerprint in my device.
Please provide any solution for this.
When fingerprint auth is shown in the application and system lockscreen locks the phone it is not possible to unlock with fingerprint.
We are trying to build the app and publish on Google Play with fingerprint plugin. We also updated plugin with version 0.3.1. However, we are getting below error:
` error : Server build failed. Server output: Project "CargoTrak.tmp.proj" (default targets):
android Build Tooling revision 2016.10.19.7r
Build Tooling Hostname ab-linuxbpc-2
Warning: Error during processing of action! Attempting to revert...
Warning: Failed to install 'cordova-plugin-android-fingerprint-auth':Error: Uh oh!
"/tmp/builds/madNITBPlm677RfnFM/app/Plugins/android-fingerprint/res/android/values-ru" not found!
at Object.module.exports.common.copyFile (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/platforms/common.js:38:40)
at Object.module.exports.common.copyNewFile (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/platforms/common.js:69:16)
at module.exports.source-file.install (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/platforms/android.js:78:20)
at /home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/platforms/PlatformApiPoly.js:662:27
at Object.ActionStack.process (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-common/src/ActionStack.js:56:25)
at PlatformApiPoly.addPlugin (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/platforms/PlatformApiPoly.js:262:20)
at handleInstall (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/install.js:605:6)
at /home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/install.js:394:24
at _fulfilled (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/q/q.js:816:30)
Warning: Uh oh!
"/tmp/builds/madNITBPlm677RfnFM/app/Plugins/android-fingerprint/res/android/values-ru" not found!
Warning: /home/builder/BpcTooling/Cordova3/node_modules/cordova-build-utils/bin/install-plugins-3.js:190
throw Error("exit code: " + code);
^
Error: exit code: 1
at Error (native)
at ChildProcess. (/home/builder/BpcTooling/Cordova3/node_modules/cordova-build-utils/bin/install-plugins-3.js:190:14)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
Error: Build failed during execution
Error: 'Build failed with error code 1'
Done building project "CargoTrak.tmp.proj" -- FAILED.
.
Done building project "CargoTrak.iceproj" -- FAILED.
Build FAILED.
`
Hi,
I am using this plugin in MobileFirst Application (HTML, CSS and Javascript). When the show() method is being called, my application crashes. I am testing the application on Samsung S6 Edge and it has Android Marshmallow (6.0.1). When I checked the logs, it was giving an error Resource Not Found Exception
Please Help
Hi, I was expecting that clicking on back button on this screen would take me back to the fingerprint scanner back again, instead it results cancelled the same way if I pressed "cancel". Is this okay? Shouldn't it go back to the previous screen so it doesn't break the back button behaviour?
Hi, I need some more information about this plugin. Like, do we need to add any libraries for this? Compatible with which Android devices..? etc.
Hi,
Iam still not sure what to use for the a_very_secret_encryption_key ?
FingerprintAuth.show({
clientId: "myAppName",
clientSecret: "a_very_secret_encryption_key"
}, successCallback, errorCallback);
I saw a similar question.
Appreciate if anyone can provide an example.
Thanks
Is there a way to handle failed authentications (i.e. fingerprint/pin didn't match)
My use case would be to track the number of times a fingerprint has failed and after x attempts, cancel the dialog.
The other issue occurring out of this is that after x number of failed fingerprint attempts, it goes to the device's pin (or whatever your device has as a backup for your fingerprint).
I already have a built in pin page on the app I'm working on. Having it switch to the device's pin page rather than canceling the dialog to show the app's pin page would be confusing. (As they may have a different pin for their device and for their app)
If you'd like me to clarify more or add in more examples of what I'm looking for, let me know.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.