appidea / react-native-hce

Emulate smart cards inside React-Native application.
MIT License
67 stars 26 forks source link

Fixed: Unable to send NDEF message #35

Open IZZAGOLD opened 10 months ago

IZZAGOLD commented 10 months ago

Hello, I am the owner of Pixel 4a and 7a (android 13 and 14). I couldn't emulate the tag. I found the solution in the following: in the NFCTagType4.java file change public final byte[] ndefDataBuffer = new byte[0xFFFE]; on public final byte[] ndefDataBuffer = new byte[0x7FFF];

change public final byte[] ccDataBuffer = new byte[15]; on public final byte[] ccDataBuffer = new byte[] { 0x00, 0x0f, // CCLEN 0x20, // Mapping Version 0x00, 0x3b, // Maximum R-APDU data size 0x00, 0x34, // Maximum C-APDU data size 0x04, 0x06, // Tag & Length (byte)0xe1, 0x04, // NDEF File Identifier (byte)0x7F, (byte)0xFF, // Maximum NDEF size 0x00, // NDEF file read access granted (byte)0xff, // NDEF File write access denied };

delete setUpCapabilityContainerContent and its call I don't use tag rewriting and I don't care about the writable property. Please improve these points. Thank you

dmolinamesa01 commented 2 months ago

Hi, I'm facing this problem. When I scan the tag with NFC tools always says that readonly is not able. I have also tried to get the content message working with react-native-nfc-manager but its impossible to get the content message. I couldn't solve it running your fix. Where did you get this info to set that on this file? Thanks