mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-22 07:22:26 +00:00
Basic check for 25 word mnemonic
This commit is contained in:
parent
5c69fb7dba
commit
772a5004b3
1 changed files with 8 additions and 0 deletions
|
@ -52,6 +52,10 @@ public class OnboardingFragment extends Fragment {
|
|||
if(walletSeed.isEmpty()) {
|
||||
wallet = WalletManager.getInstance().createWallet(walletFile, walletPassword, Constants.MNEMONIC_LANGUAGE, 0);
|
||||
} else {
|
||||
if(!checkMnemonic(walletSeed)) {
|
||||
Toast.makeText(getContext(), getString(R.string.invalid_mnemonic_code), Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
wallet = WalletManager.getInstance().recoveryWallet(walletFile, walletPassword, walletSeed, "", 0);
|
||||
}
|
||||
wallet.close();
|
||||
|
@ -75,4 +79,8 @@ public class OnboardingFragment extends Fragment {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean checkMnemonic(String seed) {
|
||||
return (seed.split("\\s").length == 25);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue