Browse Source

Merge pull request #3013 from nextcloud/storeMnemonicAsTyped

Store mnemonic as typed in
Tobias Kaminsky 6 years ago
parent
commit
00a045864d

+ 2 - 1
src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java

@@ -185,6 +185,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment {
 
                                 try {
                                     String privateKey = task.get();
+                                    String mnemonicUnchanged = passwordField.getText().toString();
                                     String mnemonic = passwordField.getText().toString().replaceAll("\\s", "")
                                             .toLowerCase(Locale.ROOT);
                                     String decryptedPrivateKey = EncryptionUtils.decryptPrivateKey(privateKey,
@@ -197,7 +198,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment {
                                     Log_OC.d(TAG, "Private key successfully decrypted and stored");
 
                                     arbitraryDataProvider.storeOrUpdateKeyValue(account.name, EncryptionUtils.MNEMONIC,
-                                            mnemonic);
+                                            mnemonicUnchanged);
 
                                     Intent intentExisting = new Intent();
                                     intentExisting.putExtra(SUCCESS, true);