user2297550
user2297550

Reputation: 3356

Encode multiple MifareClassic cards onto multiple NdefRecords into a single NDefMessage

I have been wracking my brains trying to copy multiple Mifare Classic elevator cards on to a single Mifare UltraLight tag which is Ndef formatted.

The problem is what should be the type (or RTD_ type) and payload of the NdefRecord?

Furthermore, do elevator readers record such records the same way as they record the normal card?

Here is what I read from the elevator card, it is not in Ndef format:

Update: full 16-sector data dump

intent.action: android.nfc.action.TECH_DIS
tag.id: ea942d64
tag.techList[] = android.nfc.tech.NfcA
tag.techList[] = android.nfc.tech.MifareCl
tag.techList[] = android.nfc.tech.NdefForm
MifareClassic tag.id = ea942d64
1024
0
16
64
618
false
trying to read sector: 0
1
0, 0, 0 ea942d64370804000280e65088eb571d
0, 1, 1 00000000000000000000000000000000
0, 2, 2 00000000000000000000000000000000
0, 3, 3 000000000000ff078069ffffffffffff
trying to read sector: 1
1
1, 0, 4 00000000000000000000000000000000
1, 1, 5 00000000000000000000000000000000
1, 2, 6 00000000000000000000000000000000
1, 3, 7 000000000000ff078069ffffffffffff
trying to read sector: 2
1
2, 0, 8 00000000000000000000000000000000
2, 1, 9 00000000000000000000000000000000
2, 2, 10 00000000000000000000000000000000
2, 3, 11 000000000000ff078069ffffffffffff
trying to read sector: 3
1
3, 0, 12 00000000000000000000000000000000
3, 1, 13 00000000000000000000000000000000
3, 2, 14 00000000000000000000000000000000
3, 3, 15 000000000000ff078069ffffffffffff
trying to read sector: 4
1
4, 0, 16 00000000000000000000000000000000
4, 1, 17 00000000000000000000000000000000
4, 2, 18 00000000000000000000000000000000
4, 3, 19 000000000000ff078069ffffffffffff
trying to read sector: 5
1
5, 0, 20 00000000000000000000000000000000
5, 1, 21 00000000000000000000000000000000
5, 2, 22 00000000000000000000000000000000
5, 3, 23 000000000000ff078069ffffffffffff
trying to read sector: 6
1
6, 0, 24 00000000000000000000000000000000
6, 1, 25 00000000000000000000000000000000
6, 2, 26 00000000000000000000000000000000
6, 3, 27 000000000000ff078069ffffffffffff
trying to read sector: 7
1
7, 0, 28 00000000000000000000000000000000
7, 1, 29 00000000000000000000000000000000
7, 2, 30 00000000000000000000000000000000
7, 3, 31 000000000000ff078069ffffffffffff
trying to read sector: 8
1
8, 0, 32 00000000000000000000000000000000
8, 1, 33 00000000000000000000000000000000
8, 2, 34 00000000000000000000000000000000
8, 3, 35 000000000000ff078069ffffffffffff
trying to read sector: 9
1
9, 0, 36 00000000000000000000000000000000
9, 1, 37 00000000000000000000000000000000
9, 2, 38 00000000000000000000000000000000
9, 3, 39 000000000000ff078069ffffffffffff
trying to read sector: 10
1
10, 0, 40 00000000000000000000000000000000
10, 1, 41 00000000000000000000000000000000
10, 2, 42 00000000000000000000000000000000
10, 3, 43 000000000000ff078069ffffffffffff
trying to read sector: 11
1
11, 0, 44 00000000000000000000000000000000
11, 1, 45 00000000000000000000000000000000
11, 2, 46 00000000000000000000000000000000
11, 3, 47 000000000000ff078069ffffffffffff
trying to read sector: 12
1
12, 0, 48 00000000000000000000000000000000
12, 1, 49 00000000000000000000000000000000
12, 2, 50 00000000000000000000000000000000
12, 3, 51 000000000000ff078069ffffffffffff
trying to read sector: 13
1
13, 0, 52 00000000000000000000000000000000
13, 1, 53 00000000000000000000000000000000
13, 2, 54 00000000000000000000000000000000
13, 3, 55 000000000000ff078069ffffffffffff
trying to read sector: 14
1
14, 0, 56 00000000000000000000000000000000
14, 1, 57 00000000000000000000000000000000
14, 2, 58 00000000000000000000000000000000
14, 3, 59 000000000000ff078069ffffffffffff
trying to read sector: 15
1
15, 0, 60 00000000000000000000000000000000
15, 1, 61 00000000000000000000000000000000
15, 2, 62 00000000000000000000000000000000
15, 3, 63 000000000000ff078069ffffffffffff

The first 4 bytes are the id and I don't know how to interpret the rest or how to wrap it into an NdefRecord. Is it even possible? TIA

Upvotes: 0

Views: 393

Answers (1)

Andrew
Andrew

Reputation: 10182

The Tag does not contain Ndef data, the card is NdefFormatable which means it is capable to storing Ndef data but it has not currently been Formatted to be able to store Ndef data.

The Tag techList must contain android.nfc.tech.Ndef for it to be currently storing Ndef Data.

Therefore what you are trying to do is not logical and what you are not showing is all the other password protected data on the Mifare Classic card which is what elevator system actually uses from the Mifare Classic Cards.

As you cannot change the elevator hardware, this is even more impossible.

This is like 2 people with one taking about baking a cake in French and the other talking about the weather in Chinese, while they are both making sounds they will not be able to understand each other and you cannot change either to work with the other.

Upvotes: 2

Related Questions