From 474770c5e38ac6f6519ed2ac54f0d0c52addbb0f Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Tue, 6 Apr 2021 08:50:24 +0200 Subject: Mark non-native Autofill browsers as unsupported on Oreo (#1370) Android Oreo lacks the Autofill compatibility mode for browsers, which means that browsers without explicit Android support will not trigger Autofill events on web sites. --- .../autofillparser/FeatureAndTrustDetection.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'autofill-parser/src') diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt index 7d572ba8..1a7e669e 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetection.kt @@ -48,7 +48,6 @@ import androidx.annotation.RequiresApi check whether it correctly distinguishes web origins even if iframes are present on the page. You can use https://fabianhenneke.github.io/Android-Password-Store/ as a test form. */ - /* * **Security assumption**: Browsers on this list correctly report the web origin of the top-level * window as part of their AssistStructure. @@ -208,7 +207,14 @@ private fun getBrowserAutofillSupportLevel(context: Context, appPackage: String) browserInfo.multiOriginMethod == BrowserMultiOriginMethod.None -> BrowserAutofillSupportLevel.PasswordFill browserInfo.saveFlags == null -> BrowserAutofillSupportLevel.GeneralFill else -> BrowserAutofillSupportLevel.GeneralFillAndSave + }.takeUnless { supportLevel -> + // On Android Oreo, only browsers with native Autofill support can be used with Password Store + // (compatibility mode is only available on Android Pie and higher). Since all known browsers + // with native Autofill support offer full save support as well, we reuse the list of those + // browsers here. + supportLevel != BrowserAutofillSupportLevel.GeneralFillAndSave && Build.VERSION.SDK_INT < Build.VERSION_CODES.P } + ?: BrowserAutofillSupportLevel.None } @RequiresApi(Build.VERSION_CODES.O) -- cgit v1.2.3