Question

I am new to android and i have developed an app locker.Now,i want that the application,i am locking should be unlocked with nfc tag that is without typing the password manually.How can i perform it?

Was it helpful?

Solution

As you already have the app locker part, I assume that when a user tries to launch an app, your app locker will instead show its unlock activity asking the user for a password.

On that unlock activity, you could now (instead or besides asking for the password) ask the user to scan the NFC tag. Your activity would therefore register for the NFC foreground dispatch system and wait until an NFC tag is scanned (or the user maunally types the password). As soon as your activity receives the NFC tag discovery intent through the foreground dispatch system, you could communicate with the tag and base your access control decision on the result of this communication.

As to what NFC tag/contactless smartcard you should use and what information you should store on it: That's a difficult question! This very much depends on your security requirements. In the easiest case, you could base your decision on the tag's (unique) identifier. However, you have to keep in mind that the identifier is neither unique nor unclonable. As an alternative you could use a (real) NFC tag and store an NDEF message on it. That NDEF message could contain some identifier/password that your app uses as an unlock credential. Again, NFC tags are publicly readable and therefore the NDEF message may be copied/cloned to another tag. Further security can be achived with tags that support cryptographic functionality beyond NFC Forum tag types, but discussion of that is certainly to broad for the StackOverflow format.

OTHER TIPS

As I understand the technology, this isn't possible with the screen completely off. It's a security feature that the secure element only turns on when the screen turns on. So it should be a hardware limitation not a software one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top