Skip to content

Commit

Permalink
[fix #8375] unavailable for non bioauth devices
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
  • Loading branch information
tbenr authored and flexsurfer committed Jun 11, 2019
1 parent 49d5a30 commit 66dafae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/status_im/biometric_auth/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
9 changes: 1 addition & 8 deletions src/status_im/utils/keychain/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 66dafae

Please sign in to comment.