Java Question Adding new functionalities and tags decoding to NFC library

Bratt

Member
Licensed User
Longtime User



Hello i need to develop an application that can read/write to the first block in an ISO 15693 tag.
I have tested reading with the NFCV reader example and that works fine.
Unfortunately i don't have enough skills to develop write functionality in the library.
Do you have any plans to add write functionality in the near future?

Thank you.
 

Chelu

Member
Licensed User
Longtime User
Chelu,
The function you want is card simulation as opposed to reader which is a quite new function. I believe Android 4.4 supports the function.

The current lib can not meet your requirement.
Thanks jjcc.
 

jjcc

Member
Licensed User
Longtime User
Will write that function as well as lock function later.
 

vidiot

New Member
Licensed User
Longtime User
Thank you, I see NFC library 1.23 -- did it include write functionality?
 

maldrovandi

Member
Licensed User
Longtime User
Please do not post duplicate questions.

Hello Erel.
I have a question to ask: the link below is an example of how to read a block of paper and write Mifare Ultralight a selected block. These features would need much if they were implemented in B4A, but I read that most people, for years, have been required and you do not have them implemented. Can I ask if there is a reason for this? Perhaps there is a hidden problem in using writing in B4A?

http://developer.android.com/guide/topics/connectivity/nfc/advanced-nfc.html
 

jjcc

Member
Licensed User
Longtime User
The source code is there in github. You can add the functions if you can not wait. I can add the functions but you need to wait for a while. MifareUltra is simpler than Mifare Classic and IsoV type.
 

maldrovandi

Member
Licensed User
Longtime User
The source code is there in github. You can add the functions if you can not wait. I can add the functions but you need to wait for a while. MifareUltra is simpler than Mifare Classic and IsoV type.

Would you be able to integrate Erel's libraries, in order to write on Mifare Ultralight? All this would be a really good thing ....
 

JohnShepherd

New Member
Licensed User
Longtime User

There seems to be a problem with the key length, mifare keys are only 6 bytes long.
If I set a 6 byte key, it seems to ignore me and only authenticates with the default keys.
Can you amend this, or do you have the source code so I can fix it ?
 

jjcc

Member
Licensed User
Longtime User
There seems to be a problem with the key length, mifare keys are only 6 bytes long.
If I set a 6 byte key, it seems to ignore me and only authenticates with the default keys.
Can you amend this, or do you have the source code so I can fix it ?
you are right. Here's the fix
 

Attachments

  • NFC1.24.zip
    19.8 KB · Views: 711

joschi

Member
Licensed User
Longtime User
hi!
I have downloaded the V1.24 from the LIB. I would like to test it with the postet example nfcvreader. But when I start the Project file I get an error "Missing libraries: encryption". in the Forum I don't found this lib. Where get I the lib?

Thanks!!!
 

Lexman

New Member
Licensed User
Longtime User
you are right. Here's the fix
Hi jjcc,
Many thanks for your earlier update of NFC lib.
As you may already know there is a "problem" to read the UID from Mifare 1K etc. with newer phones. (Samsung S4, S5, Nexus 7 (2013)) http://www.rfid-blog.com/?p=2247
because they have Broadcom NFC chip installed. Could you please update the NFC lib so it becomes possible to read ONLY UID from Mifare tags ? . Do not have any other needs to read/write to tag memory. There is some apps on Google Play that can read Mifare UID via Broadcom NFC chip - so it is possible... - I hope you can find some "work around" to solve this issue.
Checkout app "NFC taginfo"

Best Regards !
 

Lexman

New Member
Licensed User
Longtime User

Hello again. I solved this problem myself and updated the NFC lib so I can now read the UID from Mifare Classic and Mifare Ultralite tags on the Nexus 7 (2013) with Broacom NFC chip.

Cheers
 

aeropic

Active Member
Licensed User
Longtime User
Here's NFC1.25. It added functions for accessing Ultralight/NTag203 tags. Along with an sample B4A code showing how to use the ReadPage function.
Hi JJCC,

I'm just trying NFC1.25 anf the ultralightreader on my galaxy S3 and I get some trouble with it:

1- at compile time : AndroidManifest.xml:36: error: Error: No resource found that matches the given name (at 'resource' with value '@xml/tech_filter').

2 if I cancel the ressource in the manifest, I get this error
B4X:
Convert byte code - optimized dex.      Error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: class name (BADoclet$Property) does not match path (BADoclet/BADoclet$Property.class)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.processClass(Main.java:665)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:596)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
...while parsing BADoclet/BADoclet$Property.class
1 error; aborting
    Optimized dexer failed. Switching to Standard dexer.

What am I doing wrong ?
 

jjcc

Member
Licensed User
Longtime User
For this specific app, I believe you need to put a file "tech_filter.xml" into the directory "$yourworkingdir/Objects/res/xml" and make it read only. Here's a sample file, you can copy it to your directory.
 

Attachments

  • tech_filter.xml
    161 bytes · Views: 645
Cookies are required to use this site. You must accept them to continue using the site. Learn more…