From 70990e3b86c95921ad7153f5fa6f134a3218ee3a Mon Sep 17 00:00:00 2001 From: noumantahir Date: Tue, 26 Jul 2022 22:06:30 +0500 Subject: [PATCH] updated fingerprint package and added release routine --- package.json | 2 +- src/screens/pinCode/container/pinCodeContainer.js | 6 ++++++ yarn.lock | 5 ++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 85b8b58a7..6696d682e 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "react-native-dynamic": "^1.0.0", "react-native-extended-stylesheet": "^0.10.0", "react-native-fast-image": "^8.3.2", - "react-native-fingerprint-scanner": "^6.0.0", + "react-native-fingerprint-scanner": "hieuvp/react-native-fingerprint-scanner", "react-native-gesture-handler": "^1.9.0", "react-native-highlight-words": "^1.0.1", "react-native-iap": "^7.5.6", diff --git a/src/screens/pinCode/container/pinCodeContainer.js b/src/screens/pinCode/container/pinCodeContainer.js index 5a93caf94..7726d8042 100644 --- a/src/screens/pinCode/container/pinCodeContainer.js +++ b/src/screens/pinCode/container/pinCodeContainer.js @@ -128,11 +128,14 @@ class PinCodeContainer extends Component { } catch (err) { console.warn('Failed to process biometric', err); } + + FingerprintScanner.release(); }; //this function updates realm with appropriate master key required for encyrption //this function is important: must run while chaning pin //and even logging in with existing pin code + //TODO: make sure this routine is not called _updatePinCodeRealm = async (pinData) => { try { const { currentAccount, dispatch } = this.props; @@ -256,12 +259,14 @@ class PinCodeContainer extends Component { } = this.props; const { oldPinCode } = this.state; + //TOOD: make sure user is set with defualt pin here. const pinData = { pinCode: pin, password: currentAccount ? currentAccount.password : '', username: currentAccount ? currentAccount.name : '', accessToken, }; + setUserDataWithPinCode(pinData).then((response) => { getUser(currentAccount.name).then((user) => { const _currentAccount = user; @@ -390,6 +395,7 @@ class PinCodeContainer extends Component { }); }); + //TODO: make sure pinCode is rather saved as different redux state, encryptedUnlockPin _savePinCode = (pin) => { const { dispatch } = this.props; const encryptedPin = encryptKey(pin, Config.PIN_KEY); diff --git a/yarn.lock b/yarn.lock index 80633aee1..1b30c18a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8782,10 +8782,9 @@ react-native-fast-image@^8.3.2: resolved "https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-8.3.4.tgz#79edca177e30311b19d59ff335625bcbe22650d7" integrity sha512-LpzAdjUphihUpVEBn5fEv5AILe55rHav0YiZroPZ1rumKDhAl4u2cG01ku2Pb7l8sayjTsNu7FuURAlXUUDsow== -react-native-fingerprint-scanner@^6.0.0: +react-native-fingerprint-scanner@hieuvp/react-native-fingerprint-scanner: version "6.0.0" - resolved "https://registry.yarnpkg.com/react-native-fingerprint-scanner/-/react-native-fingerprint-scanner-6.0.0.tgz#ecb47ad0682d2a66a5e126d2b9e4d95e73c8dbf2" - integrity sha512-8VoKSA0Z0kWnIni96yABZfUUzfmWFXQEXcELwWr1CNLloPt3WoPptYb/6pGsBcH0YxSsW3X4+C8tl0clgyBsvA== + resolved "https://codeload.github.com/hieuvp/react-native-fingerprint-scanner/tar.gz/9cecc0db326471c571553ea85f7c016fee2f803d" react-native-flipper@^0.34.0: version "0.34.0"