- try {
- isoTag.connect();
- byte[] resp = isoTag.transceive(selectCommand);
- int length = resp.length;
- if (resp[length - 2] == (byte)0x90 &&
- resp[length - 1] == 0x00) {
- doChallengeYubiKey(isoTag, slot);
- } else {
- Toast.makeText(this, R.string.tag_error,
- Toast.LENGTH_LONG).show();
- }
- } catch (TagLostException e) {
- Toast.makeText(this,
- R.string.tag_lost, Toast.LENGTH_LONG).show();
- } catch (IOException e) {
- Toast.makeText(this,
- getText(R.string.tag_error) +
- e.getMessage(),
- Toast.LENGTH_LONG).show();
+ byte[] response = NFCAuthCRYubiNeo.doChallengeYubiKey(
+ isoTag, slot, challenge);
+ if (response != null) {
+ Intent data = getIntent();
+ data.putExtra("response", response);
+ setResult(RESULT_OK, data);