Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android HCE Help #100

Closed
alexroan opened this issue Jun 26, 2020 · 1 comment
Closed

Android HCE Help #100

alexroan opened this issue Jun 26, 2020 · 1 comment

Comments

@alexroan
Copy link

alexroan commented Jun 26, 2020

I'm using this example Android app to emulate using HCE, and using an acr122u NFC reader.

The android app essentially emulates a card with an "account number" which is typed in on the app. Here is the configuration of the emulation:

    private static final String TAG = "CardService";
    // AID for our loyalty card service.
    private static final String SAMPLE_LOYALTY_CARD_AID = "F222222222";
    // ISO-DEP command HEADER for selecting an AID.
    // Format: [Class | Instruction | Parameter 1 | Parameter 2]
    private static final String SELECT_APDU_HEADER = "00A40400";
    // "OK" status word sent in response to SELECT AID command (0x9000)
    private static final byte[] SELECT_OK_SW = HexStringToByteArray("9000");
    // "UNKNOWN" status word sent in response to invalid APDU command (0x0000)
    private static final byte[] UNKNOWN_CMD_SW = HexStringToByteArray("0000");
    private static final byte[] SELECT_APDU = BuildSelectApdu(SAMPLE_LOYALTY_CARD_AID);

Running examples/basic.js with autoprocessing=true returns this error:

Screenshot 2020-06-26 at 13 50 16

I'm assuming that I should approach with autoprocessing off, and using reader.transmit to retrieve the data, but I'm unsure as to how to move forward with the correct commands. Would you be able to help?

@alexroan
Copy link
Author

Screenshot 2020-06-26 at 14 13 12

Turns out it was a case of removing the LE data from the transmission which solved it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant