mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-04 20:30:36 +00:00
Merge pull request #89 from michaelschattgen/feature-ignorespaces
Add possibility to ignore spaces in EditTexts
This commit is contained in:
commit
f54639c791
2 changed files with 12 additions and 4 deletions
|
@ -14,9 +14,17 @@ public class EditTextHelper {
|
|||
}
|
||||
|
||||
public static char[] getEditTextChars(EditText text) {
|
||||
Editable editable = text.getText();
|
||||
char[] chars = new char[editable.length()];
|
||||
editable.getChars(0, editable.length(), chars, 0);
|
||||
return getEditTextChars(text, false);
|
||||
}
|
||||
|
||||
public static char[] getEditTextChars(EditText text, boolean removeSpaces) {
|
||||
String editTextString = text.getText().toString();
|
||||
if (removeSpaces) {
|
||||
editTextString = editTextString.replaceAll("\\s","");
|
||||
}
|
||||
|
||||
char[] chars = new char[editTextString.length()];
|
||||
editTextString.getChars(0, editTextString.length(), chars, 0);
|
||||
return chars;
|
||||
}
|
||||
|
||||
|
|
|
@ -444,7 +444,7 @@ public class EditEntryActivity extends AegisActivity {
|
|||
|
||||
byte[] secret;
|
||||
try {
|
||||
secret = Base32.decode(EditTextHelper.getEditTextChars(_textSecret));
|
||||
secret = Base32.decode(EditTextHelper.getEditTextChars(_textSecret, true));
|
||||
} catch (Base32Exception e) {
|
||||
throw new ParseException("Secret is not valid base32.");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue