diff --git a/NFC/NfcTransactionHandler/bin/img/Thumbs.db b/NFC/NfcTransactionHandler/bin/img/Thumbs.db deleted file mode 100644 index a97c484..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/Thumbs.db and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_led_err.png b/NFC/NfcTransactionHandler/bin/img/ce_led_err.png deleted file mode 100644 index 625efd3..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_led_err.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_led_off.png b/NFC/NfcTransactionHandler/bin/img/ce_led_off.png deleted file mode 100644 index 2bb7adb..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_led_off.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_led_on.png b/NFC/NfcTransactionHandler/bin/img/ce_led_on.png deleted file mode 100644 index bf4ecef..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_led_on.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_off_clicked.png b/NFC/NfcTransactionHandler/bin/img/ce_off_clicked.png deleted file mode 100644 index c5e0044..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_off_clicked.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_off_focused.png b/NFC/NfcTransactionHandler/bin/img/ce_off_focused.png deleted file mode 100644 index 7547ba1..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_off_focused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_off_unfocused.png b/NFC/NfcTransactionHandler/bin/img/ce_off_unfocused.png deleted file mode 100644 index 9280ed0..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_off_unfocused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_on_clicked.png b/NFC/NfcTransactionHandler/bin/img/ce_on_clicked.png deleted file mode 100644 index 512215a..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_on_clicked.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_on_focused.png b/NFC/NfcTransactionHandler/bin/img/ce_on_focused.png deleted file mode 100644 index f26c51e..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_on_focused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/ce_on_unfocused.png b/NFC/NfcTransactionHandler/bin/img/ce_on_unfocused.png deleted file mode 100644 index 868a7cc..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/ce_on_unfocused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/clear_clicked.png b/NFC/NfcTransactionHandler/bin/img/clear_clicked.png deleted file mode 100644 index 114a91f..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/clear_clicked.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/clear_focused.png b/NFC/NfcTransactionHandler/bin/img/clear_focused.png deleted file mode 100644 index f29a30e..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/clear_focused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/clear_unfocused.png b/NFC/NfcTransactionHandler/bin/img/clear_unfocused.png deleted file mode 100644 index f6c2403..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/clear_unfocused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/close_clicked.png b/NFC/NfcTransactionHandler/bin/img/close_clicked.png deleted file mode 100644 index 3cbe55a..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/close_clicked.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/close_focused.png b/NFC/NfcTransactionHandler/bin/img/close_focused.png deleted file mode 100644 index 7587b21..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/close_focused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/close_unfocused.png b/NFC/NfcTransactionHandler/bin/img/close_unfocused.png deleted file mode 100644 index feec44f..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/close_unfocused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/icon.png b/NFC/NfcTransactionHandler/bin/img/icon.png deleted file mode 100644 index 193950c..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/icon.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/icon2.png b/NFC/NfcTransactionHandler/bin/img/icon2.png deleted file mode 100644 index 755cc13..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/icon2.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/led_err.png b/NFC/NfcTransactionHandler/bin/img/led_err.png deleted file mode 100644 index d5f0ca9..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/led_err.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/led_off.png b/NFC/NfcTransactionHandler/bin/img/led_off.png deleted file mode 100644 index 86426e0..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/led_off.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/led_on.png b/NFC/NfcTransactionHandler/bin/img/led_on.png deleted file mode 100644 index bfd3ad0..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/led_on.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/nfc_led_err.png b/NFC/NfcTransactionHandler/bin/img/nfc_led_err.png deleted file mode 100644 index 76a03ce..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/nfc_led_err.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/nfc_led_off.png b/NFC/NfcTransactionHandler/bin/img/nfc_led_off.png deleted file mode 100644 index 11eab25..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/nfc_led_off.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/nfc_led_on.png b/NFC/NfcTransactionHandler/bin/img/nfc_led_on.png deleted file mode 100644 index 7995400..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/nfc_led_on.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/photothumb.db b/NFC/NfcTransactionHandler/bin/img/photothumb.db deleted file mode 100644 index 20e1d9e..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/photothumb.db and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/select_clicked.png b/NFC/NfcTransactionHandler/bin/img/select_clicked.png deleted file mode 100644 index 8eaaa27..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/select_clicked.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/select_disabled.png b/NFC/NfcTransactionHandler/bin/img/select_disabled.png deleted file mode 100644 index 05616e3..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/select_disabled.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/select_disabled_focused.png b/NFC/NfcTransactionHandler/bin/img/select_disabled_focused.png deleted file mode 100644 index 494e989..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/select_disabled_focused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/select_focused.png b/NFC/NfcTransactionHandler/bin/img/select_focused.png deleted file mode 100644 index d9f5e9f..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/select_focused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/select_unfocused.png b/NFC/NfcTransactionHandler/bin/img/select_unfocused.png deleted file mode 100644 index b4f216c..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/select_unfocused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/settings_clicked.png b/NFC/NfcTransactionHandler/bin/img/settings_clicked.png deleted file mode 100644 index 188e0ed..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/settings_clicked.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/settings_focused.png b/NFC/NfcTransactionHandler/bin/img/settings_focused.png deleted file mode 100644 index 40a20b3..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/settings_focused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/img/settings_unfocused.png b/NFC/NfcTransactionHandler/bin/img/settings_unfocused.png deleted file mode 100644 index 4801a60..0000000 Binary files a/NFC/NfcTransactionHandler/bin/img/settings_unfocused.png and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Constants.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Constants.class deleted file mode 100644 index e6c4206..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Constants.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/NfcTransHandlerApp.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/NfcTransHandlerApp.class deleted file mode 100644 index 2ec85b4..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/NfcTransHandlerApp.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Settings.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Settings.class deleted file mode 100644 index c99ad28..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Settings.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Utilities.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Utilities.class deleted file mode 100644 index 3d17158..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/Utilities.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/ClearCommand.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/ClearCommand.class deleted file mode 100644 index f2683fb..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/ClearCommand.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/CloseCommand.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/CloseCommand.class deleted file mode 100644 index 7e7bbe9..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/CloseCommand.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/Iso7816Command.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/Iso7816Command.class deleted file mode 100644 index df0c4f3..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/Iso7816Command.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/KillCommand.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/KillCommand.class deleted file mode 100644 index a6ff911..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/KillCommand.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/SettingsCommand.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/SettingsCommand.class deleted file mode 100644 index 81eed70..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/SettingsCommand.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/ToggleCeCommand.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/ToggleCeCommand.class deleted file mode 100644 index 8125bf8..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/commands/ToggleCeCommand.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/CardEmulation.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/CardEmulation.class deleted file mode 100644 index 2208a20..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/CardEmulation.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/MyNfcStatusListener.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/MyNfcStatusListener.class deleted file mode 100644 index 30e2c65..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/MyNfcStatusListener.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/NfcService.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/NfcService.class deleted file mode 100644 index 0b0ffcc..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/nfc/NfcService.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/GraphicalButton.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/GraphicalButton.class deleted file mode 100644 index 65f7ff2..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/GraphicalButton.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/LabelFieldColoured.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/LabelFieldColoured.class deleted file mode 100644 index 03ba221..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/LabelFieldColoured.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcSettingsScreen$1.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcSettingsScreen$1.class deleted file mode 100644 index 1871116..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcSettingsScreen$1.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcSettingsScreen.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcSettingsScreen.class deleted file mode 100644 index 820378f..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcSettingsScreen.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$1.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$1.class deleted file mode 100644 index daf3b80..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$1.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$2.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$2.class deleted file mode 100644 index a4b70d2..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$2.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$3.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$3.class deleted file mode 100644 index dadf506..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$3.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$4.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$4.class deleted file mode 100644 index 62e41b3..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$4.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$5.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$5.class deleted file mode 100644 index 876a4fb..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$5.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$6.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$6.class deleted file mode 100644 index 2cac16e..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen$6.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen.class deleted file mode 100644 index 4ec516d..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/NfcTransScreen.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/TextDetailsProvider.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/TextDetailsProvider.class deleted file mode 100644 index f2162fa..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/TextDetailsProvider.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/TimedLabelField.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/TimedLabelField.class deleted file mode 100644 index 5148ef7..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/TimedLabelField.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MsbConfig.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MsbConfig.class deleted file mode 100644 index e88eaec..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MsbConfig.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MsbState.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MsbState.class deleted file mode 100644 index 062f853..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MsbState.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MultiStateButtonField.class b/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MultiStateButtonField.class deleted file mode 100644 index d1012ee..0000000 Binary files a/NFC/NfcTransactionHandler/bin/nfc/sample/nfctransaction/ui/buttons/MultiStateButtonField.class and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler-1.debug b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler-1.debug deleted file mode 100644 index e25cdbd..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler-1.debug and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler-2.debug b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler-2.debug deleted file mode 100644 index 393fc18..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler-2.debug and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.cod b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.cod deleted file mode 100644 index 1baceef..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.cod and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.csl b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.csl deleted file mode 100644 index 182d9d8..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.csl +++ /dev/null @@ -1,2 +0,0 @@ -52525400=RIM Runtime API -4e464352=NFCRoutingAPI diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.cso b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.cso deleted file mode 100644 index 1a589a3..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.cso +++ /dev/null @@ -1,5 +0,0 @@ -33000000=RIMAPPSA2 -52424200=RIM Blackberry Apps API -52434900=RIM Crypto API - Internal -52435200=RIM Crypto API - RIM -4e464352=NFCRoutingAPI diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.debug b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.debug deleted file mode 100644 index 9ea28c5..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.debug and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.jad b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.jad deleted file mode 100644 index a2010d6..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.jad +++ /dev/null @@ -1,24 +0,0 @@ -MIDlet-Name: NfcTransactionHandler -MIDlet-Version: 1.0.0 -MIDlet-Vendor: Martin Woolley -MIDlet-Jar-URL: NfcTransactionHandler.jar -MIDlet-Jar-Size: 216320 -MicroEdition-Profile: MIDP-2.0 -MicroEdition-Configuration: CLDC-1.1 -MIDlet-1: ,img/icon2.png, -RIM-MIDlet-Flags-1: 0 -MIDlet-2: nfc_handler,,auto -RIM-MIDlet-Flags-2: 3 -Manifest-Version: 1.0 -RIM-COD-URL: NfcTransactionHandler.cod -RIM-COD-Size: 54700 -RIM-COD-Creation-Time: 1330081854 -RIM-COD-Module-Name: NfcTransactionHandler -RIM-COD-Module-Dependencies: net_rim_cldc,net_rim_satsa,net_rim_nfc -RIM-COD-SHA1: 4c 05 1e 9f ae 57 e5 60 13 12 8d fb 23 0d 46 cc 98 ce 6c 54 -RIM-COD-URL-1: NfcTransactionHandler-1.cod -RIM-COD-Size-1: 63924 -RIM-COD-SHA1-1: b4 63 e0 08 11 6b 0e 1e e7 94 04 d6 d6 02 bc d2 91 9c bc ca -RIM-COD-URL-2: NfcTransactionHandler-2.cod -RIM-COD-Size-2: 20568 -RIM-COD-SHA1-2: f4 e5 36 69 6b bd 85 8c d5 69 f7 b1 e6 e1 70 80 3b c8 6a 87 diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.jar b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.jar deleted file mode 100644 index 96740f0..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.jar and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.rapc b/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.rapc deleted file mode 100644 index 7688bcb..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Standard/7.0.0/NfcTransactionHandler.rapc +++ /dev/null @@ -1,12 +0,0 @@ -MIDlet-Name: NfcTransactionHandler -MIDlet-Version: 1.0.0 -MIDlet-Vendor: Martin Woolley -MIDlet-Jar-URL: NfcTransactionHandler.jar -MIDlet-Jar-Size: 0 -MicroEdition-Profile: MIDP-2.0 -MicroEdition-Configuration: CLDC-1.1 -MIDlet-1: ,img/icon2.png, -RIM-MIDlet-Flags-1: 0 -MIDlet-2: nfc_handler,,auto -RIM-MIDlet-Flags-2: 3 - diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/NfcTransactionHandler.alx b/NFC/NfcTransactionHandler/deliverables/Standard/NfcTransactionHandler.alx deleted file mode 100644 index 06e794e..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Standard/NfcTransactionHandler.alx +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - 1.0.0 - - - Martin Woolley - - - Copyright (c) 2012 Martin Woolley - - - - 7.0.0 - - - NfcTransactionHandler.cod - - - - - - - - diff --git a/NFC/NfcTransactionHandler/deliverables/Standard/NfcTransactionHandler2.alx b/NFC/NfcTransactionHandler/deliverables/Standard/NfcTransactionHandler2.alx deleted file mode 100644 index 159176c..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Standard/NfcTransactionHandler2.alx +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - 1.0.0 - - - BlackBerry Developer - - - Copyright (c) 2011 BlackBerry Developer - - - - 7.0.0 - - - NfcTransactionHandler2.cod - - - - - - - - diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-1.cod b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-1.cod deleted file mode 100644 index 9322784..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-1.cod and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-1.debug b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-1.debug deleted file mode 100644 index e25cdbd..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-1.debug and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-2.cod b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-2.cod deleted file mode 100644 index 42c41be..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-2.cod and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-2.debug b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-2.debug deleted file mode 100644 index 393fc18..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler-2.debug and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.cod b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.cod deleted file mode 100644 index 14dcbab..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.cod and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.csl b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.csl deleted file mode 100644 index 182d9d8..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.csl +++ /dev/null @@ -1,2 +0,0 @@ -52525400=RIM Runtime API -4e464352=NFCRoutingAPI diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.cso b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.cso deleted file mode 100644 index 1a589a3..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.cso +++ /dev/null @@ -1,5 +0,0 @@ -33000000=RIMAPPSA2 -52424200=RIM Blackberry Apps API -52434900=RIM Crypto API - Internal -52435200=RIM Crypto API - RIM -4e464352=NFCRoutingAPI diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.debug b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.debug deleted file mode 100644 index 9ea28c5..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.debug and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.jad b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.jad deleted file mode 100644 index a2010d6..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.jad +++ /dev/null @@ -1,24 +0,0 @@ -MIDlet-Name: NfcTransactionHandler -MIDlet-Version: 1.0.0 -MIDlet-Vendor: Martin Woolley -MIDlet-Jar-URL: NfcTransactionHandler.jar -MIDlet-Jar-Size: 216320 -MicroEdition-Profile: MIDP-2.0 -MicroEdition-Configuration: CLDC-1.1 -MIDlet-1: ,img/icon2.png, -RIM-MIDlet-Flags-1: 0 -MIDlet-2: nfc_handler,,auto -RIM-MIDlet-Flags-2: 3 -Manifest-Version: 1.0 -RIM-COD-URL: NfcTransactionHandler.cod -RIM-COD-Size: 54700 -RIM-COD-Creation-Time: 1330081854 -RIM-COD-Module-Name: NfcTransactionHandler -RIM-COD-Module-Dependencies: net_rim_cldc,net_rim_satsa,net_rim_nfc -RIM-COD-SHA1: 4c 05 1e 9f ae 57 e5 60 13 12 8d fb 23 0d 46 cc 98 ce 6c 54 -RIM-COD-URL-1: NfcTransactionHandler-1.cod -RIM-COD-Size-1: 63924 -RIM-COD-SHA1-1: b4 63 e0 08 11 6b 0e 1e e7 94 04 d6 d6 02 bc d2 91 9c bc ca -RIM-COD-URL-2: NfcTransactionHandler-2.cod -RIM-COD-Size-2: 20568 -RIM-COD-SHA1-2: f4 e5 36 69 6b bd 85 8c d5 69 f7 b1 e6 e1 70 80 3b c8 6a 87 diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.jar b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.jar deleted file mode 100644 index 96740f0..0000000 Binary files a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.jar and /dev/null differ diff --git a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.rapc b/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.rapc deleted file mode 100644 index 7688bcb..0000000 --- a/NFC/NfcTransactionHandler/deliverables/Web/7.0.0/NfcTransactionHandler.rapc +++ /dev/null @@ -1,12 +0,0 @@ -MIDlet-Name: NfcTransactionHandler -MIDlet-Version: 1.0.0 -MIDlet-Vendor: Martin Woolley -MIDlet-Jar-URL: NfcTransactionHandler.jar -MIDlet-Jar-Size: 0 -MicroEdition-Profile: MIDP-2.0 -MicroEdition-Configuration: CLDC-1.1 -MIDlet-1: ,img/icon2.png, -RIM-MIDlet-Flags-1: 0 -MIDlet-2: nfc_handler,,auto -RIM-MIDlet-Flags-2: 3 - diff --git a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/Constants.java b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/Constants.java old mode 100644 new mode 100755 index d91dee4..c76d7ff --- a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/Constants.java +++ b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/Constants.java @@ -1,59 +1,55 @@ -package nfc.sample.nfctransaction; -/* -* Copyright (c) 2012 Research In Motion Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import net.rim.device.api.ui.Color; - -public class Constants { - public static String VERSION = "1.2.0"; - - public static final int SE_SIM=0; - public static final int SE_EMB=1; - public static String [] SE_NAMES = {"SIM","EMBEDDED"}; - - // SIM 1 -// public static final byte[][] MY_AIDS = { { 0x4E, 0x46, 0x43, 0x54, 0x65, 0x73, 0x74, 0x65, 0x72, 0x20, 0x31, 0x2E, 0x30 } }; -// public static final String CONNECTION_STRING = "apdu:0;target=4E.46.43.54.65.73.74.65.72.20.31.2E.30"; - // SIM 2 - public static final byte[][] MY_AIDS = { { 0x6E, 0x66, 0x63, 0x74, 0x65, 0x73, 0x74, 0x30, 0x31 } }; - public static final String CONNECTION_STRING = "apdu:0;target=6E.66.63.74.65.73.74.30.31"; - - public static long UI_IS_RUNNING = 0xcb4b95cab37dbc72L; - - public static final int BACKGROUND_COLOUR = Color.BLACK; - - // navigation - public static final int INDEX_CE = 0; - public static final int INDEX_CLEAR = 1; - public static final int INDEX_CLOSE = 2; - public static final int INDEX_STATUS = 3; - public static final int INDEX_KILL = 4; - - // LEDs - public static final int LED_OFF = 0; - public static final int LED_ON = 1; - public static final int LED_ERR = 2; - - // buttons - public static final int BTN_DEFAULT = 0; - public static final int BTN_CE_ON = 0; - public static final int BTN_CE_OFF = 1; - public static final int BTN_SELECT_OFF = 1; - public static final int BTN_SELECT_ON = 0; - - public static final String AID_SPACE = "--.--.--.--.--.--.--.--.--"; - - public static final String READY = "Ready"; -} +package nfc.sample.nfctransaction; +/* +* Copyright (c) 2012 Research In Motion Limited. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import net.rim.device.api.ui.Color; + +public class Constants { + public static String VERSION = "1.2.1"; + + public static final int SE_SIM=0; + public static final int SE_EMB=1; + public static String [] SE_NAMES = {"SIM","EMBEDDED"}; + + public static final byte[] DEFAULT_AID = { 0x6E, 0x66, 0x63, 0x74, 0x65, 0x73, 0x74, 0x30, 0x31 }; + public static final byte[] DEFAULT_APDU = { (byte)0x80, 1, 0, 0}; + + public static long UI_IS_RUNNING = 0xcb4b95cab37dbc72L; + + public static final int BACKGROUND_COLOUR = Color.BLACK; + + // navigation + public static final int INDEX_CE = 0; + public static final int INDEX_CLEAR = 1; + public static final int INDEX_CLOSE = 2; + public static final int INDEX_STATUS = 3; + public static final int INDEX_KILL = 4; + + // LEDs + public static final int LED_OFF = 0; + public static final int LED_ON = 1; + public static final int LED_ERR = 2; + + // buttons + public static final int BTN_DEFAULT = 0; + public static final int BTN_CE_ON = 0; + public static final int BTN_CE_OFF = 1; + public static final int BTN_SELECT_OFF = 1; + public static final int BTN_SELECT_ON = 0; + + public static final String AID_SPACE = "--.--.--.--.--.--.--.--.--"; + + public static final String READY = "Ready"; +} diff --git a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/Settings.java b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/Settings.java index 96b95db..b16ce23 100644 --- a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/Settings.java +++ b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/Settings.java @@ -1,154 +1,167 @@ -package nfc.sample.nfctransaction; -/* - * Copyright (c) 2012 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - * A singleton which holds application settings - * - */ - -import net.rim.device.api.system.PersistentObject; -import net.rim.device.api.system.PersistentStore; -import net.rim.device.api.util.ByteArrayUtilities; -import net.rim.device.api.util.Persistable; - -public class Settings implements Persistable { - - private static final long SETTINGS_ID = 0x8a75c361cc97f9d8L; - - private static Settings _settings; - - private int _secure_element; // 0=SIM, 1=eSE - private boolean _ISO14443A; - private boolean _ISO14443B; - private boolean _ISO14443B_PRIME; - private String _registered_aid=""; - - private byte [][] _registered_aid_arrays = { { 0x6E, 0x66, 0x63, 0x74, 0x65, 0x73, 0x74, 0x30, 0x31 } };; - - private Settings() { - } - - public static synchronized Settings getInstance() { - if (_settings == null) { - _settings = new Settings(); - loadSettings(); - } - return _settings; - } - - public String toString() { - return - "SE="+Constants.SE_NAMES[_secure_element]+ - ",ISO14443A="+_ISO14443A+ - ",ISO14443B="+_ISO14443B+ - ",ISO14443B_PRIME="+_ISO14443B_PRIME+ - ",AID="+_registered_aid; - - } - - private static void loadSettings() { - synchronized(PersistentStore.getSynchObject()) { - PersistentObject po = PersistentStore.getPersistentObject(SETTINGS_ID); - Object obj = po.getContents(); - if (obj != null) { - _settings = (Settings) obj; - } else { - _settings.setISO14443A(false); - _settings.setISO14443B(true); - _settings.setISO14443B_PRIME(false); - _settings.setSecure_element(Constants.SE_SIM); - _settings.setRegistered_aid(ByteArrayUtilities.byteArrayToHex(Constants.MY_AIDS[0])); - } - _settings.setRegistered_aid_arrays(_settings.getRegistered_aid()); - } - } - - public void saveSettings() { - Utilities.log("XXXX " + Thread.currentThread().getName() + " Saving settings"); - synchronized(PersistentStore.getSynchObject()) { - PersistentObject po = PersistentStore.getPersistentObject(SETTINGS_ID); - po.setContents(_settings); - po.commit(); - Utilities.log("XXXX " + Thread.currentThread().getName() + " Saved settings:" + _settings.toString()); - } - } - - public int getSecure_element() { - return _secure_element; - } - - public void setSecure_element(int secure_element) { - _secure_element = secure_element; - } - - public void setSeSIM() { - _secure_element = Constants.SE_SIM; - } - - public void setSeEmbedded() { - _secure_element = Constants.SE_EMB; - } - - public boolean isSimSeSelected() { - return (_secure_element == Constants.SE_SIM); - } - - public boolean isEmbeddedSeSelected() { - return (_secure_element == Constants.SE_EMB); - } - - public boolean isISO14443A() { - return _ISO14443A; - } - - public void setISO14443A(boolean iSO14443A) { - _ISO14443A = iSO14443A; - } - - public boolean isISO14443B() { - return _ISO14443B; - } - - public void setISO14443B(boolean iSO14443B) { - _ISO14443B = iSO14443B; - } - - public boolean isISO14443B_PRIME() { - return _ISO14443B_PRIME; - } - - public void setISO14443B_PRIME(boolean iSO14443B_PRIME) { - _ISO14443B_PRIME = iSO14443B_PRIME; - } - - public String getRegistered_aid() { - return _registered_aid; - } - - public byte [][] getRegistered_aid_arrays() { - return _registered_aid_arrays; - } - - public void setRegistered_aid(String registered_aid) { - _registered_aid = registered_aid; - setRegistered_aid_arrays(registered_aid); - } - - public void setRegistered_aid_arrays(String registered_aid) { - _registered_aid_arrays[0] = ByteArrayUtilities.hexToByteArray(registered_aid); - } - -} +package nfc.sample.nfctransaction; +/* + * Copyright (c) 2012 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * A singleton which holds application settings + * + */ + +import net.rim.device.api.system.PersistentObject; +import net.rim.device.api.system.PersistentStore; +import net.rim.device.api.util.ByteArrayUtilities; +import net.rim.device.api.util.Persistable; + +public class Settings implements Persistable { + + private static final long SETTINGS_ID = 0x8a75c361cc97f9d8L; + + private static Settings _settings; + + private int _secure_element; // 0=SIM, 1=eSE + private boolean _ISO14443A; + private boolean _ISO14443B; + private boolean _ISO14443B_PRIME; + private String _registered_aid=""; + private String _apdu; + + private Settings() { + } + + public static synchronized Settings getInstance() { + if (_settings == null) { + _settings = new Settings(); + loadSettings(); + } + return _settings; + } + + public String toString() { + return + "SE="+Constants.SE_NAMES[_secure_element]+ + ",ISO14443A="+_ISO14443A+ + ",ISO14443B="+_ISO14443B+ + ",ISO14443B_PRIME="+_ISO14443B_PRIME+ + ",AID="+_registered_aid; + + } + + private static void loadSettings() { + synchronized(PersistentStore.getSynchObject()) { + PersistentObject po = PersistentStore.getPersistentObject(SETTINGS_ID); + Object obj = po.getContents(); + if (obj != null) { + _settings = (Settings) obj; + } else { + _settings.setISO14443A(false); + _settings.setISO14443B(true); + _settings.setISO14443B_PRIME(false); + _settings.setSecure_element(Constants.SE_SIM); + _settings.setRegisteredAID(Constants.DEFAULT_AID); + _settings.setAPDU(Constants.DEFAULT_APDU); + } + } + } + + public void saveSettings() { + Utilities.log("XXXX " + Thread.currentThread().getName() + " Saving settings"); + synchronized(PersistentStore.getSynchObject()) { + PersistentObject po = PersistentStore.getPersistentObject(SETTINGS_ID); + po.setContents(_settings); + po.commit(); + Utilities.log("XXXX " + Thread.currentThread().getName() + " Saved settings:" + _settings.toString()); + } + } + + public int getSecure_element() { + return _secure_element; + } + + public void setSecure_element(int secure_element) { + _secure_element = secure_element; + } + + public void setSeSIM() { + _secure_element = Constants.SE_SIM; + } + + public void setSeEmbedded() { + _secure_element = Constants.SE_EMB; + } + + public boolean isSimSeSelected() { + return (_secure_element == Constants.SE_SIM); + } + + public boolean isEmbeddedSeSelected() { + return (_secure_element == Constants.SE_EMB); + } + + public boolean isISO14443A() { + return _ISO14443A; + } + + public void setISO14443A(boolean iSO14443A) { + _ISO14443A = iSO14443A; + } + + public boolean isISO14443B() { + return _ISO14443B; + } + + public void setISO14443B(boolean iSO14443B) { + _ISO14443B = iSO14443B; + } + + public boolean isISO14443B_PRIME() { + return _ISO14443B_PRIME; + } + + public void setISO14443B_PRIME(boolean iSO14443B_PRIME) { + _ISO14443B_PRIME = iSO14443B_PRIME; + } + + public String getRegisteredAIDAsString() { + return _registered_aid; + } + + public byte [] getRegisteredAID() { + return ByteArrayUtilities.hexToByteArray(_registered_aid); + } + + public void setRegisteredAID(String registered_aid) { + _registered_aid = registered_aid; + } + + public void setRegisteredAID(byte [] registered_aid) { + _registered_aid = ByteArrayUtilities.byteArrayToHex(registered_aid); + } + + public byte [] getAPDU() { + return ByteArrayUtilities.hexToByteArray(_apdu); + } + + public String getAPDUAsString() { + return _apdu; + } + + public void setAPDU(String apdu) { + _apdu = apdu; + } + + public void setAPDU(byte [] apdu) { + _apdu = ByteArrayUtilities.byteArrayToHex(apdu); + } +} diff --git a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/commands/Iso7816Command.java b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/commands/Iso7816Command.java old mode 100644 new mode 100755 index 90f241a..12c023a --- a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/commands/Iso7816Command.java +++ b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/commands/Iso7816Command.java @@ -1,79 +1,79 @@ -package nfc.sample.nfctransaction.commands; - -/* - * Copyright (c) 2012 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import javax.microedition.apdu.APDUConnection; -import javax.microedition.io.Connector; - -import net.rim.device.api.command.AlwaysExecutableCommand; -import net.rim.device.api.command.ReadOnlyCommandMetadata; -import net.rim.device.api.util.ByteArrayUtilities; -import nfc.sample.nfctransaction.Constants; -import nfc.sample.nfctransaction.Settings; -import nfc.sample.nfctransaction.Utilities; -import nfc.sample.nfctransaction.ui.NfcTransScreen; -import nfc.sample.nfctransaction.ui.buttons.MultiStateButtonField; - -/** - * This command sends a ISO7816-4 SELECT APDU using the JSR177 API followed by a proprietary APDU. For this to work, the target - * SecureElement must contain an applet with the AID used here. So developers who just run this code to see what happens are - * likely to see an error from this command. This is to be expected however. - * - * Authors: John Murray and Martin Woolley - * - */ - -public class Iso7816Command extends AlwaysExecutableCommand { - - public void execute(ReadOnlyCommandMetadata metadata, Object context) { - MultiStateButtonField btn = (MultiStateButtonField) context; - if(btn.getMsbState() == Constants.BTN_SELECT_OFF) { - Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command exiting because button is in OFF state"); - return; - } - Settings settings = Settings.getInstance(); - NfcTransScreen screen = NfcTransScreen.getInstance(); - Utilities.log("XXXX " + Thread.currentThread().getName() + " selecting applet"); - APDUConnection apduConn = null; - // this is an example and completely proprietary APDU included solely to demonstrate the basic use of JSR-177 - // Decode: - // 0x80 : CLASS = proprietary - // 0x01 : INS = invented command! Interpretation will require the selected applet to understand this command - // 0x00 : P1 = null - // 0x00 : P1 = null - byte[] command = { (byte) 0x80, (byte) 0x01, (byte) 0x00, (byte) 0x00 }; - try { - // Open an APDUConnection to our applet. This results in an ISO 7816-4 SELECT command being sent by the JSR-177 API - String connection_string = Utilities.makeApduConnectionString(settings.getRegistered_aid()); - Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command: opening APDUConnection to " + connection_string); - apduConn = (APDUConnection) Connector.open(connection_string); - Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command: APDUConnection opened"); - screen.setUserMessage("Selected AID OK"); - // Send the APDU and wait for a response - expect an error here unless your applet supports the command that was sent - Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command: sending APDU"); - byte[] ret = apduConn.exchangeAPDU(command); - String resp_string = ByteArrayUtilities.byteArrayToHex(ret); - Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command: response=" + resp_string); - screen.setUserMessage("APDU response=" + resp_string); - // Close the logical channel connection - apduConn.close(); - } catch(Exception e) { - Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command failed:" + e.getClass().getName() + ":" + e.getMessage()); - screen.setUserMessage("Error. Select failed: check log"); - } - } - -} +package nfc.sample.nfctransaction.commands; + +/* + * Copyright (c) 2012 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import javax.microedition.apdu.APDUConnection; +import javax.microedition.io.Connector; + +import net.rim.device.api.command.AlwaysExecutableCommand; +import net.rim.device.api.command.ReadOnlyCommandMetadata; +import net.rim.device.api.util.ByteArrayUtilities; +import nfc.sample.nfctransaction.Constants; +import nfc.sample.nfctransaction.Settings; +import nfc.sample.nfctransaction.Utilities; +import nfc.sample.nfctransaction.ui.NfcTransScreen; +import nfc.sample.nfctransaction.ui.buttons.MultiStateButtonField; + +/** + * This command sends a ISO7816-4 SELECT APDU using the JSR177 API followed by a proprietary APDU. For this to work, the target + * SecureElement must contain an applet with the AID used here. So developers who just run this code to see what happens are + * likely to see an error from this command. This is to be expected however. + * + * Authors: John Murray and Martin Woolley + * + */ + +public class Iso7816Command extends AlwaysExecutableCommand { + + public void execute(ReadOnlyCommandMetadata metadata, Object context) { + MultiStateButtonField btn = (MultiStateButtonField) context; + if(btn.getMsbState() == Constants.BTN_SELECT_OFF) { + Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command exiting because button is in OFF state"); + return; + } + Settings settings = Settings.getInstance(); + NfcTransScreen screen = NfcTransScreen.getInstance(); + Utilities.log("XXXX " + Thread.currentThread().getName() + " selecting applet"); + APDUConnection apduConn = null; + // this is an example and completely proprietary APDU included solely to demonstrate the basic use of JSR-177 + // Decode: + // 0x80 : CLASS = proprietary + // 0x01 : INS = invented command! Interpretation will require the selected applet to understand this command + // 0x00 : P1 = null + // 0x00 : P1 = null + byte[] command = settings.getAPDU(); + try { + // Open an APDUConnection to our applet. This results in an ISO 7816-4 SELECT command being sent by the JSR-177 API + String connection_string = Utilities.makeApduConnectionString(settings.getRegisteredAIDAsString()); + Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command: opening APDUConnection to " + connection_string); + apduConn = (APDUConnection) Connector.open(connection_string); + Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command: APDUConnection opened"); + screen.setUserMessage("Selected AID OK"); + // Send the APDU and wait for a response - expect an error here unless your applet supports the command that was sent + Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command: sending APDU"); + byte[] ret = apduConn.exchangeAPDU(command); + String resp_string = ByteArrayUtilities.byteArrayToHex(ret); + Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command: response=" + resp_string); + screen.setUserMessage("APDU response=" + resp_string); + // Close the logical channel connection + apduConn.close(); + } catch(Exception e) { + Utilities.log("XXXX " + Thread.currentThread().getName() + " ISO 7816-4 command failed:" + e.getClass().getName() + ":" + e.getMessage()); + screen.setUserMessage("Error. Select failed: check log"); + } + } + +} diff --git a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/nfc/CardEmulation.java b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/nfc/CardEmulation.java old mode 100644 new mode 100755 index f823473..396a8e1 --- a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/nfc/CardEmulation.java +++ b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/nfc/CardEmulation.java @@ -1,205 +1,205 @@ -package nfc.sample.nfctransaction.nfc; -/* -* Copyright (c) 2012 Research In Motion Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import net.rim.device.api.io.nfc.NFCException; -import net.rim.device.api.io.nfc.emulation.TechnologyType; -import net.rim.device.api.io.nfc.se.SecureElement; -import net.rim.device.api.io.nfc.se.SecureElementManager; -import net.rim.device.api.io.nfc.se.TransactionListener; -import net.rim.device.api.system.ApplicationDescriptor; -import net.rim.device.api.system.ApplicationManager; -import nfc.sample.nfctransaction.Settings; -import nfc.sample.nfctransaction.Utilities; -import nfc.sample.nfctransaction.ui.TextDetailsProvider; - -// This class contains various Card Emulation related methods - -public class CardEmulation implements TextDetailsProvider { - - private static CardEmulation ce; - - private static TransactionListener _tl; - - private SecureElementManager sem = SecureElementManager.getInstance(); - private SecureElement se = null; - - private int tech_type=TechnologyType.ISO14443B; - - private boolean se_obtained = false; - - private int current_se=-1; - private int current_tt=-1; - - public static synchronized CardEmulation getInstance() { - if (ce == null) { - ce = new CardEmulation(); - } - return ce; - } - - public void initCe(int se_choice) throws NFCException { - se = sem.getSecureElement(se_choice); - if (se == null) { - Utilities.log("XXXX " + Thread.currentThread().getName() + " SecureElement(SIM) is null"); - se_obtained = false; - } else { - se_obtained = true; - current_se = se_choice; - } - } - - public static void registerTransactionListener(TransactionListener tl) { - - int pid = ApplicationManager.getApplicationManager().getProcessId(ApplicationDescriptor.currentApplicationDescriptor()); - Settings settings = Settings.getInstance(); - - SecureElementManager sem = SecureElementManager.getInstance(); - if(sem == null) { - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " SecureElementManager instance is null - exiting"); - System.exit(0); - } - - SecureElement[] sec_elements = null; - try { - sec_elements = sem.getSecureElements(); - } catch(NFCException e2) { - e2.printStackTrace(); - } - if(sec_elements == null) { - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " SecureElement[] is null - exiting"); - System.exit(0); - } - - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " device has " + sec_elements.length + " SEs"); - - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " getting SecureElement instance"); - SecureElement se = null; - try { - if(settings.isSimSeSelected()) { - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " Obtaining SecureElement in SIM"); - se = sem.getSecureElement(SecureElement.SIM); - } else { - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " Obtaining embedded SecureElement"); - se = sem.getSecureElement(SecureElement.EMBEDDED); - } - } catch(NFCException e1) { - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " exception when getting SE: " + e1.getClass().getName() + ":" + e1.getMessage()); - } - - if(se == null) { - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " SecureElement is null - exiting"); - System.exit(0); - } - - // register our app as a transaction listener - try { - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " adding transaction listener for AID:"+settings.getRegistered_aid()); - se.addTransactionListener(tl, settings.getRegistered_aid_arrays()); - _tl = tl; - } catch(NFCException e) { - if(!e.getMessage().startsWith("TransactionListener has already been added")) { - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " exception when adding transaction listener: " + e.getClass().getName() + ":" + e.getMessage()); - System.exit(0); - } - } - } - - public void removeTransactionListener() { - if (se != null && _tl != null) { - try { - int pid = ApplicationManager.getApplicationManager().getProcessId(ApplicationDescriptor.currentApplicationDescriptor()); - Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " removing transaction listener"); - se.removeTransactionListener(_tl); - } catch(NFCException e) { - Utilities.log("XXXX " + ":" + Thread.currentThread().getName() + " exception when removing transaction listener: " + e.getClass().getName() + ":" + e.getMessage()); - } - } - } - - public boolean isCeEnabled(int battery_mode) throws NFCException { - int types = getTechnologyTypes(battery_mode); - Utilities.log("XXXX " + Thread.currentThread().getName() + " " + Utilities.getTechnologyTypesNames(types)); - boolean ce_enabled = (types & TechnologyType.ISO14443B) == TechnologyType.ISO14443B; - Utilities.log("XXXX " + Thread.currentThread().getName() + " ce_enabled=" + ce_enabled); - return ce_enabled; - } - - public int getTechnologyTypes(int battery_mode) throws NFCException { - if (!se_obtained) { - return TechnologyType.NONE; - } - return se.getTechnologyTypes(battery_mode); - } - - public int getTechnologyTypes() throws NFCException { - return getTechnologyTypes(SecureElement.BATTERY_ON_MODE); - } - - public String getTextDetails() { - return Utilities.getCeStatusSummary(); - } - - public boolean isSe_obtained() { - return se_obtained; - } - - public void setSe_obtained(boolean se_obtained) { - this.se_obtained = se_obtained; - } - - public boolean setRoutingOn(int technology_types) throws NFCException { - if (se_obtained) { - se.setTechnologyTypes(SecureElement.BATTERY_ON_MODE, technology_types); - Utilities.log("XXXX " + Thread.currentThread().getName() + " NFC routing established OK"); - int types = se.getTechnologyTypes(SecureElement.BATTERY_ON_MODE); - Utilities.log("XXXX " + Thread.currentThread().getName() + " " + Utilities.getTechnologyTypesNames(types)); - current_tt = technology_types; - return true; - } else { - Utilities.log("XXXX " + Thread.currentThread().getName() + " No SE selected"); - return false; - } - } - - public boolean setRoutingOff() throws NFCException { - if (se_obtained) { - se.setTechnologyTypes(SecureElement.BATTERY_ON_MODE, TechnologyType.NONE); - return false; - } else { - Utilities.log("XXXX " + Thread.currentThread().getName() + " No SE selected"); - return true; - } - } - - public int getCurrentSecureElement() { - if (current_se != -1) { - return current_se; - } else { - // default is to use the SIM SE - return SecureElement.SIM; - } - } - - public int getCurrentTechnologyTypes() { - if (current_tt != -1) { - return current_tt; - } else { - // default is to use the ISO14443B - return TechnologyType.ISO14443B; - } - } - -} +package nfc.sample.nfctransaction.nfc; +/* +* Copyright (c) 2012 Research In Motion Limited. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import net.rim.device.api.io.nfc.NFCException; +import net.rim.device.api.io.nfc.emulation.TechnologyType; +import net.rim.device.api.io.nfc.se.SecureElement; +import net.rim.device.api.io.nfc.se.SecureElementManager; +import net.rim.device.api.io.nfc.se.TransactionListener; +import net.rim.device.api.system.ApplicationDescriptor; +import net.rim.device.api.system.ApplicationManager; +import nfc.sample.nfctransaction.Settings; +import nfc.sample.nfctransaction.Utilities; +import nfc.sample.nfctransaction.ui.TextDetailsProvider; + +// This class contains various Card Emulation related methods + +public class CardEmulation implements TextDetailsProvider { + + private static CardEmulation ce; + + private static TransactionListener _tl; + + private SecureElementManager sem = SecureElementManager.getInstance(); + private SecureElement se = null; + + private int tech_type=TechnologyType.ISO14443B; + + private boolean se_obtained = false; + + private int current_se=-1; + private int current_tt=-1; + + public static synchronized CardEmulation getInstance() { + if (ce == null) { + ce = new CardEmulation(); + } + return ce; + } + + public void initCe(int se_choice) throws NFCException { + se = sem.getSecureElement(se_choice); + if (se == null) { + Utilities.log("XXXX " + Thread.currentThread().getName() + " SecureElement(SIM) is null"); + se_obtained = false; + } else { + se_obtained = true; + current_se = se_choice; + } + } + + public static void registerTransactionListener(TransactionListener tl) { + + int pid = ApplicationManager.getApplicationManager().getProcessId(ApplicationDescriptor.currentApplicationDescriptor()); + Settings settings = Settings.getInstance(); + + SecureElementManager sem = SecureElementManager.getInstance(); + if(sem == null) { + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " SecureElementManager instance is null - exiting"); + System.exit(0); + } + + SecureElement[] sec_elements = null; + try { + sec_elements = sem.getSecureElements(); + } catch(NFCException e2) { + e2.printStackTrace(); + } + if(sec_elements == null) { + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " SecureElement[] is null - exiting"); + System.exit(0); + } + + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " device has " + sec_elements.length + " SEs"); + + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " getting SecureElement instance"); + SecureElement se = null; + try { + if(settings.isSimSeSelected()) { + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " Obtaining SecureElement in SIM"); + se = sem.getSecureElement(SecureElement.SIM); + } else { + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " Obtaining embedded SecureElement"); + se = sem.getSecureElement(SecureElement.EMBEDDED); + } + } catch(NFCException e1) { + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " exception when getting SE: " + e1.getClass().getName() + ":" + e1.getMessage()); + } + + if(se == null) { + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " SecureElement is null - exiting"); + System.exit(0); + } + + // register our app as a transaction listener + try { + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " adding transaction listener for AID:"+settings.getRegisteredAIDAsString()); + se.addTransactionListener(tl, new byte[][] { settings.getRegisteredAID() }); + _tl = tl; + } catch(NFCException e) { + if(!e.getMessage().startsWith("TransactionListener has already been added")) { + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " exception when adding transaction listener: " + e.getClass().getName() + ":" + e.getMessage()); + System.exit(0); + } + } + } + + public void removeTransactionListener() { + if (se != null && _tl != null) { + try { + int pid = ApplicationManager.getApplicationManager().getProcessId(ApplicationDescriptor.currentApplicationDescriptor()); + Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " removing transaction listener"); + se.removeTransactionListener(_tl); + } catch(NFCException e) { + Utilities.log("XXXX " + ":" + Thread.currentThread().getName() + " exception when removing transaction listener: " + e.getClass().getName() + ":" + e.getMessage()); + } + } + } + + public boolean isCeEnabled(int battery_mode) throws NFCException { + int types = getTechnologyTypes(battery_mode); + Utilities.log("XXXX " + Thread.currentThread().getName() + " " + Utilities.getTechnologyTypesNames(types)); + boolean ce_enabled = (types & TechnologyType.ISO14443B) == TechnologyType.ISO14443B; + Utilities.log("XXXX " + Thread.currentThread().getName() + " ce_enabled=" + ce_enabled); + return ce_enabled; + } + + public int getTechnologyTypes(int battery_mode) throws NFCException { + if (!se_obtained) { + return TechnologyType.NONE; + } + return se.getTechnologyTypes(battery_mode); + } + + public int getTechnologyTypes() throws NFCException { + return getTechnologyTypes(SecureElement.BATTERY_ON_MODE); + } + + public String getTextDetails() { + return Utilities.getCeStatusSummary(); + } + + public boolean isSe_obtained() { + return se_obtained; + } + + public void setSe_obtained(boolean se_obtained) { + this.se_obtained = se_obtained; + } + + public boolean setRoutingOn(int technology_types) throws NFCException { + if (se_obtained) { + se.setTechnologyTypes(SecureElement.BATTERY_ON_MODE, technology_types); + Utilities.log("XXXX " + Thread.currentThread().getName() + " NFC routing established OK"); + int types = se.getTechnologyTypes(SecureElement.BATTERY_ON_MODE); + Utilities.log("XXXX " + Thread.currentThread().getName() + " " + Utilities.getTechnologyTypesNames(types)); + current_tt = technology_types; + return true; + } else { + Utilities.log("XXXX " + Thread.currentThread().getName() + " No SE selected"); + return false; + } + } + + public boolean setRoutingOff() throws NFCException { + if (se_obtained) { + se.setTechnologyTypes(SecureElement.BATTERY_ON_MODE, TechnologyType.NONE); + return false; + } else { + Utilities.log("XXXX " + Thread.currentThread().getName() + " No SE selected"); + return true; + } + } + + public int getCurrentSecureElement() { + if (current_se != -1) { + return current_se; + } else { + // default is to use the SIM SE + return SecureElement.SIM; + } + } + + public int getCurrentTechnologyTypes() { + if (current_tt != -1) { + return current_tt; + } else { + // default is to use the ISO14443B + return TechnologyType.ISO14443B; + } + } + +} diff --git a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/ui/NfcSettingsScreen.java b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/ui/NfcSettingsScreen.java index e5da42a..30234f2 100644 --- a/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/ui/NfcSettingsScreen.java +++ b/NFC/NfcTransactionHandler/src/nfc/sample/nfctransaction/ui/NfcSettingsScreen.java @@ -1,205 +1,213 @@ -package nfc.sample.nfctransaction.ui; - -/* - * Copyright (c) 2012 Research In Motion Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import java.io.IOException; - -import net.rim.device.api.io.nfc.NFCException; -import net.rim.device.api.io.nfc.NFCManager; -import net.rim.device.api.io.nfc.emulation.TechnologyType; -import net.rim.device.api.io.nfc.se.SecureElement; -import net.rim.device.api.ui.Color; -import net.rim.device.api.ui.Field; -import net.rim.device.api.ui.FieldChangeListener; -import net.rim.device.api.ui.component.ButtonField; -import net.rim.device.api.ui.component.CheckboxField; -import net.rim.device.api.ui.component.EditField; -import net.rim.device.api.ui.component.RadioButtonField; -import net.rim.device.api.ui.component.RadioButtonGroup; -import net.rim.device.api.ui.component.RichTextField; -import net.rim.device.api.ui.component.SeparatorField; -import net.rim.device.api.ui.container.MainScreen; -import net.rim.device.api.util.ByteArrayUtilities; -import nfc.sample.nfctransaction.Constants; -import nfc.sample.nfctransaction.NfcTransHandlerApp; -import nfc.sample.nfctransaction.Settings; -import nfc.sample.nfctransaction.Utilities; -import nfc.sample.nfctransaction.nfc.CardEmulation; -import nfc.sample.nfctransaction.nfc.NfcService; - -public class NfcSettingsScreen extends MainScreen { - - private Settings settings = Settings.getInstance(); - - private CardEmulation ce = CardEmulation.getInstance(); - private NfcService nfc = NfcService.getInstance(); - - private LabelFieldColoured lbl_se_choices = new LabelFieldColoured("Secure Element", Color.GREEN, Field.FIELD_LEFT); - private RadioButtonGroup se_choices = new RadioButtonGroup(); - private RadioButtonField se_sim = new RadioButtonField("SIM", se_choices, true); - private RadioButtonField se_embedded = new RadioButtonField("EMBEDDED", se_choices, false); - - private LabelFieldColoured lbl_pr_choices = new LabelFieldColoured("Protocols", Color.GREEN, Field.FIELD_LEFT); - private CheckboxField cbx_iso1443a = new CheckboxField("ISO14443A", false); - private CheckboxField cbx_iso1443b = new CheckboxField("ISO14443B", true); - private CheckboxField cbx_iso1443b_prime = new CheckboxField("ISO14443B PRIME", false); - - private LabelFieldColoured lbl_aid = new LabelFieldColoured("AID", Color.GREEN, Field.FIELD_LEFT); - private EditField edt_aid = new EditField("",""); - - private ButtonField btn_save_settings = new ButtonField("Apply", ButtonField.CONSUME_CLICK); - private SeparatorField separator = new SeparatorField(); - private LabelFieldColoured lbl_nfc_service_details = new LabelFieldColoured("NFC Service Details", Color.GREEN, - Field.FIELD_LEFT); - private RichTextField rtf_nfc_service_details = new RichTextField(); - - private FieldChangeListener listener = new FieldChangeListener() { - - public void fieldChanged(Field field, int context) { - if(field == btn_save_settings) { - save(); - } - } - }; - - private int current_se; - private int current_tt; - private boolean aid_changed=false; - - public NfcSettingsScreen() { - setTitle("NFCTransactionHandler V" + Constants.VERSION + "-Settings"); - add(lbl_se_choices); - add(se_sim); - add(se_embedded); - add(lbl_pr_choices); - add(cbx_iso1443a); - add(cbx_iso1443b); - add(cbx_iso1443b_prime); - add(lbl_aid); - edt_aid.setText(settings.getRegistered_aid()); - add(edt_aid); - add(btn_save_settings); - btn_save_settings.setChangeListener(listener); - add(separator); - add(lbl_nfc_service_details); - String nfc_details = ""; - try { - nfc_details = Utilities.getNfcStatusDescription(NFCManager.getInstance().getEnabledNFCServices()); - } catch(NFCException e) { - nfc_details = e.getClass().getName() + ":" + e.getMessage(); - } - rtf_nfc_service_details.setText(nfc_details); - add(rtf_nfc_service_details); - syncUiWithNfcSettings(); - } - - private void syncUiWithNfcSettings() { - current_se = ce.getCurrentSecureElement(); - current_tt = ce.getCurrentTechnologyTypes(); - if(current_se == SecureElement.SIM) { - se_sim.setSelected(true); - se_embedded.setSelected(false); - } else { - se_sim.setSelected(false); - se_embedded.setSelected(true); - } - try { - int tech_types = ce.getTechnologyTypes(SecureElement.BATTERY_ON_MODE); - if((tech_types & TechnologyType.ISO14443A) == TechnologyType.ISO14443A) { - cbx_iso1443a.setChecked(true); - } else { - cbx_iso1443a.setChecked(false); - } - if((tech_types & TechnologyType.ISO14443B) == TechnologyType.ISO14443B) { - cbx_iso1443b.setChecked(true); - } else { - cbx_iso1443b.setChecked(false); - } - if((tech_types & TechnologyType.ISO14443B_PRIME) == TechnologyType.ISO14443B_PRIME) { - cbx_iso1443b_prime.setChecked(true); - } else { - cbx_iso1443b_prime.setChecked(false); - } - } catch(NFCException e) { - } - } - - public void save() { - applySettings(); - settings.saveSettings(); - try { - super.save(); - } catch(IOException e) { - } - } - - private void applySettings() { - try { - if((current_se == SecureElement.SIM) && (se_choices.getSelectedIndex() == 1)) { - ce.initCe(SecureElement.EMBEDDED); - settings.setSeEmbedded(); - } else { - if((current_se == SecureElement.EMBEDDED) && (se_choices.getSelectedIndex() == 0)) { - ce.initCe(SecureElement.SIM); - settings.setSeSIM(); - } - } - } catch(NFCException e) { - Utilities.popupAlert("Error: could not change SE selection"); - return; - } - int tech_types = TechnologyType.NONE; - if(cbx_iso1443a.getChecked() == true) { - tech_types = tech_types | TechnologyType.ISO14443A; - } - if(cbx_iso1443b.getChecked() == true) { - tech_types = tech_types | TechnologyType.ISO14443B; - } - if(cbx_iso1443b_prime.getChecked() == true) { - tech_types = tech_types | TechnologyType.ISO14443B_PRIME; - } - settings.setISO14443A(cbx_iso1443a.getChecked()); - settings.setISO14443B(cbx_iso1443b.getChecked()); - settings.setISO14443B_PRIME(cbx_iso1443b_prime.getChecked()); - if (!settings.getRegistered_aid().equals(edt_aid.getText())) { - settings.setRegistered_aid(edt_aid.getText()); - CardEmulation ce = CardEmulation.getInstance(); - ce.removeTransactionListener(); - CardEmulation.registerTransactionListener(NfcTransHandlerApp.getTransactionListener()); - } - - Utilities.log("XXXX " + Thread.currentThread().getName() + " Selected tech types=" - + Utilities.getTechnologyTypesNames(tech_types)); - - if(current_tt != tech_types) { - try { - ce.setRoutingOn(tech_types); - } catch(NFCException e) { - Utilities.popupAlert("Error: could not change CE technology types"); - return; - } catch(Exception e) { - Utilities.log("XXXX " + Thread.currentThread().getName() + " " + e.getClass().getName() + ":" + e.getMessage()); - Utilities.popupAlert(e.getClass().getName() + ": could not change CE technology types"); - return; - } - } - Utilities.log("XXXX " + Thread.currentThread().getName() + " applySettings 11"); - setDirty(false); - Utilities.log("XXXX " + Thread.currentThread().getName() + " applySettings 12"); - Utilities.popupMessage("New settings applied"); - - } -} +package nfc.sample.nfctransaction.ui; + +/* + * Copyright (c) 2012 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import java.io.IOException; + +import net.rim.device.api.io.nfc.NFCException; +import net.rim.device.api.io.nfc.NFCManager; +import net.rim.device.api.io.nfc.emulation.TechnologyType; +import net.rim.device.api.io.nfc.se.SecureElement; +import net.rim.device.api.ui.Color; +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.FieldChangeListener; +import net.rim.device.api.ui.component.ButtonField; +import net.rim.device.api.ui.component.CheckboxField; +import net.rim.device.api.ui.component.EditField; +import net.rim.device.api.ui.component.RadioButtonField; +import net.rim.device.api.ui.component.RadioButtonGroup; +import net.rim.device.api.ui.component.RichTextField; +import net.rim.device.api.ui.component.SeparatorField; +import net.rim.device.api.ui.container.MainScreen; +import net.rim.device.api.util.ByteArrayUtilities; +import nfc.sample.nfctransaction.Constants; +import nfc.sample.nfctransaction.NfcTransHandlerApp; +import nfc.sample.nfctransaction.Settings; +import nfc.sample.nfctransaction.Utilities; +import nfc.sample.nfctransaction.nfc.CardEmulation; +import nfc.sample.nfctransaction.nfc.NfcService; + +public class NfcSettingsScreen extends MainScreen { + + private Settings settings = Settings.getInstance(); + + private CardEmulation ce = CardEmulation.getInstance(); + private NfcService nfc = NfcService.getInstance(); + + private LabelFieldColoured lbl_se_choices = new LabelFieldColoured("Secure Element", Color.GREEN, Field.FIELD_LEFT); + private RadioButtonGroup se_choices = new RadioButtonGroup(); + private RadioButtonField se_sim = new RadioButtonField("SIM", se_choices, true); + private RadioButtonField se_embedded = new RadioButtonField("EMBEDDED", se_choices, false); + + private LabelFieldColoured lbl_pr_choices = new LabelFieldColoured("Protocols", Color.GREEN, Field.FIELD_LEFT); + private CheckboxField cbx_iso1443a = new CheckboxField("ISO14443A", false); + private CheckboxField cbx_iso1443b = new CheckboxField("ISO14443B", true); + private CheckboxField cbx_iso1443b_prime = new CheckboxField("ISO14443B PRIME", false); + + private LabelFieldColoured lbl_aid = new LabelFieldColoured("AID", Color.GREEN, Field.FIELD_LEFT); + private EditField edt_aid = new EditField("",""); + + private LabelFieldColoured lbl_apdu = new LabelFieldColoured("APDU", Color.GREEN, Field.FIELD_LEFT); + private EditField edt_apdu = new EditField("",""); + + private ButtonField btn_save_settings = new ButtonField("Apply", ButtonField.CONSUME_CLICK); + private SeparatorField separator = new SeparatorField(); + private LabelFieldColoured lbl_nfc_service_details = new LabelFieldColoured("NFC Service Details", Color.GREEN, + Field.FIELD_LEFT); + private RichTextField rtf_nfc_service_details = new RichTextField(); + + private FieldChangeListener listener = new FieldChangeListener() { + + public void fieldChanged(Field field, int context) { + if(field == btn_save_settings) { + save(); + } + } + }; + + private int current_se; + private int current_tt; + private boolean aid_changed=false; + + public NfcSettingsScreen() { + setTitle("NFCTransactionHandler V" + Constants.VERSION + "-Settings"); + add(lbl_se_choices); + add(se_sim); + add(se_embedded); + add(lbl_pr_choices); + add(cbx_iso1443a); + add(cbx_iso1443b); + add(cbx_iso1443b_prime); + add(lbl_aid); + edt_aid.setText(settings.getRegisteredAIDAsString()); + add(edt_aid); + add(lbl_apdu); + edt_apdu.setText(settings.getAPDUAsString()); + add(edt_apdu); + add(btn_save_settings); + btn_save_settings.setChangeListener(listener); + add(separator); + add(lbl_nfc_service_details); + String nfc_details = ""; + try { + nfc_details = Utilities.getNfcStatusDescription(NFCManager.getInstance().getEnabledNFCServices()); + } catch(NFCException e) { + nfc_details = e.getClass().getName() + ":" + e.getMessage(); + } + rtf_nfc_service_details.setText(nfc_details); + add(rtf_nfc_service_details); + syncUiWithNfcSettings(); + } + + private void syncUiWithNfcSettings() { + current_se = ce.getCurrentSecureElement(); + current_tt = ce.getCurrentTechnologyTypes(); + if(current_se == SecureElement.SIM) { + se_sim.setSelected(true); + se_embedded.setSelected(false); + } else { + se_sim.setSelected(false); + se_embedded.setSelected(true); + } + try { + int tech_types = ce.getTechnologyTypes(SecureElement.BATTERY_ON_MODE); + if((tech_types & TechnologyType.ISO14443A) == TechnologyType.ISO14443A) { + cbx_iso1443a.setChecked(true); + } else { + cbx_iso1443a.setChecked(false); + } + if((tech_types & TechnologyType.ISO14443B) == TechnologyType.ISO14443B) { + cbx_iso1443b.setChecked(true); + } else { + cbx_iso1443b.setChecked(false); + } + if((tech_types & TechnologyType.ISO14443B_PRIME) == TechnologyType.ISO14443B_PRIME) { + cbx_iso1443b_prime.setChecked(true); + } else { + cbx_iso1443b_prime.setChecked(false); + } + } catch(NFCException e) { + } + } + + public void save() { + applySettings(); + settings.saveSettings(); + try { + super.save(); + } catch(IOException e) { + } + } + + private void applySettings() { + try { + if((current_se == SecureElement.SIM) && (se_choices.getSelectedIndex() == 1)) { + ce.initCe(SecureElement.EMBEDDED); + settings.setSeEmbedded(); + } else { + if((current_se == SecureElement.EMBEDDED) && (se_choices.getSelectedIndex() == 0)) { + ce.initCe(SecureElement.SIM); + settings.setSeSIM(); + } + } + } catch(NFCException e) { + Utilities.popupAlert("Error: could not change SE selection"); + return; + } + int tech_types = TechnologyType.NONE; + if(cbx_iso1443a.getChecked() == true) { + tech_types = tech_types | TechnologyType.ISO14443A; + } + if(cbx_iso1443b.getChecked() == true) { + tech_types = tech_types | TechnologyType.ISO14443B; + } + if(cbx_iso1443b_prime.getChecked() == true) { + tech_types = tech_types | TechnologyType.ISO14443B_PRIME; + } + settings.setISO14443A(cbx_iso1443a.getChecked()); + settings.setISO14443B(cbx_iso1443b.getChecked()); + settings.setISO14443B_PRIME(cbx_iso1443b_prime.getChecked()); + if (!settings.getRegisteredAIDAsString().equals(edt_aid.getText())) { + settings.setRegisteredAID(edt_aid.getText()); + CardEmulation ce = CardEmulation.getInstance(); + ce.removeTransactionListener(); + CardEmulation.registerTransactionListener(NfcTransHandlerApp.getTransactionListener()); + } + + settings.setAPDU(edt_apdu.getText()); + + Utilities.log("XXXX " + Thread.currentThread().getName() + " Selected tech types=" + + Utilities.getTechnologyTypesNames(tech_types)); + + if(current_tt != tech_types) { + try { + ce.setRoutingOn(tech_types); + } catch(NFCException e) { + Utilities.popupAlert("Error: could not change CE technology types"); + return; + } catch(Exception e) { + Utilities.log("XXXX " + Thread.currentThread().getName() + " " + e.getClass().getName() + ":" + e.getMessage()); + Utilities.popupAlert(e.getClass().getName() + ": could not change CE technology types"); + return; + } + } + Utilities.log("XXXX " + Thread.currentThread().getName() + " applySettings 11"); + setDirty(false); + Utilities.log("XXXX " + Thread.currentThread().getName() + " applySettings 12"); + Utilities.popupMessage("New settings applied"); + + } +}