From 68bb940a398dbd99f95db468c222f519c493c044 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Date: Sat, 5 Oct 2019 18:36:16 -0400 Subject: [PATCH] FIX: Changes --- UnlockWith.js | 5 ++--- class/biometrics.js | 6 ++++-- package-lock.json | 38 +++++++++++++-------------------- package.json | 8 +++---- screen/wallets/walletMigrate.js | 1 - 5 files changed, 25 insertions(+), 33 deletions(-) diff --git a/UnlockWith.js b/UnlockWith.js index 34e36c31f..640c972c0 100644 --- a/UnlockWith.js +++ b/UnlockWith.js @@ -3,7 +3,6 @@ import { View, Image, TouchableOpacity } from 'react-native'; import { Icon } from 'react-native-elements'; import Biometric from './class/biometrics'; import PropTypes from 'prop-types'; -import Biometrics from 'react-native-biometrics'; import { SafeAreaView } from 'react-navigation'; /** @type {AppStorage} */ @@ -52,14 +51,14 @@ export default class UnlockWith extends Component { - {this.state.biometricType === Biometrics.TouchID && ( + {this.state.biometricType === Biometric.TouchID && ( <> )} - {this.state.biometricType === Biometrics.FaceID && ( + {this.state.biometricType === Biometric.FaceID && ( <> diff --git a/class/biometrics.js b/class/biometrics.js index 46da15c4a..70b6e52ce 100644 --- a/class/biometrics.js +++ b/class/biometrics.js @@ -3,6 +3,8 @@ const BlueApp = require('../BlueApp'); export default class Biometric { static STORAGEKEY = 'Biometrics'; + static FaceID = Biometrics.FaceID; + static TouchID = Biometrics.TouchID; static async isDeviceBiometricCapable() { const isDeviceBiometricCapable = await Biometric.biometricType(); @@ -23,14 +25,14 @@ export default class Biometric { return !!enabledBiometrics; } catch (_e) { await BlueApp.setItem(Biometric.STORAGEKEY, ''); - return !!''; + return false; } } static async isBiometricUseCapableAndEnabled() { const isBiometricUseEnabled = await Biometric.isBiometricUseEnabled(); const isDeviceBiometricCapable = await Biometric.isDeviceBiometricCapable(); - return !!isBiometricUseEnabled && isDeviceBiometricCapable; + return isBiometricUseEnabled && isDeviceBiometricCapable; } static async setBiometricUseEnabled(value) { diff --git a/package-lock.json b/package-lock.json index f0b56bd93..748eef0be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4599,9 +4599,9 @@ } }, "eslint-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.0.tgz", - "integrity": "sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz", + "integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==", "dev": true, "requires": { "eslint-visitor-keys": "^1.0.0" @@ -5851,9 +5851,9 @@ "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=" }, "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.2.tgz", + "integrity": "sha512-cIv17+GhL8pHHnRJzGu2wwcthL5sb8uDKBHvZ2Dtu5s1YNt0ljbzKbamnc+gr69y7bzwQiBdr5+hOpRd5pnOdg==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -5863,9 +5863,9 @@ }, "dependencies": { "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.1.tgz", + "integrity": "sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg==", "dev": true, "optional": true }, @@ -10687,9 +10687,8 @@ } }, "react-native-biometrics": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/react-native-biometrics/-/react-native-biometrics-1.6.1.tgz", - "integrity": "sha512-WYdZ6k3Miyl/+lEdhq6y4B6wz16d+PomO/xjR1hScYKeQWj1jaugPy0Ep+EjoWpJkPYLvnxasmIYR9v8OvWNHg==" + "version": "git+https://github.com/BlueWallet/react-native-biometrics.git#fed8efc3adbb1c7c028c15223605f87eb1944b64", + "from": "git+https://github.com/BlueWallet/react-native-biometrics.git" }, "react-native-camera": { "version": "3.4.0", @@ -11118,20 +11117,13 @@ "integrity": "sha1-kIe0CzaLEkZ0x7/Pn91q2YORSpc=" }, "react-test-render": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/react-test-render/-/react-test-render-1.1.1.tgz", - "integrity": "sha1-NZRrs4P4uCVkdo/Z2OrxIMMDKpo=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/react-test-render/-/react-test-render-1.1.2.tgz", + "integrity": "sha512-XurcR3Eh0TwFopBShDNgPny29Z8wczAFnKsxUqSSgNN6FrpsNg39Q3/13bK5oBFWOLod3enZG698HZNlJ3oRsw==", "requires": { "immutable": "3.7.x", - "lodash": "3.10.x", + "lodash": "^4.17.15", "react-shallow-testutils": "2.0.x" - }, - "dependencies": { - "lodash": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" - } } }, "react-test-renderer": { diff --git a/package.json b/package.json index 4c1ac7b84..d9a50838d 100644 --- a/package.json +++ b/package.json @@ -58,13 +58,13 @@ "bip21": "2.0.2", "bip32": "2.0.3", "bip39": "2.5.0", - "bitcoinjs-lib": "^5.1.6", + "bitcoinjs-lib": "5.1.6", "buffer": "5.2.1", "buffer-reverse": "1.0.1", "coinselect": "3.1.11", "crypto-js": "3.1.9-1", "dayjs": "1.8.14", - "ecurve": "^1.0.6", + "ecurve": "1.0.6", "electrum-client": "git+https://github.com/BlueWallet/rn-electrum-client.git", "eslint-config-prettier": "6.0.0", "eslint-config-standard": "12.0.0", @@ -84,7 +84,7 @@ "react": "16.8.6", "react-localization": "1.0.13", "react-native": "0.60.5", - "react-native-biometrics": "^1.6.1", + "react-native-biometrics": "git+https://github.com/BlueWallet/react-native-biometrics.git", "react-native-camera": "3.4.0", "react-native-device-info": "2.2.2", "react-native-elements": "0.19.0", @@ -117,7 +117,7 @@ "react-native-watch-connectivity": "0.2.1", "react-native-webview": "6.9.0", "react-navigation": "3.11.0", - "react-test-render": "1.1.1", + "react-test-render": "1.1.2", "readable-stream": "3.4.0", "secure-random": "1.1.2", "stream-browserify": "2.0.2", diff --git a/screen/wallets/walletMigrate.js b/screen/wallets/walletMigrate.js index 825d4ff62..30d710fd3 100644 --- a/screen/wallets/walletMigrate.js +++ b/screen/wallets/walletMigrate.js @@ -85,7 +85,6 @@ export default class WalletMigrate { const data = await AsyncStorage.getItem('data'); if (data) { const isEncrypted = (await AsyncStorage.getItem('data_encrypted')) || ''; - await RNSecureKeyStore.set('Biometrics', '', { accessible: ACCESSIBLE.WHEN_UNLOCKED }); await RNSecureKeyStore.set('data', data, { accessible: ACCESSIBLE.WHEN_UNLOCKED }); await RNSecureKeyStore.set('data_encrypted', isEncrypted, { accessible: ACCESSIBLE.WHEN_UNLOCKED,