Coder Social home page Coder Social logo

openjavacard-ndef's Issues

Tiny Applet Installation Parameters (NDEF TLV)

The documentation has an example here of how to install the tiny app variant using param data:

 user@host:~$ java -jar gp.jar \
        -applet D2760000850101 \
        -params 100BD101075402656E54657374 \
        -install build/javacard/javacard-ndef-tiny.cap
 (Install tiny variant with static text "Test")

What is the leading byte of the param data here? Is the param itself a TLV?

Type Length Value ... ... ... ... ... ...
TNF: Type Name Format Type Length Payload Length Type
0x10 0x0B 0xD1 0x01 0x07 0x54 0x02 0x65 0x6E 0x54657374
11 bytes 0b11010001 1 byte 7 bytes T en Test

When I use this python code to generate an NDEF, I only get the payload:

import ndef

record1 = ndef.TextRecord("Test")

encoder = ndef.message_encoder()

encoder.send(None)
encoder.send(record1)
encoder.send(None)

message = [record1]

print(b''.join((ndef.message_encoder(message))).hex())
>>> d101075402656e54657374

It also mentions in the docs for the tiny applet:

You should not prepend the dataset with a length prefix as in the stored form.

So maybe I've missed some other detail. What's the initial byte 0x10 in the tiny applet param? Thanks for any help in advance!

Create a smaller read-only version of the applet

This should be done once the design of the main applet has been finalized.

I do not think that this can be done using normal modularization techniques (classes) in JavaCard without increasing the binary size, but that would be one option.

Another option would be building the applet as a tiny subset using copy-n-paste. Thats probably what I'll end up doing.

Not work successfully

Hello, Developer.

I'm Shige in Japan user.
Thanks to your good javacard applet, its useful to me.

Please let me ask how to use javacard-ndef applet.

I believe that I can install successfully.
I installed with refering to

java -jar gp.jar
-params 100BD101075402656E54657374
-install javacard-ndef.cap

But, it doesnt work well.
APDU Command with GP tool below:
Success : 9000
A>> T=0 (4+0007) 00A40400 07 D2760000850101
A<< (0000+2) (41ms) 9000

But, next is not success
A>> T=0 (4+0002) 00A4000C 02 E103
A<< (0000+2) (26ms) 6A86

Could you let me know how to use or example to call APDU ?

Best Regards,
Shige

Using RAM instead of EEPROM for NDEF messages?

I am trying to dynamically generate a token (within an NDEF message) that is returned upon tag-read. Since the token is generated as-needed, I assume I won't need persistent memory. As an initial test I'm just trying to return a static NDEF message that is stored in RAM. This is my edit to lines 510-511 of the 'full' variant applet (in NdefApplet.java).

                // send directly
                byte[] arr = JCSystem.makeTransientByteArray((short)14, JCSystem.CLEAR_ON_RESET);
                arr[0] = (byte)0x00;
                arr[1] = (byte)0x0C;
                arr[2] = (byte)0xD1;
                arr[3] = (byte)0x01;
                arr[4] = (byte)0x07;
                arr[5] = (byte)0x54;
                arr[6] = (byte)0x02;
                arr[7] = (byte)0x65;
                arr[8] = (byte)0x6E;
                arr[9] = (byte)0x54;
                arr[10] = (byte)0x65;
                arr[11] = (byte)0x73;
                arr[12] = (byte)0x74;
                arr[13] = (byte)0x81;

                apdu.setOutgoingLength((short)14);
                apdu.sendBytesLong(arr, (short)0, (short)14);

Interestingly, when using this app, available on the app store, I am able to send custom APDU's to the applet and read the expected responses, but when using the generic NFC reader (of any NFC app - "NFC app", "NXP TagInfo", etc) the tag is not recognized at all. Specifically: I can send a sequence of custom APDU's to "read" from the tag resulting in the response 000CD101075402656E54657374819000 , but when using the regular "NFC Reader" function (of any of the common NFC read/write apps) the tag is not detected.

My Question: In order to be detected as an NDEF tag, must the NDEF message be written to EEPROM?

I can provide A LOT more details with respect to my testing of this, but I am very curious if there is something obvious that I'm missing.

Change license to LGPL

The new 'stub' variant requires linking to parts of this project.

Since my policy is to not restrict usage with licensing I will adjust the license to LGPL once I find the time.

Build: prepare Error reading project file ext/ant-javacard/build.xml

Error while running ant.sh

➜  openjavacard-ndef git:(master) ✗ ./ant.sh
Buildfile: /home/pixsa/Desktop/Job/Cnick/openjavacard-ndef/build.xml

prepare:

BUILD FAILED
/home/pixsa/Desktop/Job/Cnick/openjavacard-ndef/build.xml:20: The following error occurred while executing this line:
Error reading project file PATH/openjavacard-ndef/ext/ant-javacard/build.xml: PATH/openjavacard-ndef/ext/ant-javacard/build.xml

Total time: 0 seconds

This makes sense, because ext/ant-javacard/build.xml file is not present.
How should I generate it?

Wrong NDEF file length when creating CC file

After the installation of the tiny applet in a JCOP 3 EMV, the card is not recognized as a NFC tag. This happens due to the Maximum NDEF file size field in the File Control TLV being set to the NDEF message size instead of to the NDEF file size.

The fix would be to use (short)(dataSize + 2) instead of dataSize when initializing the Capability Container in makeCaps.

PN532 failing with Unknown TLV 67

Update: Fails on windows with GoToTags and ACR122u.

I cant seem to get to the PN532 and Arduino to read the tag, when I use ACR122U it works fine, however the Arduino can read a regular mifare card with the same NDEF tag fine.

Loaded javacard-ndef-full-plain.cap onto J3A040
Created text ndef
Write ndef onto mifare and java card.

Reading Mifare and Java card with ACR122U works.
Reading Mifare and Java card with iPhone Xs works.
Reading Mifare with Arduino and PN532 works.
Reading Mifare with GoToTags Windows App with ACR122U works.

Reading Java card with Arduino and PN532 throws error, Unknown TLV 67.
Reading Java card with GoToTags Windows App with ACR122U does not work, Throws NFC tag's type is not supported.

Installed but no ndef data [help]

Please help.

I am writing cap files successfully. Both pre-built and the one I made.

I know Tag writer app had issues with this applet, but I have no indication in other apps that my NFC card supports ndef.

I do not know how to generate the correct AID for this. Tried: 5A47B1C6ED8E5D7656B1E070 for cap and 5A47B1C6ED8E5D7656B1E07001 for applet.

Can somebody help me? Maybe the problem is wrong AID that does not support NDEF.

Have issues with both full and tiny example.

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.