Пример #1
0
  public static TransitIdentity parseTransitIdentity(Card card) {
    DesfireCard desfireCard = (DesfireCard) card;
    byte[] data = desfireCard.getApplication(4594).getFile(15).getData();
    data = Utils.reverseBuffer(data, 0, 16);

    long serialNumber1 = Utils.getBitsFromBuffer(data, 96, 32);
    long serialNumber2 = Utils.getBitsFromBuffer(data, 64, 32);
    return new TransitIdentity(NAME, formatSerialNumber(serialNumber1, serialNumber2));
  }
Пример #2
0
  public MykiTransitData(Card card) {
    DesfireCard desfireCard = (DesfireCard) card;
    byte[] metadata = desfireCard.getApplication(4594).getFile(15).getData();
    metadata = Utils.reverseBuffer(metadata, 0, 16);

    try {
      mSerialNumber1 = Utils.getBitsFromBuffer(metadata, 96, 32);
      mSerialNumber2 = Utils.getBitsFromBuffer(metadata, 64, 32);
    } catch (Exception ex) {
      throw new RuntimeException("Error parsing Myki data", ex);
    }
  }