summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Henneke <FabianHenneke@users.noreply.github.com>2020-04-14 11:43:57 +0200
committerGitHub <noreply@github.com>2020-04-14 11:43:57 +0200
commitec8bcae8fafa638e9e2e76ee041fa2db5bd292e6 (patch)
tree0aa4d7842c8d23cb365b9ed215a784cc2f4a2cda
parentef0cc9f047ace208115115786ecf66490061b4bb (diff)
Improve Autofill enable UI and flaky browser list (#704)
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/UserPreference.kt5
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt15
-rw-r--r--app/src/main/res/layout/oreo_autofill_instructions.xml9
-rw-r--r--app/src/main/res/values-ru/strings.xml4
-rw-r--r--app/src/main/res/values/strings.xml10
5 files changed, 28 insertions, 15 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
index 06ee24e5..30c98396 100644
--- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt
@@ -398,8 +398,9 @@ class UserPreference : AppCompatActivity() {
val supportDescription = when (it.second) {
BrowserAutofillSupportLevel.None -> getString(R.string.oreo_autofill_no_support)
BrowserAutofillSupportLevel.FlakyFill -> getString(R.string.oreo_autofill_flaky_fill_support)
- BrowserAutofillSupportLevel.Fill -> getString(R.string.oreo_autofill_fill_support)
- BrowserAutofillSupportLevel.FillAndSave -> getString(R.string.oreo_autofill_fill_and_save_support)
+ BrowserAutofillSupportLevel.PasswordFill -> getString(R.string.oreo_autofill_password_fill_support)
+ BrowserAutofillSupportLevel.GeneralFill -> getString(R.string.oreo_autofill_general_fill_support)
+ BrowserAutofillSupportLevel.GeneralFillAndSave -> getString(R.string.oreo_autofill_general_fill_and_save_support)
}
"$appLabel: $supportDescription"
}
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt
index c268e755..be6263de 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/FeatureAndTrustDetection.kt
@@ -157,14 +157,18 @@ fun getBrowserAutofillSupportInfoIfTrusted(
}
private val FLAKY_BROWSERS = listOf(
- "com.android.chrome"
+ "com.android.chrome",
+ "com.chrome.beta",
+ "com.chrome.canary",
+ "com.chrome.dev"
)
enum class BrowserAutofillSupportLevel {
None,
FlakyFill,
- Fill,
- FillAndSave
+ PasswordFill,
+ GeneralFill,
+ GeneralFillAndSave
}
@RequiresApi(Build.VERSION_CODES.O)
@@ -175,9 +179,10 @@ private fun getBrowserAutofillSupportLevel(
val browserInfo = getBrowserAutofillSupportInfoIfTrusted(context, appPackage)
return when {
browserInfo == null -> BrowserAutofillSupportLevel.None
- browserInfo.saveFlags != null -> BrowserAutofillSupportLevel.FillAndSave
appPackage in FLAKY_BROWSERS -> BrowserAutofillSupportLevel.FlakyFill
- else -> BrowserAutofillSupportLevel.Fill
+ browserInfo.multiOriginMethod == BrowserMultiOriginMethod.None -> BrowserAutofillSupportLevel.PasswordFill
+ browserInfo.saveFlags == null -> BrowserAutofillSupportLevel.GeneralFill
+ else -> BrowserAutofillSupportLevel.GeneralFillAndSave
}
}
diff --git a/app/src/main/res/layout/oreo_autofill_instructions.xml b/app/src/main/res/layout/oreo_autofill_instructions.xml
index 376a4363..e9bb7e55 100644
--- a/app/src/main/res/layout/oreo_autofill_instructions.xml
+++ b/app/src/main/res/layout/oreo_autofill_instructions.xml
@@ -16,19 +16,22 @@
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Password Store can offer to fill login forms and even save credentials you enter in apps or on websites."
+ android:text="@string/oreo_autofill_enable_dialog_description"
android:textSize="16sp" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="To enable this feature, tap OK to go to Autofill settings. There, select Password Store from the list."
+ android:layout_marginTop="@dimen/activity_vertical_margin"
+ android:text="@string/oreo_autofill_enable_dialog_instructions"
android:textSize="16sp" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Autofill support with installed browsers:"
+ android:layout_marginTop="@dimen/activity_vertical_margin"
+ android:text="@string/oreo_autofill_enable_dialog_installed_browsers"
+ android:textStyle="bold"
android:textSize="16sp" />
<androidx.appcompat.widget.AppCompatTextView
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index a703ba9f..cfbcedb2 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -254,8 +254,8 @@
<string name="oreo_autofill_warning_publisher_warning_sign_description">Предупреждение</string>
<string name="oreo_autofill_warning_publisher_dataset_summary">Нажмите для получения подробностей...</string>
<string name="oreo_autofill_warning_publisher_dataset_title">Возможная попытка фишинга</string>
- <string name="oreo_autofill_fill_and_save_support">Заполнить и сохранить учетные данные</string>
- <string name="oreo_autofill_fill_support">Заполнить учетные данные</string>
+ <string name="oreo_autofill_general_fill_and_save_support">Заполнить и сохранить учетные данные</string>
+ <string name="oreo_autofill_general_fill_support">Заполнить учетные данные</string>
<string name="oreo_autofill_flaky_fill_support">Заполнить учетные данные (время от времени может требоваться перезапуск браузера)</string>
<string name="oreo_autofill_no_support">Не поддерживается</string>
<string name="oreo_autofill_preference_directory_structure">Организация файла паролей</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 8637235b..7f22dc87 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -271,11 +271,15 @@
<string name="oreo_autofill_warning_publisher_warning_sign_description">Warning</string>
<string name="oreo_autofill_warning_publisher_dataset_summary">Tap for details…</string>
<string name="oreo_autofill_warning_publisher_dataset_title">Possible phishing attempt</string>
- <string name="oreo_autofill_fill_and_save_support">Fill and save credentials</string>
- <string name="oreo_autofill_fill_support">Fill credentials</string>
- <string name="oreo_autofill_flaky_fill_support">Fill credentials (may require restarting the browser from time to time)</string>
+ <string name="oreo_autofill_general_fill_and_save_support">Fill and save credentials</string>
+ <string name="oreo_autofill_general_fill_support">Fill credentials</string>
+ <string name="oreo_autofill_password_fill_support">Fill passwords</string>
+ <string name="oreo_autofill_flaky_fill_support">Fill passwords (may require restarting the browser from time to time)</string>
<string name="oreo_autofill_no_support">No support</string>
<string name="oreo_autofill_preference_directory_structure">Password file organization</string>
+ <string name="oreo_autofill_enable_dialog_description">Password Store can offer to fill login forms and even save credentials you enter in apps or on websites.</string>
+ <string name="oreo_autofill_enable_dialog_instructions">To enable this feature, tap OK to go to Autofill settings. There, select Password Store from the list and confirm the confirmation prompt with OK.</string>
+ <string name="oreo_autofill_enable_dialog_installed_browsers">Autofill support with installed browsers:</string>
<!-- Autofill -->
<string name="autofill_description">Autofills password fields in apps. Only works for Android versions 4.3 and up. Does not rely on the clipboard for Android versions 5.0 and up.</string>