BIP39: Japanese word separator

This commit is contained in:
M66B
2022-03-08 11:51:35 +01:00
parent 6cacc1852e
commit 9a6db58bc9
2 changed files with 14 additions and 12 deletions

View File

@@ -58,12 +58,8 @@ import androidx.preference.PreferenceManager;
import androidx.webkit.WebViewFeature;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class FragmentOptionsPrivacy extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
@@ -466,13 +462,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
if (checked) {
Context context = compoundButton.getContext();
Locale locale = Locale.getDefault();
List<String> words = new ArrayList<>();
SecureRandom rnd = new SecureRandom();
for (int i = 0; i < BIP39_WORDS; i++)
words.add(BIP39.getWord(locale, rnd.nextInt(2048), context));
String mnemonic = TextUtils.join(" ", words);
String mnemonic = BIP39.getMnemonic(Locale.getDefault(), BIP39_WORDS, context);
prefs.edit().putString("wipe_mnemonic", mnemonic).apply();
tvMnemonic.setText(mnemonic);