From 66dafaef250167c7dc75026c1db58760e4735c40 Mon Sep 17 00:00:00 2001 From: tbenr Date: Sat, 8 Jun 2019 12:34:15 +0200 Subject: [PATCH] [fix #8375] unavailable for non bioauth devices Signed-off-by: Andrey Shovkoplyas --- src/status_im/biometric_auth/core.cljs | 4 ++-- src/status_im/utils/keychain/core.cljs | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/status_im/biometric_auth/core.cljs b/src/status_im/biometric_auth/core.cljs index bb5a4f6635..9d18bab959 100644 --- a/src/status_im/biometric_auth/core.cljs +++ b/src/status_im/biometric_auth/core.cljs @@ -71,9 +71,9 @@ (defn get-supported [callback] (cond platform/ios? (do-get-supported callback) platform/android? (if android-device-blacklisted? - (callback false) + (callback nil) (do-get-supported callback)) - :else (callback false))) + :else (callback nil))) (defn authenticate ([cb] diff --git a/src/status_im/utils/keychain/core.cljs b/src/status_im/utils/keychain/core.cljs index 3607f9c233..8dfd7bcbdf 100644 --- a/src/status_im/utils/keychain/core.cljs +++ b/src/status_im/utils/keychain/core.cljs @@ -4,7 +4,6 @@ [status-im.react-native.js-dependencies :as rn] [status-im.utils.platform :as platform] [status-im.utils.security :as security] - [status-im.biometric-auth.core :as biometric-auth] [status-im.native-module.core :as status])) (def key-bytes 64) @@ -85,10 +84,6 @@ (enum-val "ACCESS_CONTROL" "BIOMETRY_ANY_OR_DEVICE_PASSCODE")})) (.then callback))) -;; Android and iOS -(defn- biometric-auth-available? [callback] - (biometric-auth/get-supported #(callback (some? %)))) - ;; Stores the password for the address to the Keychain (defn save-user-password [address password callback] (-> (.setInternetCredentials (rn/keychain) address address password keychain-secure-hardware (clj->js keychain-restricted-availability)) @@ -118,13 +113,11 @@ (defn can-save-user-password? [callback] (cond platform/ios? (check-conditions callback - device-encrypted? - biometric-auth-available?) + device-encrypted?) platform/android? (check-conditions callback secure-hardware-available? - biometric-auth-available? device-not-rooted?) :else (callback false)))