martinpaljak / nfc4pc Goto Github PK
View Code? Open in Web Editor NEWNFC for Personal Computers
Home Page: https://superuser.com/questions/1756090/how-to-open-nfc-tags-on-windows-like-a-mobile-phone-would
License: GNU General Public License v3.0
NFC for Personal Computers
Home Page: https://superuser.com/questions/1756090/how-to-open-nfc-tags-on-windows-like-a-mobile-phone-would
License: GNU General Public License v3.0
Goal: when a tag is detected and reader is capable of reading the UID of the chip, but no NDEF payload (again, type 4 only currently) is detected, open a pre-defined URI with the UID of the chip appended as query parameter in small case hex.
That is:
--uid-url https://example.com/foo#bar
and the UID of the chip presented to a reader is 046B477AB92980
, the following URL will be triggered: https://example.com/foo?uid=046b477ab92980#bar
Possible enhancements:
--silent-uid
- only show the notification, but don't open the browser, only send a "webhook" (PROBABLY)When using Meta-URL the URL Parameter 'url' gets encoded into URL String twice. This results in an wrong encoding
Example:
URL to encode: https://google.com
correctly encoded URL: https%3A%2F%2Fgoogle.com
Encoding from this tool: https%253A%252F%252Fgoogle.com
Maybe it is resulting from this issue: https://bz.apache.org/bugzilla/show_bug.cgi?id=39746
Workaround for me is to decode the URL twice on the receiving end.
Without checking the code out. Maybe the issue is in the class "NFC4PC" where you encode the URL on Line 153 and then add it to the URL with the method "appendUri" in that method you write that the append String will be URL encoded. That would mean that the URL gets encoded twice and would explain the behaviour.
Seems regardless of the tag type I use (tried with Classic 1K, NTAG213 and NTAG424), I get the following error as soon as I tap it:
22:40:44:508 [ACS ACR122 0] [ERROR] NFCReader - Could not connect to or read: newPosition < 0: (-2 < 0)
java.lang.IllegalArgumentException: newPosition < 0: (-2 < 0)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:341)
at java.base/java.nio.Buffer.position(Buffer.java:316)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1516)
at jnasmartcardio.Smartcardio$JnaCardChannel.transmitImpl(Smartcardio.java:809)
at jnasmartcardio.Smartcardio$JnaCardChannel.transmit(Smartcardio.java:690)
at apdu4j.pcsc.CardBIBO.transceive(CardBIBO.java:130)
at apdu4j.core.APDUBIBO.transmit(APDUBIBO.java:35)
at pro.javacard.nfc4pc.NDEF.getType2(NDEF.java:42)
at pro.javacard.nfc4pc.NFCReader.tryToRead(NFCReader.java:120)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
WARNING: Could not read: newPosition < 0: (-2 < 0)
I am using a ACR-122U reader. What could be causing this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.