Code Monkey home page Code Monkey logo

Comments (7)

kevbry avatar kevbry commented on May 25, 2024 1

@phileo Any chance you could post your CryptoAPI23ReprintModule? I'm looking for exactly the same thing.

from reprint.

ajalt avatar ajalt commented on May 25, 2024

I'll answer your second question first: By default, Reprint uses the spass module if it's available. It looks like newer samsung devices don't support it, and use the marshmallow module instead.

w.r.t. the CryptoObject: I initially chose not to expose it in the Reprint since it's only applicable to the marshmallow module. I suppose the best solution would be to add an authenticate overload that takes a support library CryptoObject and passes it to the modules. But in the case that you're using a module that doesn't support it, what should the behavior be? It feels bad to throw an exception in the spass module when it gets a CryptoObject, but is authenticating the fingerprint without unlocking the CryptoObject useful?

from reprint.

phileo avatar phileo commented on May 25, 2024

I wound up creating a new ReprintModule that extends MarshmallowReprintModule.
I name it CryptoAPI23ReprintModule, and pass in the CryptoObject as one of the constructor parameters.

Then following the pattern of MarshmallowReprintModule, I implemented a private auth method which calls fingerprintManager.authenticate() with the CryptoObject

I also need to pass the CryptoObject back to the user, so the easiest way to do this without perturbing the library was to create a new abstract class which implements AuthenticationListener. Then I call this abstract class as follows in CryptoAPI23ReprintModule 's
FingerprintManager.AuthenticationCallback.onAuthenticationSucceeded() callback :
listener.setCryptoObject(result.getCryptoObject())

This works for my purposes. However, I'm not sure whether this is too custom of a solution, or whether it is generic enough to be included into your Reprint library.
Let me know what you think.

from reprint.

ajalt avatar ajalt commented on May 25, 2024

I'm glad you found a solution that works! What do you do in the case when you're on a device that uses the SPass module, which doesn't support the CryptoObject?

from reprint.

phileo avatar phileo commented on May 25, 2024

hmmm..... I'm currently just calling Reprint.registerModule() and passing in my CryptoAPI23ReprintModule so my I'm not sure what to do in that scenario. Also I never really addressed your question about authenticating the fingerprint without unlocking the CryptoObject in the case of a device using the SPass module.
What would you suggest?

Should I create a Reprint.initializeWithCrypto() that checks whether I'm on a device that uses the SPass module, and if not, then call registerModule(CryptoAPI23ReprintModule) ?

from reprint.

ajalt avatar ajalt commented on May 25, 2024

Ah, so you aren't using the spass module at all? Your design makes sense in that use case. Let me think more about a general solution. In the mean time, I'll leave this issue open, and if anyone else has a use case for the CryptoObject, they can comment on this issue to let me know what they'd like to see.

from reprint.

Flo354 avatar Flo354 commented on May 25, 2024

I am also looking for CryptoObject. And this library seems to be most updated.

from reprint.

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.