-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bio auth on mac + package updates for 3.19.3/5 (#1398)
* bio auth mac fix * remove comment and change duration from 2 to 0 * cherry pick previous changes * workaround for secure storage bug on mac * bump version to 3.19.5 (because breez will need this version anyways) * some code cleanup * some changess didn't get saved * just documenting the issue [skip ci] * undo accidental removal + minor code cleanup * merge conflicts * Minor UI change [skip ci] --------- Co-authored-by: Omar Hatem <[email protected]>
- Loading branch information
1 parent
3f3cd10
commit e5be737
Showing
32 changed files
with
655 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,29 @@ | ||
import 'package:local_auth/local_auth.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:cake_wallet/generated/i18n.dart'; | ||
import 'package:flutter_local_authentication/flutter_local_authentication.dart'; | ||
|
||
class BiometricAuth { | ||
final _localAuth = LocalAuthentication(); | ||
final _flutterLocalAuthenticationPlugin = FlutterLocalAuthentication(); | ||
|
||
Future<bool> isAuthenticated() async { | ||
try { | ||
return await _localAuth.authenticate( | ||
localizedReason: S.current.biometric_auth_reason, | ||
options: AuthenticationOptions( | ||
biometricOnly: true, | ||
useErrorDialogs: true, | ||
stickyAuth: false)); | ||
} on PlatformException catch (e) { | ||
final authenticated = await _flutterLocalAuthenticationPlugin.authenticate(); | ||
return authenticated; | ||
} catch (e) { | ||
print(e); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
Future<bool> canCheckBiometrics() async { | ||
bool canAuthenticate; | ||
try { | ||
return await _localAuth.canCheckBiometrics; | ||
} on PlatformException catch (e) { | ||
print(e); | ||
canAuthenticate = await _flutterLocalAuthenticationPlugin.canAuthenticate(); | ||
await _flutterLocalAuthenticationPlugin.setTouchIDAuthenticationAllowableReuseDuration(0); | ||
} catch (error) { | ||
print("Exception checking support. $error"); | ||
canAuthenticate = false; | ||
} | ||
|
||
return false; | ||
return canAuthenticate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.