nfc

How to transfer plain text via Android NFC?

烂漫一生 提交于 2021-02-11 17:40:53
问题 I am new to Android NFC and developing NFC application in android. My idea is Device A need to send a plain text to Device B. Is it possible in Android NFC? I just tried with Tag Dispatcher (enableForegroundDispatch , disableForegroundDispatch) on both Reader and Writer. My Reader side code is : nfcAdapter.enableForegroundDispatch(this, pendingIntent, intentFilters, techList) override fun onNewIntent(intent: Intent?) { intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES)?.also {

How to password protect writing to NFC NTAG216 tag on iOS 13 using NFC Core

那年仲夏 提交于 2021-02-11 13:35:06
问题 I'm trying to password protect an NFC NTAG216 sticker using iOS 13. I need the NFC tag to be readable by anyone but I want to limit the writing to the NFC tag unless you have the preset password. According to the specs of the tag, this should be possible but the API for writing NDEF tags is very limited it seems. I found out that the API for NDEF tags is mostly limited to writing full message payloads. I also found that the NFCISO15693Tag API does allow some low-level operations according to

Is HCE bi-directional communication possible?

笑着哭i 提交于 2021-02-10 15:12:11
问题 According to this solution, by using the sample app for card emulation and card reader: we can setup a HCE card (card emulation) in "Device A", and send the data to a reader (card reader) in "Device B". What if I want to continue this process by sending a "amount" from "Device B" back to "Device A"? Is this achievable? Note: Both devices are 4.4+. 回答1: HCE use ISO-7816-4 standard so you communicate with APDU APDU process is: Reader send command (with optional data) to card. Card respond (with

How to get plain text from NFC Tag?

白昼怎懂夜的黑 提交于 2021-02-08 11:24:44
问题 I have tried to implement the code from Google documentation but it is still not clear for me. What am I missing here? This is method in MainActivity.java: @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction())) { Parcelable[] rawMessages = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES); if (rawMessages != null) { NdefMessage[] messages = new NdefMessage[rawMessages.length]; for (int i =

Simulate NFC tag on an Android phone

♀尐吖头ヾ 提交于 2021-02-08 04:52:10
问题 I am working with NFC in Android. I have done things with NFC tags and Android Beam, but I am wondering if is possible to use a Android Phone like a NFC tag. One problem about it is that when I put near the two phones, Android Beams starts. Also, I have not found information about how I can simulate an NFC tag. Is it possible? PS. Sorry for mi english. 回答1: This was already discussed (http://stackoverflow.com/questions/6138077/can-an-android-nfc-phone-act-as-an-nfc-tag) and the conclusion is

ATR command when programming PC/SC reader

房东的猫 提交于 2021-02-07 06:43:46
问题 I have checked the programming interface for the MIFARE Ultralight and TOPAZ/Jewel IC tags. The API quite nicely describes how the bytes are saved on the card, how to address the memory blocks, how to make all operations like read, read-all, use of the OTP (One Time Programmable) function, how to read ROM bytes, how to switch from idle to ready state (REQA, WUPA commands), it says if commands are CRC protected, how to access the tag UID, etc. When stared to program the NFC reader (ACR122U or

External authentication in DESFire card with ISO 7816-4 APDUs

北城余情 提交于 2021-02-07 04:39:14
问题 I tried to do the authentication process on a DESFire card (resident card) using ISO 7816-4 APDUs. But it always fails. Do I miss anyithing? >>> 00 84 00 00 00 (challenge request - 5 bytes) <<< 15 29 84 E3 6A AA A6 B7 90 00 (response of challenge 10 bytes - OK) >>> 00 82 00 00 10 B5 02 0B 80 4F 95 CB E7 8C A6 4D E9 C1 B1 23 A7 00 (external auth request - 22 bytes) <<< 67 00 (response of external auth - Checking error: Wrong length) Code: // STEP Authentication // send initial authentication

Cannot authenticate NTAG213

亡梦爱人 提交于 2021-02-07 04:12:57
问题 I am using an ACR122U NFC reader to password protect an NTAG213 NFC label. I think I have managed to set the password correctly, but I cannot authenticate and change the label afterward. My code for authenticating looks like this: #include <winscard.h> #include <iostream> #pragma comment(lib, "winscard.lib") const char *ReaderName = "ACS ACR122 0"; unsigned Password = 0x12345678; int main() { //Establish context SCARDCONTEXT hContext; DWORD SCard_Status1 = SCardEstablishContext(SCARD_SCOPE

Cannot authenticate NTAG213

一个人想着一个人 提交于 2021-02-07 04:05:33
问题 I am using an ACR122U NFC reader to password protect an NTAG213 NFC label. I think I have managed to set the password correctly, but I cannot authenticate and change the label afterward. My code for authenticating looks like this: #include <winscard.h> #include <iostream> #pragma comment(lib, "winscard.lib") const char *ReaderName = "ACS ACR122 0"; unsigned Password = 0x12345678; int main() { //Establish context SCARDCONTEXT hContext; DWORD SCard_Status1 = SCardEstablishContext(SCARD_SCOPE

Host-based Card Emulation - Trigger a reader app when HCE is read on reader device

北城以北 提交于 2021-02-05 11:21:25
问题 NFC tags can trigger an NFC reader app available on the phone, but HCE does not trigger any reader app. However, if I first open the reader app, then it works normally and, hence, can read the HCE emulated tag. I need a solution where HCE can open or prompt to choose the reader app. Is this possible with HCE? Why does Android not prompt to open an NFC reader app when detecting a HCE device? 回答1: No, a HCE app on one Android device cannot be used to trigger (launch) a reader app on another