From c200566bcaec971e1756afe5ebf96baf09e88816 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 2 Jan 2019 22:44:52 +0530 Subject: Bump minSdk to 21 (#466) * Bump minSdk to 21 Signed-off-by: Harsh Shandilya * PasswordGenerator: Constify things Signed-off-by: Harsh Shandilya * Deprecate PRNG fixes The problem being fixed doesn't exist on SDK 21 and above. Signed-off-by: Harsh Shandilya * treewide: Switch to lambdas Signed-off-by: Harsh Shandilya * treewide: Formatting fixes Signed-off-by: Harsh Shandilya * treewide: Remove useless casts and add missing annotations Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java') diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java b/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java index 590a779e..d876aefd 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java @@ -11,14 +11,13 @@ import java.io.UnsupportedEncodingException; public class PasswordEntry { private static final String[] USERNAME_FIELDS = new String[]{"login", "username"}; - - private String extraContent; private final String password; private final String username; private final String totpSecret; private final String hotpSecret; private final Long hotpCounter; private final String content; + private String extraContent; private boolean isIncremented = false; public PasswordEntry(final ByteArrayOutputStream os) throws UnsupportedEncodingException { @@ -34,7 +33,7 @@ public class PasswordEntry { hotpCounter = findHotpCounter(content); extraContent = findExtraContent(passContent); username = findUsername(); - } + } public String getPassword() { return password; @@ -76,7 +75,9 @@ public class PasswordEntry { return hotpSecret != null && hotpCounter != null; } - public boolean hotpIsIncremented() { return isIncremented; } + public boolean hotpIsIncremented() { + return isIncremented; + } public void incrementHotp() { for (String line : content.split("\n")) { @@ -126,7 +127,7 @@ public class PasswordEntry { return null; } - private String findExtraContent(String [] passContent) { + private String findExtraContent(String[] passContent) { String extraContent = passContent.length > 1 ? passContent[1] : ""; // if there is a HOTP URI, we must return the extra content with the counter incremented if (hasHotp()) { -- cgit v1.2.3