简体   繁体   中英

Android 4.4 hce (host-based card emulation) “processCommandApdu” apdu length

I've tested my Android Java application with Nexus 4, Nexus 5 and Samsung Galaxy S4 phones. In the test, the reader sends APDUs changing in length up to 252 bytes. Nexus phones receive APDUs successfully. On the other hand the Galaxy S4 phone can't receive APDUs which contain more than 128 bytes. It receives only the first 128 bytes of the sender's 252 bytes.

How can I determine a device's maximum receivable APDU size?

Currently there is no method to find the maximum receivable APDU length (except for trial and error).

Regarding maximum receivable APDU length there is an open AOSP bug report ( #69233 ). This report explains that

  1. the Nexus 5 is capable of receiving command APDUs with an overall length of 255 byte. A case 3 APDU can thus have at most 250 payload bytes.

  2. the Galaxy S4 is capable of receiving command APDUs with an overall length of 252 bytes. A case 3 APDU can thus have at most 247 payload bytes.

i found out that galaxy s4 actually receives 252 bytes. but in 2 consecutive chunks. it enters processCommandApdu function twice for apdus longer than 128 bytes.

I've got a Galaxy S4 myself and mit is capable of transmitting and/or receiving apdus up to 255 bytes. I haven't tried extendedAPDU, but they should work as well.

Probably it is an issue related to the combination of reader (Samsung Galaxy S4 and card) Cards from different manufacturers behave differently (inside the ISO14443 standard). IMHO the Samsung Galaxy S4 doesn't provide enough energy for some cards (experienced this with Galaxy S4).

There is nothing you can do about it, except using other transponders.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM