From fb13c3016deee2dfeb011988835ba8797daa90e9 Mon Sep 17 00:00:00 2001 From: Lungu Cristian Date: Tue, 9 Jan 2024 10:25:40 +0200 Subject: [PATCH] Biometrics in new settings (#18258) * feat: added biometrics setting to new-settings * fix: fix renaming issues from status-im2 * ref: addressed @cammellos' review comments * fix: open password settings in a modal * ref: addressed review comments * fix: disabling biometric clears auth-method from keychain * chore: quo/overlay seqs the childrend so need to add keys * fix: don't pass the password unmasked between events to avoid leaks --- resources/images/icons2/20x20/touch-id@2x.png | Bin 0 -> 1041 bytes resources/images/icons2/20x20/touch-id@3x.png | Bin 0 -> 1681 bytes src/status_im/common/biometric/events.cljs | 31 ++++++- src/status_im/common/keychain/events.cljs | 6 ++ .../standard_authentication/events.cljs | 5 + .../standard_auth/authorize.cljs | 27 +++--- .../standard_auth/slide_button/view.cljs | 3 +- .../contexts/profile/settings/list_items.cljs | 2 +- .../settings/screens/password/style.cljs | 10 ++ .../settings/screens/password/view.cljs | 86 ++++++++++++++++++ src/status_im/contexts/syncing/events.cljs | 4 +- .../contexts/wallet/create_account/view.cljs | 4 +- src/status_im/navigation/screens.cljs | 9 +- translations/en.json | 2 +- 14 files changed, 168 insertions(+), 21 deletions(-) create mode 100644 resources/images/icons2/20x20/touch-id@2x.png create mode 100644 resources/images/icons2/20x20/touch-id@3x.png create mode 100644 src/status_im/contexts/profile/settings/screens/password/style.cljs create mode 100644 src/status_im/contexts/profile/settings/screens/password/view.cljs diff --git a/resources/images/icons2/20x20/touch-id@2x.png b/resources/images/icons2/20x20/touch-id@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..1202fd4ab4ac6c21a67f0978b6dd4c5ef5114e7c GIT binary patch literal 1041 zcmV+s1n&EZP))5q))=AbWwgtp9_?yw#x}Ux8cK6#Az>LF!jNshnSJ1Wd02MWs15bF67Yqt* zAshi2Fcm?@OH~W3EdcK&ny?}D0NM5+*9MSHSDdwALQF)^CkA`?w+d6iawJ&$uK3m* zd&fA77`JT;dPfFgZ9J4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!0wEa;@8*JCW-=EMGJ%Q_S*x$*Kl4 zt0@^g1DY2=Yoo#HXZ#yfesm5`xH83gp3A-h~wU>kBknJ~Gh=*pUq!70XL%kmnU4hdy){}76H^pMyHE3)MbC{!t@ zBqqR2jCfu_|t*#TLa~0Sw`eOs1A%Wp|bA7vcp( z{RkA0$EDYki-0S$E>D)SFvi$gRwAKysFkT2xZK!H-nHX;%k@*c@gyh{4#jwM`93H! zg?MVAN(1FJf-OEq_4Y3q{G5ejuE_yKH>oh|1`q?|W=jd{)AP0-pbv&)sF2aCNP64tc#fcT=mr+=y&yY#4I9K*e0P~v3RBB!Uo?-h^XPHXJa!^9|Q@-fC3 bjs {:senderConfig {:keyUID key-uid :keystorePath "" - :password sha3-pwd + :password (security/safe-unmask-data + sha3-pwd) :deviceType platform/os} :serverConfig {:timeout 0}}))] (native-module/get-connection-string-for-bootstrapping-another-device diff --git a/src/status_im/contexts/wallet/create_account/view.cljs b/src/status_im/contexts/wallet/create_account/view.cljs index 783b7deed0..67f0016468 100644 --- a/src/status_im/contexts/wallet/create_account/view.cljs +++ b/src/status_im/contexts/wallet/create_account/view.cljs @@ -15,6 +15,7 @@ [utils.i18n :as i18n] [utils.re-frame :as rf] [utils.responsiveness :refer [iphone-11-Pro-20-pixel-from-width]] + [utils.security.core :as security] [utils.string])) (defn keypair-string @@ -119,9 +120,8 @@ :track-text (i18n/label :t/slide-to-create-account) :customization-color @account-color :on-auth-success (fn [entered-password] - (prn entered-password) (rf/dispatch [:wallet/derive-address-and-add-account - {:sha3-pwd entered-password + {:sha3-pwd (security/safe-unmask-data entered-password) :emoji @emoji :color @account-color :path @derivation-path diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index 8ef658d759..0f4d12e0fd 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -37,6 +37,7 @@ [status-im.contexts.profile.edit.name.view :as edit-name] [status-im.contexts.profile.edit.view :as edit-profile] [status-im.contexts.profile.profiles.view :as profiles] + [status-im.contexts.profile.settings.screens.password.view :as settings-password] [status-im.contexts.profile.settings.view :as settings] [status-im.contexts.shell.activity-center.view :as activity-center] [status-im.contexts.shell.jump-to.view :as shell] @@ -367,7 +368,13 @@ :options (merge options/dark-screen {:modalPresentationStyle :overCurrentContext}) - :component scan-profile-qr-page/view}] + :component scan-profile-qr-page/view} + + ;; Settings + + {:name :settings-password + :options options/transparent-screen-options + :component settings-password/view}] (when js/goog.DEBUG [{:name :dev-component-preview diff --git a/translations/en.json b/translations/en.json index c86c84a434..2743018a7f 100644 --- a/translations/en.json +++ b/translations/en.json @@ -139,7 +139,7 @@ "change-log-level": "Confirm and restart the app to change log level to {{log-level}}", "change-logging-enabled": "Are you sure you want to {{enable}} logging?", "change-passcode": "Change Passcode", - "change-password": "Change Password", + "change-password": "Change password", "change-pin": "Change 6-digit passcode", "change-puk": "Change 12-digit PUK", "change-pairing": "Change pairing code",