Giter VIP home page Giter VIP logo

cordova-plugin-mifare-ultralight's People

Contributors

gjuchault avatar lonk avatar roopehakulinen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cordova-plugin-mifare-ultralight's Issues

PIN size can't be higher than a int size

Hi !

As long as, in Java, a int has a limited size, the function "intToByteArray" can't handle pin code higher than 2147483647.

I'm a newbie in Java, but is there a way to easily fix it ?

Thank you !

Implement lockWithPin

Hello,

You implemented unlockWithPin, and I was wondering if you were opened to a lockWithPin method.

Some good links for it:
https://stackoverflow.com/questions/44395283/how-to-set-and-unset-password-on-a-mifare-ultralight-ev1-tag
https://stackoverflow.com/questions/22719465/ntag212-mifare-ultralight-with-authentication

Unlock

send: Ox1B 0xPIN1 0xPIN2 0xPIN3 0xPIN4
receive: 0xPACK1 0xPACK2
compare PACK1 and PACK2 with values given in lock (or don't compare)

Lock

  1. Write PIN

PAGE:
NTAG212 = page 39
MF0UL11 = page 12
MF0UL21 = page 27

send: 0xA2 0xPAGE 0xPIN1 0xPIN2 0xPIN3 0xPIN4

  1. Write PIN ACK (PACK)

PAGE:
NTAG212 = page 40
MF0UL11 = page 13
MF0UL21 = page 28

send: 0xA2 0xPAGE 0xPACK1 0xPACK2 0x00 0x00

  1. Write protection wanted (PROT)

Protection can be set to 0 (PIN needed for write operations) or 1 (PIN needed for read or write operations)

PAGE:
NTAG212 = page 38, byte 0, bit 7
MF0UL11 = page 11, byte 0, bit 7
MF0UL21 = page 26, byte 0, bit 7

send: 0x30 0xPAGE (get the complete page to only modify wanted bits)
recieve: 0xRES1 0xRES2 0xRES3 0xRES4

ACCESS = 0xRES1 & 0x07F # PIN needed for write
ACCESS = ACCESS | 0x80 # PIN needed for read

send: 0xA2 0xPAGE 0xACCESS 0xRES2 0xRES3 0xRES4

  1. Write first page being protected (AUTH0)

PAGE:
NTAG212 = page 37, byte 3
MF0UL11 = page 10, byte 3
MF0UL21 = page 25, byte 3

send: 0x30 0xPAGE (get the complete page to only modify wanted bits)
receive: 0xRES1 0xRES2 0xRES3 0xRES4 ...
send: 0xA2 0xPAGE 0xRES1 0xRES2 0xRES3 0xAUTH0

Tag ID contains negative number

Hi,

My NFC Card has id : 04416DF27D5780

If I do:

document.addEventListener('mifareTagDiscovered', (tag) => {
    console.log(tag.tag);
})

I get: [4, 65, 109, -14, 125, 87, -128]

Which makes: 04416D-E7D57-80

I've added Log.d(TAG, bytesToHex(tag.getId())); to fireTagEvent to check what id you start with and I have in adb logcat:

02-19 14:08:51.086 25943 26679 D CordovaPluginMifareUltralight: 04416DF27D5780

This means that either byteArrayToJSON or MessageFormat.format has something wrong. Maybe endianness ?
Thanks

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.