summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorGigahawk <jasperchan515@gmail.com>2020-01-20 19:48:39 -0800
committerHarsh Shandilya <msfjarvis@gmail.com>2020-01-21 09:18:39 +0530
commitc129fb347e6afb56aa693a63869b6a694894f029 (patch)
treeca0a51a9a8c8b26d28cb3f9b034f61f91cf60854 /app/src/main/java
parent44f0f22574d084b8c2b8ced4c87cb3ba67999c39 (diff)
Add full path open in autofill dialog (#609) (#610)
Fixes #609
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/UserPreference.kt4
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt9
2 files changed, 11 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
index d40c0802..0b0c9459 100644
--- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
@@ -92,10 +92,12 @@ class UserPreference : AppCompatActivity() {
val autoFillAppsPreference = findPreference<Preference>("autofill_apps")
val autoFillDefaultPreference = findPreference<CheckBoxPreference>("autofill_default")
val autoFillAlwaysShowDialogPreference = findPreference<CheckBoxPreference>("autofill_always")
+ val autoFillShowFullNamePreference = findPreference<CheckBoxPreference>("autofill_full_path")
autofillDependencies = listOf(
autoFillAppsPreference,
autoFillDefaultPreference,
- autoFillAlwaysShowDialogPreference
+ autoFillAlwaysShowDialogPreference,
+ autoFillShowFullNamePreference
)
// Misc preferences
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
index 5862fa91..100ce145 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt
@@ -412,7 +412,14 @@ class AutofillService : AccessibilityService() {
// make it optional (or make height a setting for the same effect)
val itemNames = arrayOfNulls<CharSequence>(items.size + 2)
for (i in items.indices) {
- itemNames[i] = items[i].name.replace(".gpg", "")
+ if (settings!!.getBoolean("autofill_full_path", false)) {
+ itemNames[i] = items[i].path.replace(".gpg", "")
+ .replace(
+ PasswordRepository.getRepositoryDirectory(applicationContext).toString() + "/",
+ "")
+ } else {
+ itemNames[i] = items[i].name.replace(".gpg", "")
+ }
}
itemNames[items.size] = getString(R.string.autofill_pick)
itemNames[items.size + 1] = getString(R.string.autofill_pick_and_match)