Giter Club home page Giter Club logo

Comments (9)

jagan27101986 avatar jagan27101986 commented on August 27, 2024

Clicking on Wrong Fingerprint ; crashes the application

from cordova-plugin-android-fingerprint-auth.

mjwheatley avatar mjwheatley commented on August 27, 2024

Please provide the error message from logcat.

from cordova-plugin-android-fingerprint-auth.

jagan27101986 avatar jagan27101986 commented on August 27, 2024

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.

jagan27101986 avatar jagan27101986 commented on August 27, 2024

I am using Samsung Galaxy 7 mobile.

from cordova-plugin-android-fingerprint-auth.

jagan27101986 avatar jagan27101986 commented on August 27, 2024

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.

mjwheatley avatar mjwheatley commented on August 27, 2024

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.

jagan27101986 avatar jagan27101986 commented on August 27, 2024

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.

mjwheatley avatar mjwheatley commented on August 27, 2024

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.

jagan27101986 avatar jagan27101986 commented on August 27, 2024

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)

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.