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) {
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;

View File

@ -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);