From ac889abdd3d71ffb7f064a384c375ec22e7734c4 Mon Sep 17 00:00:00 2001 From: Daniel Rose Date: Wed, 19 Sep 2018 22:53:11 +0200 Subject: don't show hidden files and directories (#424) --- .../java/com/zeapo/pwdstore/autofill/AutofillService.java | 9 ++++----- .../java/com/zeapo/pwdstore/utils/PasswordRepository.java | 11 ++++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java index 5b969d25..87c0df75 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java @@ -386,14 +386,13 @@ public class AutofillService extends AccessibilityService { for (File file : passList) { if (file.isFile()) { - if (appName.toLowerCase().contains(file.getName().toLowerCase().replace(".gpg", ""))) { + if (!file.isHidden() && appName.toLowerCase().contains(file.getName().toLowerCase().replace(".gpg", ""))) { items.add(file); } } else { - // ignore .git and .extensions directory - if (file.getName().equals(".git") || file.getName().equals(".extensions")) - continue; - items.addAll(searchPasswords(file, appName)); + if (!file.isHidden()) { + items.addAll(searchPasswords(file, appName)); + } } } return items; diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java index d724f090..a44b10a9 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java @@ -195,12 +195,13 @@ public class PasswordRepository { for (File file : passList) { if (file.isFile()) { - passwordList.add(PasswordItem.newPassword(file.getName(), file, rootDir)); + if (!file.isHidden()) { + passwordList.add(PasswordItem.newPassword(file.getName(), file, rootDir)); + } } else { - // ignore .git and .extensions directory - if (file.getName().equals(".git") || file.getName().equals(".extensions")) - continue; - passwordList.add(PasswordItem.newCategory(file.getName(), file, rootDir)); + if (!file.isHidden()) { + passwordList.add(PasswordItem.newCategory(file.getName(), file, rootDir)); + } } } sort(passwordList, sortOrder.comparator); -- cgit v1.2.3