aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2019-01-02 22:44:52 +0530
committerحسين <zidhussein@gmail.com>2019-01-02 17:14:52 +0000
commitc200566bcaec971e1756afe5ebf96baf09e88816 (patch)
tree15e692cdaffe08861df40849e31154409be96b46 /app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java
parentd5e589d7e48d4f44a052ecbf2817f5051bd1005f (diff)
downloadHardenedPass-c200566bcaec971e1756afe5ebf96baf09e88816.tar.gz
HardenedPass-c200566bcaec971e1756afe5ebf96baf09e88816.zip
Bump minSdk to 21 (#466)
* Bump minSdk to 21 Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com> * PasswordGenerator: Constify things Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com> * Deprecate PRNG fixes The problem being fixed doesn't exist on SDK 21 and above. Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com> * treewide: Switch to lambdas Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com> * treewide: Formatting fixes Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com> * treewide: Remove useless casts and add missing annotations Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordEntry.java11
1 files changed, 6 insertions, 5 deletions
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()) {