Pax device APDU NFC & Mifare Ultralight C

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Pax device APDU NFC & Mifare Ultralight C

1,876 次查看
thibaut
Contributor I

Hello,

I'm developing on Pax device and I want to manage Mifare ULTRALIGHT C (MF0ICU2)

Pax devices use a custom PayDroid OS and not a standard android, consequently, I don't have NFC android libraries. 

I need to install something call NeptuneLiteAPI that expose IPCC via a library.


First, I'm a little bit lost with naming convention & standard. Api is speaking about :

  • ISO14443
    • A or B
    • 1,2 or 3
  • M1 card

Normally, Ultralight C is 14443 Type A, but I can't read my card with this option, I succeed to read with "M1 Card" option. What is a M1 card ? it it Classic 1k?

 

Documentation mention that I need to use APDU and expose some command to execute this kind of call


I succeed to read and write the card (with M1 function), the library expose default read/write method that use compatibility mode compatible with my card

Now, i'm trying to configure authentication and to send some command to the chip, via the APDU command.

Here is a simplication of the code I can use

 

iPicc = getDal().getPicc(piccType);

iPicc.open();
while(){
PiccCardInfo cardInfo = iPicc.detect(EDetectMode.ONLY_M);

if(cardInfo!=null){

//Read : works

byte[] page0=iPicc.m1Read((byte) 0);

// Write : works

iPicc.m1Write((byte)(13),hexStringToByteArray("AAAAAAAA000000000000000000000000"));

}

 


For writing, i have 3 methods:

  • byte[] :  isoCommand(byte cid, byte[] send)
  • ApduRespInfo : isoCommandByApdu(byte cid, ApduSendInfo apduSendInfo)
  • byte[] cmdExchange(byte[] dataIn, int recvLen)
  • All these method ask for an APDU command.

if I understood well, Mifare Ultralight C does't respect APDU but APDU is the only way?

And on some website, I found that using instruction class "FF", I can sent direct instruction to chip.
But I'm lost in the command I need to send, and I try several.
I have the error (unfortunatly, they are the one NeptuneLiteAPi and not a standard one).

  • No specific card in sensing area, or card is not activated PICC#3(not search card error)
  • PICC#97(unexpected error)

But it's strange, I well detect the card just before and succeed to read/write, so the card is well "connected"

I tried several commands (direct instruction, APDU instruction, CRC computation), nothing works.


 //byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("30")); // PICC#97(unexpected error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("3004")); // PICC#97(unexpected error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("3000")); // PICC#97(unexpected error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("3000A802")); // Avec CRC => No specific card in sensing area, or card is not activated PICC#3(not search card error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("300002A8")); // Avec CRC inversé => No specific card in sensing area, or card is not activated PICC#3(not search card error)

//byte[] cmd2 = iPicc.cmdExchange(CryptageUtils.hexStringToByteArray("3000A802"),17); // Card is not activated. PICC#3(not search card error)
// byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("30000000")); // No specific card in sensing area, or card is not activated PICC#3(not search card error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("ff300000")); // No specific card in sensing area, or card is not activated PICC#3(not search card error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("ff30000F")); // No specific card in sensing area, or card is not activated PICC#3(not search card error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("FFCA00000004")); // No specific card in sensing area, or card is not activated PICC#3(not search card error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("3000000004")); // No specific card in sensing area, or card is not activated PICC#3(not search card error)
//byte[] cmd2 = iPicc.isoCommand(cardInfo.getCID(), CryptageUtils.hexStringToByteArray("3001")); // No specific card in sensing area, or card is not activated PICC#3(not search card error)

 If anyone can well me or put me on the right way, I would really appreciate.

Regards.

0 项奖励
回复
2 回复数

1,184 次查看
Antoine1
Contributor I

Hello @thibaut and @Erableto,

did you find the answer to your question?
Because we have the same problem on our side.

Regards.

0 项奖励
回复

1,788 次查看
Erableto
Contributor I

Hi Thibaut. Did you figure it out? I'm doing the same as you but with a Mifare Classic 1k and I have the same problems. I'm looking for help too.

I will keep you posted with any progress I manage to make. I hope we can get this done together.

 

Regards.

0 项奖励
回复