Skip to content

Commit

Permalink
Version 1.2.6 (as published in Google Play)
Browse files Browse the repository at this point in the history
 • explain the field "cryptogram information data" in log entries
  • Loading branch information
johnzweng committed Nov 28, 2014
1 parent e8346b7 commit b20e5db
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 38 deletions.
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.zweng.bankomatinfos"
android:versionCode="11"
android:versionName="1.2.5" >
android:versionCode="12"
android:versionName="1.2.6" >

<uses-sdk
android:minSdkVersion="15"
Expand Down
25 changes: 8 additions & 17 deletions doc/google_play_store/changelog_de.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
Version 1.2.5 (11.10.2014):
• Anzeige weiterer allgemeiner Kartendaten (OS, IC, etc..)
• zeige Hinweis bei neueren Karten die keine Logs mehr speichern
• bugfix: Exception beim Lesen bestimmter Karten behoben


Version 1.2.4 (19.01.2014):
• zeigt nun auch: Ablaufdatum, Austellungsdatum und Kartennummer
• bugfix: IOException bei App-Neustart behoben
• bugfix: Absturz auf "Einstellungen" Seite behoben
• neuer Menüeintrag: "Spenden"


Version 1.2.3 (12.01.2014):
• bessere Aufschlüsselung der Transaktionen
• bugfix: Lesefehler bei bestimmten Transaktionstypen behoben
• bugfix: falsche Uhrzeit bei manchen Transaktionen behoben
Version 1.2.6 (28.11.2014):
• Erkläre die Bedeutung des Felds "cryptogram information data" in den Log-Einträgen


Version 1.2.5 (11.10.2014):
• Anzeige weiterer allgemeiner Kartendaten (OS, IC, etc..)
• zeige Hinweis bei neueren Karten die keine Logs mehr speichern
• bugfix: Exception beim Lesen bestimmter Karten behoben
25 changes: 8 additions & 17 deletions doc/google_play_store/changelog_en.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
Version 1.2.5 (11.10.2014):
• now also shows some generic infos about card (OS, IC type, etc..)
• display note for newer cards which don't contain tx logs
• bugfix: fixed exception occuring with some cards


Version 1.2.4 (2014-01-19):
• shows new fields: expiration date, activation date, card number
• bugfix: fixed IOException on app restart
• bugfix: fixed crash on "Settings" page
• new menu entry: "Donation"


Version 1.2.3 (2014-01-12):
• better decoding of transactions!
• bugfix: corrected parsing error with some specific transactions
• bugfix: wrong time displayed in some transaction
Version 1.2.6 (2014-11-28):
• explain the field "cryptogram information data" in log entries


Version 1.2.5 (2014-10-11):
• now also shows some generic infos about card (OS, IC type, etc..)
• display note for newer cards which don't contain tx logs
• bugfix: fixed exception occuring with some cards
12 changes: 11 additions & 1 deletion res/layout/list_item_transaction_expanded.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@
android:text="0x40"
android:textAppearance="@style/TransactionListDetailData" />

<TextView
android:id="@+id/txListItemCryptogramInformationDataExplained"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/txListItemCryptogramInformationData"
android:layout_alignParentLeft="true"
android:layout_marginLeft="24dp"
android:layout_marginRight="8dp"
android:text="(online / offline etc..)"
android:textAppearance="@style/TransactionListDetailDataSmall" />



Expand All @@ -86,7 +96,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/txListItemCryptogramInformationData"
android:layout_below="@+id/txListItemCryptogramInformationDataExplained"
android:layout_marginRight="8dp"
android:layout_marginTop="4dp"
android:maxLines="1"
Expand Down
4 changes: 4 additions & 0 deletions res/raw-de/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
</style>
</head>
<body>
$ 1.2.6
% Version 1.2.6
_ 2014-11-28
* Erkläre die Bedeutung des Felds "cryptogram information data" in den Log-Einträgen
$ 1.2.5
% Version 1.2.5
_ 2014-10-11
Expand Down
4 changes: 4 additions & 0 deletions res/raw/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
</style>
</head>
<body>
$ 1.2.6
% Version 1.2.6
_ 2014-11-28
* explain the field "cryptogram information data" in log entries
$ 1.2.5
% Version 1.2.5
_ 2014-10-11
Expand Down
7 changes: 7 additions & 0 deletions res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,11 @@
<string name="pref_description_perform_full_file_scan_true">Scanne alle Dateien. Das Scannen dauert länger, findet aber *eventuell* auf manchen Karten mehr Daten.</string>
<string name="pref_description_perform_full_file_scan_false">Scanne nur die Standarddateien. Das Scannen der Karte geht schneller.</string>

<!-- Cryptogram information data -->
<string name="cryptogram_type_tc">Das Terminal darf diese Transaktion offline akzeptieren (kann aber aus anderen Gründen trotzdem online gehen und die Bank fragen).</string>
<string name="cryptogram_type_arqc">Das Terminal muss online gehen und die Bank fragen, ob diese Transaktion akzeptiert werden darf.</string>
<string name="cryptogram_type_aac">Die Karte hat diese Transaktion gleich offline abgelehnt.</string>
<string name="cryptogram_type_rfu">Dieser Typ ist reserviert für zukünftige Anwendungen.</string>


</resources>
6 changes: 6 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,10 @@
<string name="pref_description_perform_full_file_scan_true">Scan all files. This will take longer but *may* find more data.</string>
<string name="pref_description_perform_full_file_scan_false">Just scan well-known files. Scanning will be much faster.</string>

<!-- Cryptogram information data -->
<string name="cryptogram_type_tc">The terminal is allowed accept this transaction offline (but it still may go online for other reasons).</string>
<string name="cryptogram_type_arqc">The terminal must go online and ask the bank if this transaction should be accepted.</string>
<string name="cryptogram_type_aac">The card immediately declined this transaction offline.</string>
<string name="cryptogram_type_rfu">This type is reserved for future use.</string>

</resources>
6 changes: 6 additions & 0 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
<item name="android:textColor">#444444</item>
</style>

<style name="TransactionListDetailDataSmall">
<item name="android:textSize">12sp</item>
<item name="android:textColor">#444444</item>
<item name="android:textStyle">italic</item>
</style>

<style name="TransactionListHexData">
<item name="android:textSize">12sp</item>
<item name="android:textColor">#eeeeee</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,15 @@ private CardInfo searchForFiles(CardInfo result, boolean fullFileScan,
_ctl.log(txLogEntry.toString());
}
} else {
logBerTlvResponse(responsePdu);
// avoid that a single unparsable record may abort
// the whole scan
try {
logBerTlvResponse(responsePdu);
} catch (Exception e) {
Log.w(TAG,
"Ignored exception while parsing TLV data",
e);
}
}
} else {
logResultPdu(responsePdu);
Expand Down
6 changes: 6 additions & 0 deletions src/at/zweng/bankomatinfos/ui/ListAdapterTransactions.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import static at.zweng.bankomatinfos.util.Utils.byte2Hex;
import static at.zweng.bankomatinfos.util.Utils.bytesToHex;
import static at.zweng.bankomatinfos.util.Utils.explainCryptogramInformationByte;
import static at.zweng.bankomatinfos.util.Utils.formatBalance;
import static at.zweng.bankomatinfos.util.Utils.formatDateWithTime;
import static at.zweng.bankomatinfos.util.Utils.prettyPrintString;
Expand Down Expand Up @@ -94,6 +95,8 @@ public View getView(int position, View v, ViewGroup parent) {
if (showFullTxData) {
TextView cryptogramInformation = (TextView) v
.findViewById(R.id.txListItemCryptogramInformationData);
TextView cryptogramInformationExplained = (TextView) v
.findViewById(R.id.txListItemCryptogramInformationDataExplained);
TextView atc = (TextView) v.findViewById(R.id.txListItemATC);

TextView appDefaultAction = (TextView) v
Expand All @@ -106,6 +109,9 @@ public View getView(int position, View v, ViewGroup parent) {

cryptogramInformation.setText("0x"
+ byte2Hex(tx.getCryptogramInformationData()));
cryptogramInformationExplained
.setText(explainCryptogramInformationByte(tx
.getCryptogramInformationData(),_context));
atc.setText(Integer.toString(tx.getAtc()));
appDefaultAction.setText(prettyPrintString(
bytesToHex(tx.getApplicationDefaultAction()), 2));
Expand Down
55 changes: 55 additions & 0 deletions src/at/zweng/bankomatinfos/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,61 @@ public static String getAppVersion(Context ctx) {
}
}

/**
* Parse the byte "cryptogram infrmation data". See EMV specifications 4.3,
* EMV Book 3, page 56 (page 72 in the pdf), Table 14:
* "Coding of Cryptogram Information Data"
*
* @param b
* @param ctx
* @return
*/
public static String explainCryptogramInformationByte(byte b, Context ctx) {
// b8 b7
// 0 0 --> AAC
// 0 1 --> TC
// 1 0 --> ARQC
// 1 1 --> RFU
//
// b6 b5
// reserved for payment system specific cryptograms
//
// b4
// 0 --> No advice required
// 1 --> Advice reequired
//
// b3 b1 b1 : reason/advice code
// 1 x x: RFU
// 0 0 0: no information given
// 0 0 1: service not allowed
// 0 1 0: pin try limit exceeded
// 0 1 1: issuer authentication failed

StringBuilder s = new StringBuilder();

// bit 8 == 1 and bit 7 == 0
if (((b >>> 7 & (byte) 0x01) == 1) && ((b >>> 6 & (byte) 0x01) == 0)) {
s.append("ARQC: " + ctx.getString(R.string.cryptogram_type_arqc));
} else
// bit 8 == 0 and bit 7 == 1
if (((b >>> 7 & (byte) 0x01) == 0) && ((b >>> 6 & (byte) 0x01) == 1)) {
s.append("TC: " + ctx.getString(R.string.cryptogram_type_tc));
} else
// bit 8 == 0 and bit 7 == 0
if (((b >>> 7 & (byte) 0x01) == 0) && ((b >>> 6 & (byte) 0x01) == 0)) {
s.append("AAC: " + ctx.getString(R.string.cryptogram_type_aac));
} else
// bit 8 == 1 and bit 7 == 1
if (((b >>> 7 & (byte) 0x01) == 1) && ((b >>> 6 & (byte) 0x01) == 1)) {
s.append("RFU: " + ctx.getString(R.string.cryptogram_type_rfu));
}

// TODO: parse and explaining remaining bits
// (but as it seems most of the time they are zero)

return s.toString();
}

/**
* show about dialog
*/
Expand Down

0 comments on commit b20e5db

Please sign in to comment.