diff options
author | Gigahawk <jasperchan515@gmail.com> | 2020-01-20 19:48:39 -0800 |
---|---|---|
committer | Harsh Shandilya <msfjarvis@gmail.com> | 2020-01-21 09:18:39 +0530 |
commit | c129fb347e6afb56aa693a63869b6a694894f029 (patch) | |
tree | ca0a51a9a8c8b26d28cb3f9b034f61f91cf60854 /app/src | |
parent | 44f0f22574d084b8c2b8ced4c87cb3ba67999c39 (diff) |
Add full path open in autofill dialog (#609) (#610)
Fixes #609
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/UserPreference.kt | 4 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt | 9 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/xml/preference.xml | 5 |
4 files changed, 18 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) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c0c4c3fd..e7ffa3e9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -159,6 +159,8 @@ <string name="pref_autofill_default_title">Automatically match by default</string> <string name="pref_autofill_default_hint">Default to \'Automatically match\' for apps without custom settings. Otherwise, \'Never match.\'</string> <string name="pref_autofill_always_title">Always show dialog</string> + <string name="pref_autofill_full_path_title">Show Full Path</string> + <string name="pref_autofill_full_path_hint">Show full path of matching password files</string> <string name="pref_misc_title">Misc</string> <string name="pref_clear_clipboard_title">Clear clipboard 20 times</string> <string name="pref_clear_clipboard_hint">Store consecutive numbers in the clipboard 20 times. Useful on Samsung phones that feature clipboard history.</string> diff --git a/app/src/main/res/xml/preference.xml b/app/src/main/res/xml/preference.xml index b03bfa5b..be6b49d6 100644 --- a/app/src/main/res/xml/preference.xml +++ b/app/src/main/res/xml/preference.xml @@ -118,6 +118,11 @@ android:defaultValue="false" android:key="autofill_always" android:title="@string/pref_autofill_always_title"/> + <androidx.preference.CheckBoxPreference + android:defaultValue="false" + android:key="autofill_full_path" + android:summary="@string/pref_autofill_full_path_hint" + android:title="@string/pref_autofill_full_path_title"/> </androidx.preference.PreferenceCategory> <androidx.preference.PreferenceCategory android:title="@string/pref_misc_title"> |