问题描述
我是新通过RFID和NFC和DESFire门禁卡。我已经从DESFire非标签读取UID。娄code给出了从defire标签UID。
I am new by RFID and NFC and DESfire cards. I already read UID from desfire tag. Bellow code gives UID from defire tags.
UID是在文本3,但它只是第一个7个字节。
UID is in text3, but only first 7th byte from it.
public void onNewIntent(Intent intent) {
TextView text2 = (TextView) findViewById(R.id.textView2);
TextView text1 = (TextView) findViewById(R.id.textView1);
TextView text3 = (TextView) findViewById(R.id.textView3);
String action = intent.getAction();
if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
Toast.makeText(this, "discovered", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Falied", Toast.LENGTH_SHORT).show();
}
byte[] tagResponse = null;
byte[] tagResponse1 = null;
byte[] tagResponse2 = null;
Tag desfire = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
isodep = IsoDep.get(desfire);
try {
isodep.connect();
} catch (IOException e) {
e.printStackTrace();
}
//byte[] test = new byte[] { (byte) 0xAA, (byte) 0x00 };
byte[] test=new byte[]{(byte)0x60};
byte[] test1=new byte[]{(byte)(0xAF)};
// byte[] test2=new byte[]{(byte)(90AF000000)};
try {
tagResponse = isodep.transceive(test);
tagResponse1 = isodep.transceive(test1);
tagResponse2 = isodep.transceive(test1);
text1.setText(bytesToHex(tagResponse));
text2.setText(bytesToHex(tagResponse1));
text3.setText(bytesToHex(tagResponse2));
} catch (IOException e) {
e.printStackTrace();
}
try {
isodep.close();
} catch (IOException e) {
e.printStackTrace();
}
我的测试,我手里唯一可用的标签是一个交通卡。我现在想读的电荷平衡在我transportaion卡。这可能吗?(我有支持NFC平板电脑)。如果有可能,我怎么也得做?请给我一些问候或code例子。我很新通过的DESFire阅读和写作。
The only tag available in my hand for my tests is a transportation card. I now want read balance of charge inside my transportaion card. is it possible?( I have a tablet which supports nfc.) If it is possible how i must do it?please give me some regards or code example. I am very new by DESFire reading and writing.
推荐答案
它通常是无法读取的平衡出了交通卡,因为它保存在一个上锁卡部门。您需要知道用于能够读取(以及可能改变)的信息的扇区的密钥和数目
It is usually not possible to read the balance out of transportation cards as it is saved in a locked card sector.You would need to know the key and number of the sector used to be able to read (and possibly alter) the information.
您可以尝试使用的https:/ /play.google.com/store/apps/details?id=at.mroland.android.apps.nfctaginfo 以识别扇区。但是如果没有密钥,您无法读取存储的数据。
You may try to use https://play.google.com/store/apps/details?id=at.mroland.android.apps.nfctaginfo to identify the sector. However without the key, you cannot read the stored data.
这篇关于我想读在我transportaion DESFire非卡收费的平衡。这可能吗?怎么看?(在Android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!