From 2a921aec657500618d74b1809e18a5786bd6e1d4 Mon Sep 17 00:00:00 2001 From: Timo Loewe Date: Sat, 12 Jan 2019 14:54:54 +0100 Subject: [PATCH] Fix autofill preference referencing hard-coded application id (#473) --- app/src/main/java/com/zeapo/pwdstore/UserPreference.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt index 2f36c965..afac816a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt @@ -375,7 +375,9 @@ class UserPreference : AppCompatActivity() { .getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager val runningServices = am .getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC) - return runningServices.any { "com.zeapo.pwdstore/.autofill.AutofillService" == it.id } + return runningServices + .map { it.id.substringBefore("/") } + .any { it == BuildConfig.APPLICATION_ID } } override fun onActivityResult(