fix: lowercase for mnemonic words; set pin cache choice to false as default

This commit is contained in:
poka 2022-06-01 07:33:56 +02:00
parent 86931bab5b
commit 09116b956b
5 changed files with 6 additions and 7 deletions

View File

@ -73,12 +73,11 @@ Future<void> main() async {
g1WalletsBox = await Hive.openBox<G1WalletsList>("g1WalletsBox"); g1WalletsBox = await Hive.openBox<G1WalletsList>("g1WalletsBox");
await _homeProvider.getValidEndpoints(); await _homeProvider.getValidEndpoints();
// await configBox.delete('isCacheChecked');
// log.d(await configBox.get('endpoint')); // log.d(await configBox.get('endpoint'));
HttpOverrides.global = MyHttpOverrides(); HttpOverrides.global = MyHttpOverrides();
if (kReleaseMode && enableSentry) { if (kReleaseMode && enableSentry) {
// CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [ // CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
// SentryHandler(SentryClient(SentryOptions( // SentryHandler(SentryClient(SentryOptions(

View File

@ -283,7 +283,7 @@ class GenerateWalletsProvider with ChangeNotifier {
// Needed for bad encoding of UTF-8 // Needed for bad encoding of UTF-8
word = word.replaceAll('é', ''); word = word.replaceAll('é', '');
word = word.replaceAll('è', ''); word = word.replaceAll('è', '');
return bip39Words(appLang).contains(word); return bip39Words(appLang).contains(word.toLowerCase());
} }
bool isBipWordsList(List<String> words) { bool isBipWordsList(List<String> words) {
@ -292,7 +292,7 @@ class GenerateWalletsProvider with ChangeNotifier {
// Needed for bad encoding of UTF-8 // Needed for bad encoding of UTF-8
word = word.replaceAll('é', ''); word = word.replaceAll('é', '');
word = word.replaceAll('è', ''); word = word.replaceAll('è', '');
if (!bip39Words(appLang).contains(word)) { if (!bip39Words(appLang).contains(word.toLowerCase())) {
isValid = false; isValid = false;
} }
} }

View File

@ -233,7 +233,7 @@ class WalletOptionsProvider with ChangeNotifier {
} }
Future changePinCacheChoice() async { Future changePinCacheChoice() async {
bool isCacheChecked = configBox.get('isCacheChecked') ?? true; bool isCacheChecked = configBox.get('isCacheChecked') ?? false;
await configBox.put('isCacheChecked', !isCacheChecked); await configBox.put('isCacheChecked', !isCacheChecked);
notifyListeners(); notifyListeners();
} }

View File

@ -180,7 +180,7 @@ class RestoreChest extends StatelessWidget {
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
onChanged: (v) { onChanged: (v) {
bool isValid = generateWalletProvider.isBipWord(v); bool isValid = generateWalletProvider.isBipWord(v);
if (isValid) cellCtl.text = cellCtl.text.toLowerCase();
if (isValid && generateWalletProvider.cellController11.text.isEmpty) { if (isValid && generateWalletProvider.cellController11.text.isEmpty) {
FocusScope.of(context).nextFocus(); FocusScope.of(context).nextFocus();
} }

View File

@ -38,7 +38,7 @@ class UnlockingWallet extends StatelessWidget {
currentChest = chestBox.get(currentChestNumber)!; currentChest = chestBox.get(currentChestNumber)!;
if (configBox.get('isCacheChecked') == null) { if (configBox.get('isCacheChecked') == null) {
configBox.put('isCacheChecked', true); configBox.put('isCacheChecked', false);
} }
int _pinLenght = _walletOptions.getPinLenght(wallet!.number); int _pinLenght = _walletOptions.getPinLenght(wallet!.number);