don't show hidden files and directories (#424)

This commit is contained in:
Daniel Rose 2018-09-19 22:53:11 +02:00 committed by Mohamed Zenadi
parent 6ab2529811
commit ac889abdd3
2 changed files with 10 additions and 10 deletions

View File

@ -386,14 +386,13 @@ public class AutofillService extends AccessibilityService {
for (File file : passList) { for (File file : passList) {
if (file.isFile()) { 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); items.add(file);
} }
} else { } else {
// ignore .git and .extensions directory if (!file.isHidden()) {
if (file.getName().equals(".git") || file.getName().equals(".extensions")) items.addAll(searchPasswords(file, appName));
continue; }
items.addAll(searchPasswords(file, appName));
} }
} }
return items; return items;

View File

@ -195,12 +195,13 @@ public class PasswordRepository {
for (File file : passList) { for (File file : passList) {
if (file.isFile()) { if (file.isFile()) {
passwordList.add(PasswordItem.newPassword(file.getName(), file, rootDir)); if (!file.isHidden()) {
passwordList.add(PasswordItem.newPassword(file.getName(), file, rootDir));
}
} else { } else {
// ignore .git and .extensions directory if (!file.isHidden()) {
if (file.getName().equals(".git") || file.getName().equals(".extensions")) passwordList.add(PasswordItem.newCategory(file.getName(), file, rootDir));
continue; }
passwordList.add(PasswordItem.newCategory(file.getName(), file, rootDir));
} }
} }
sort(passwordList, sortOrder.comparator); sort(passwordList, sortOrder.comparator);