Comments (9)
Clicking on Wrong Fingerprint ; crashes the application
from cordova-plugin-android-fingerprint-auth.
Please provide the error message from logcat.
from cordova-plugin-android-fingerprint-auth.
I don't have the logcat logs as my device system admin has been blocked. Even if i press the wrong finger in the home screen button; the mobile app is crashing
from cordova-plugin-android-fingerprint-auth.
I am using Samsung Galaxy 7 mobile.
from cordova-plugin-android-fingerprint-auth.
public void onAuthenticationFailed() {
mAttempts++;
int fingerprint_not_recognized_id = mContext.getResources()
.getIdentifier("fingerprint_not_recognized", "string",
FingerprintAuth.packageName);
int fingerprint_too_many_attempts_id = mContext.getResources()
.getIdentifier("fingerprint_too_many_attempts", "string",
FingerprintAuth.packageName);
final String too_many_attempts_string = mIcon.getResources().getString(
fingerprint_too_many_attempts_id);
if (mAttempts > FingerprintAuth.mMaxAttempts) {
showError(too_many_attempts_string);
mIcon.postDelayed(new Runnable() {
@OverRide
public void run() {
mCallback.onError(too_many_attempts_string);
}
}, ERROR_TIMEOUT_MILLIS);
} else {
showError(mIcon.getResources().getString(
fingerprint_not_recognized_id));
}
}
The issue is with method as once we give wrong fingerprint ; it crashes the app
from cordova-plugin-android-fingerprint-auth.
I can't be of assistance if I don't know what the error is. I am unable to replicate the error. Please provide a link to a simplified project repo that replicates the error, steps to reproduce the issue and please provide the error message from logcat.
from cordova-plugin-android-fingerprint-auth.
The problem what i found was related to static final long ERROR_TIMEOUT_MILLIS = 1600; Assume that you keep scanning your wrong finger for more than 6 times ; then you will be get a message such as too many attempts and it automatically navigates to Backup option. However Before navigating to Backup Option automatically if you manually click cancel button in the Fingerprint Dialog screen when the error messages is shown as Too Many attempts ,the mobile app crashes.
from cordova-plugin-android-fingerprint-auth.
I was finally able to reproduce the crash and get the logcat error message. As a developer, especially when asking for help, you must to be able to access the logcat.
However, it turns out you were on the right path. But with knowing the exact error it is difficult to diagnose the problem and correct it. Sometimes people ask for help and it has nothing to do with the plugin, but it is their implementation of the plugin.
In this case it was the plugin. When you hit cancel it starts finishing the activity and because of the postDelayed and the ERROR_TIMEOUT_MILLIS the onError was being called after the Fragment had detached from the activity. I added a conditional in the override of onError to check if the Activity exists and the fragment is attached. This will prevent the async call to start the backup activity if cancel has already been clicked.
I have published a fix for this issue as v0.3.1
Below is the logcat of the error for your information.
10-17 09:03:24.162 2370-2370/com.te.meteor.cordova.plugin.android.fingerprintauth I/chromium: [INFO:CONSOLE(36)] "errorCallback(): Cancelled", source: http://meteor.local/app/client/templates/home/home.js?59b46d2b16d5c86fb8c27a237563528d3f3eb152 (36)
10-17 09:03:24.470 2370-2370/com.te.meteor.cordova.plugin.android.fingerprintauth D/AndroidRuntime: Shutting down VM
--------- beginning of crash
10-17 09:03:24.471 2370-2370/com.te.meteor.cordova.plugin.android.fingerprintauth E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.te.meteor.cordova.plugin.android.fingerprintauth, PID: 2370
java.lang.IllegalStateException: Fragment FingerprintAuthenticationDialogFragment{52ac0ae} not attached to Activity
at android.app.Fragment.getResources(Fragment.java:805)
at com.cordova.plugin.android.fingerprintauth.FingerprintAuthenticationDialogFragment.updateStage(FingerprintAuthenticationDialogFragment.java:196)
at com.cordova.plugin.android.fingerprintauth.FingerprintAuthenticationDialogFragment.goToBackup(FingerprintAuthenticationDialogFragment.java:192)
at com.cordova.plugin.android.fingerprintauth.FingerprintAuthenticationDialogFragment.onError(FingerprintAuthenticationDialogFragment.java:266)
at com.cordova.plugin.android.fingerprintauth.FingerprintUiHelper$1.run(FingerprintUiHelper.java:112)
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)
from cordova-plugin-android-fingerprint-auth.
Yes your correct; however in my system i don't have the adb logcat enabled due to administrator right policy issue. In the near future i will try to get access and send the logcat error messages. Thanks for fixing the issue
from cordova-plugin-android-fingerprint-auth.
Related Issues (20)
- Fingerprint popup box out of place on Samsung Galaxy S10+
- Gui translations are not applied. English is only language. HOT 1
- android.content.res.Resources$NotFoundException HOT 4
- FingerprintAuth is not defined HOT 1
- android.content.res.Resources$NotFoundException: HOT 1
- FaceID on new mobile devices HOT 1
- isAvailableSuccess response, what das it means? HOT 3
- Fatal Exception: java.lang.IllegalStateException: IV has already been used. Reusing IV in encryption mode violates security best practices.
- Multi-access HOT 3
- Deprecated FingerprintManager in API level 28 HOT 6
- BAD_PADDING_EXCEPTION after reinstall HOT 3
- A question about multiple users HOT 3
- Attempt to invoke virtual method HOT 2
- Cannot dismiss Fingerprint dialog HOT 1
- [IONIC] "Uncaught TypeError: object is not a function"
- Uses encryption mode CBC with PKCS7 padding
- setUserAuthenticationRequired true to false update not supporting Backup flow HOT 1
- Add support for newer android sdk's (starting from sdk 28).
- 请问encryptConfig中的clientId如何获取,可否提供操作步骤?
- BSF Cordova Ecosystem Crowdfunding Plan
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-android-fingerprint-auth.