Skip to content

Commit 8ad90fa

Browse files
committed
[FIX] limiting pin entry length
1 parent 7b55375 commit 8ad90fa

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

app/src/main/java/com/samourai/sentinel/PinEntryActivity.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,19 @@ public boolean onLongClick(View view) {
210210
}
211211

212212
public void OnNumberPadClick(View view) {
213-
if(PrefsUtil.getInstance(PinEntryActivity.this).getValue(PrefsUtil.HAPTIC_PIN, false) == true) {
214-
vibrator.vibrate(55);
213+
if (userInput.length() <= (AccessFactory.MAX_PIN_LENGTH - 1)){
214+
userInput.append(((Button) view).getText().toString());
215+
if(PrefsUtil.getInstance(PinEntryActivity.this).getValue(PrefsUtil.HAPTIC_PIN, false)) {
216+
vibrator.vibrate(55);
217+
}
218+
if (userInput.length() >= AccessFactory.MIN_PIN_LENGTH) {
219+
tsend.setVisibility(View.VISIBLE);
220+
} else {
221+
tsend.setVisibility(View.GONE);
222+
}
223+
displayUserInput();
215224
}
216-
userInput.append(((Button) view).getText().toString());
217-
displayUserInput();
225+
218226
}
219227

220228
private void displayUserInput() {

0 commit comments

Comments
 (0)