From 6af1da01db9439ea6c6ce0a67f1fd1a559730ef5 Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Thu, 18 Feb 2021 17:48:25 +0100 Subject: [PATCH] fix to autofill: continue if dataset has no name --- .../services/AutofillBase/AutofillServiceBase.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/keepass2android/services/AutofillBase/AutofillServiceBase.cs b/src/keepass2android/services/AutofillBase/AutofillServiceBase.cs index e08b86d9..b3908327 100644 --- a/src/keepass2android/services/AutofillBase/AutofillServiceBase.cs +++ b/src/keepass2android/services/AutofillBase/AutofillServiceBase.cs @@ -132,13 +132,14 @@ namespace keepass2android.services.AutofillBase if (query.IncompatiblePackageAndDomain == false) { + Kp2aLog.Log("AF: (query.IncompatiblePackageAndDomain == false)"); //domain and package are compatible. Use Domain if available and package otherwise. Can fill without warning. foreach (var entryDataset in BuildEntryDatasets(query.DomainOrPackage, query.WebDomain, query.PackageName, autofillIds, parser, DisplayWarning.None).Where(ds => ds != null) ) { - + Kp2aLog.Log("AF: Got EntryDataset " + (entryDataset == null)); responseBuilder.AddDataset(entryDataset); hasEntryDataset = true; } @@ -192,7 +193,9 @@ namespace keepass2android.services.AutofillBase DisplayWarning warning) { List result = new List(); + Kp2aLog.Log("AF: BuildEntryDatasets"); var suggestedEntries = GetSuggestedEntries(query).ToDictionary(e => e.DatasetName, e => e); + Kp2aLog.Log("AF: BuildEntryDatasets found " + suggestedEntries.Count + " entries"); foreach (var filledAutofillFieldCollection in suggestedEntries.Values) { @@ -205,6 +208,8 @@ namespace keepass2android.services.AutofillBase FilledAutofillFieldCollection partitionData = AutofillHintsHelper.FilterForPartition(filledAutofillFieldCollection, parser.AutofillFields.FocusedAutofillCanonicalHints); + Kp2aLog.Log("AF: Add dataset"); + result.Add(AutofillHelper.NewDataset(this, parser.AutofillFields, partitionData, IntentBuilder)); } else @@ -214,7 +219,10 @@ namespace keepass2android.services.AutofillBase IntentBuilder.GetAuthIntentSenderForWarning(this, query, queryDomain, queryPackage, warning); var datasetName = filledAutofillFieldCollection.DatasetName; if (datasetName == null) - return null; + { + Kp2aLog.Log("AF: dataset name is null"); + continue; + } RemoteViews presentation = AutofillHelper.NewRemoteViews(PackageName, datasetName, AppNames.LauncherIcon); @@ -226,7 +234,7 @@ namespace keepass2android.services.AutofillBase { datasetBuilder.SetValue(autofillId, AutofillValue.ForText("PLACEHOLDER")); } - + Kp2aLog.Log("AF: Add auth dataset"); result.Add(datasetBuilder.Build()); } }