From 151b6a3cbf044bb30dc0a8df567692f3293161ef Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Fri, 3 Apr 2020 11:41:40 +0300 Subject: [PATCH] Disable keycard on ios --- src/status_im/hardwallet/card.cljs | 6 ++++- src/status_im/hardwallet/ios_keycard.cljs | 31 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/status_im/hardwallet/ios_keycard.cljs diff --git a/src/status_im/hardwallet/card.cljs b/src/status_im/hardwallet/card.cljs index e561efc879..8da7570370 100644 --- a/src/status_im/hardwallet/card.cljs +++ b/src/status_im/hardwallet/card.cljs @@ -3,13 +3,17 @@ [status-im.hardwallet.keycard :as keycard] [status-im.hardwallet.real-keycard :as real-keycard] [status-im.hardwallet.simulated-keycard :as simulated-keycard] + [status-im.hardwallet.ios-keycard :as ios-keycard] + [status-im.utils.platform :as platform] [taoensso.timbre :as log] [re-frame.core :as re-frame] [status-im.utils.config :as config])) (defonce card (if config/keycard-test-menu-enabled? (simulated-keycard/SimulatedKeycard.) - (real-keycard/RealKeycard.))) + (if platform/android? + (real-keycard/RealKeycard.) + (ios-keycard/IOSKeycard.)))) (defn check-nfc-support [] (log/info "[keycard] check-nfc-support") diff --git a/src/status_im/hardwallet/ios_keycard.cljs b/src/status_im/hardwallet/ios_keycard.cljs new file mode 100644 index 0000000000..3c3846ada3 --- /dev/null +++ b/src/status_im/hardwallet/ios_keycard.cljs @@ -0,0 +1,31 @@ +(ns status-im.hardwallet.ios-keycard + (:require [status-im.hardwallet.keycard :as keycard])) + +(defrecord IOSKeycard [] + keycard/Keycard + (check-nfc-support [this args]) + (check-nfc-enabled [this args]) + (open-nfc-settings [this]) + (register-card-events [this args]) + (on-card-disconnected [this callback]) + (on-card-connected [this callback]) + (remove-event-listener [this event]) + (remove-event-listeners [this]) + (get-application-info [this args]) + (install-applet [this args]) + (init-card [this args]) + (install-applet-and-init-card [this args]) + (pair [this args]) + (generate-mnemonic [this args]) + (generate-and-load-key [this args]) + (unblock-pin [this args]) + (verify-pin [this args]) + (change-pin [this args]) + (unpair [this args]) + (delete [this args]) + (remove-key [this args]) + (remove-key-with-unpair [this args]) + (export-key [this args]) + (unpair-and-delete [this args]) + (get-keys [this args]) + (sign [this args]))