ajalt/reprint

Exception in Samsung Galaxy S5

hatpick opened this issue ยท 18 comments

Hi again,

I'm getting this error when I try a not-registered finger:

java.lang.NoSuchMethodError: com.samsung.android.fingerprint.FingerprintEvent.getImageQualityFeedback
      at com.samsung.android.sdk.pass.c.run(Unknown Source)
      at android.os.Handler.handleCallback(Handler.java:733)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:136)
      at android.app.ActivityThread.main(ActivityThread.java:5579)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
      at dalvik.system.NativeStart.main(Native Method)
ajalt commented

Man, Samsung's SDK is just the worst.Thanks for reporting this. Samsung only distributes obfuscated versions of their SDKs, and it looks like they've incorrectly configured their proguard configuration or something similar. The FingerprintEvent just isn't present in the SDK.

Which version of reprint are you using when you get this error? If you're using the latest version, try downgrading to 2.5.5, which uses an older version of the Samsung SDK and let me know if the bug is still present.

I'm using the latest. I switched back to 2.5.5 and I still get the same exception.

ajalt commented

That's really strange. What version of Android are you running? Did you install a system update recently?

I've got an S5 on order, so I'll be able to test once it gets here.

It's api 19 (4.4.2) and haven't installed any new updates recently. It doesn't happen all the time, but sometimes I get the error.

ajalt commented

Well, I got the S5 in to test with. I can't replicate the crash. Everything I can think of to try works fine. Does the reprint sample app crash, or just your app that uses reprint? If it's the latter, can you show me how you're using reprint?

It crashes my app, and here's how I'm using reprint:

Reprint.initialize(this); inside application onCreate

and then I have a lock activity that starts if user has been inactive for a certain amount of time.

if(Reprint.isHardwarePresent() && Reprint.hasFingerprintRegistered()) {
   Reprint.authenticate(this);
}
public class LockActivity extends SecureActivity implements AuthenticationListener {
   @Override
    public void onSuccess(int moduleTag) {
        LogUtil.i(TAG, "Used: " + moduleTag);
        showSuccess();
    }

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

Are you able to build the reprint sample app? Does that also crash?

Is there an apk I can try, I can't build from source.

ajalt commented

I added a debug sample apk to the latest release page

https://github.com/ajalt/reprint/releases/download/2.5.6/sample-debug.apk

What error were you getting when you tried to build it?

I still get the same exception on any unregistered finger swipe.

I occasionally get this following message during build:

warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.samsung.android.sdk.pass.a) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.samsung.android.sdk.pass.b) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.samsung.android.sdk.pass.c) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.samsung.android.sdk.pass.d) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.samsung.android.sdk.pass.e) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
ajalt commented

I'm pretty sure that's just a result of the way the Samsung SDK is compiled. Samsung doesn't distribute sources, so we're stuck with what they give us. As far as I've been able to tell, there's nothing that can be done about those warnings.

Thanks for posting this though. It's tough to figure out what to do about your original crash, since even the S5 that I ordered for testing doesn't exhibit the issue. So if you get any more information, please post it.

I'll keep you posted.

I've seen this issue using the spass SDK directly. It's definitely an issue with the SDK, and going back to version 1.1.4 of the SDK resolves the issue. Granted, that's not a viable approach going forward, but it's a temporary fix.

ajalt commented

Good to know! Would you rather have Reprint revert the spass version for now, or leave it and hope that Samsung releases an update some day?

I'm not using Reprint at the moment. But when searching for the error i was facing i came across this. I'm definitely considering replacing my homegrown solution with this.

If that fixes the issue I'd appreciate it if you revet the spass version for now.

ajalt commented

I reverted spass to 1.1.4. Hopefully Samsung will fix the bug soon, but I'm not going to hold my breath. Thanks for the reports.