From 6fa4806e8160335c4c7d7ec7a3caf7ca0962e49f Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Thu, 29 Oct 2015 21:47:04 +0100 Subject: [PATCH] avoid searching for host (with or without subdomains) for androidapp:// queries --- src/keepass2android/ShareUrlResults.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/keepass2android/ShareUrlResults.cs b/src/keepass2android/ShareUrlResults.cs index ef822c03..7944b362 100644 --- a/src/keepass2android/ShareUrlResults.cs +++ b/src/keepass2android/ShareUrlResults.cs @@ -99,12 +99,16 @@ namespace keepass2android { //first: search for exact url Group = _db.SearchForExactUrl(url); - //if no results, search for host (e.g. "accounts.google.com") - if (!Group.Entries.Any()) - Group = _db.SearchForHost(url, false); - //if still no results, search for host, allowing subdomains ("www.google.com" in entry is ok for "accounts.google.com" in search (but not the other way around) - if (!Group.Entries.Any()) - Group = _db.SearchForHost(url, true); + if (!url.StartsWith("androidapp://")) + { + //if no results, search for host (e.g. "accounts.google.com") + if (!Group.Entries.Any()) + Group = _db.SearchForHost(url, false); + //if still no results, search for host, allowing subdomains ("www.google.com" in entry is ok for "accounts.google.com" in search (but not the other way around) + if (!Group.Entries.Any()) + Group = _db.SearchForHost(url, true); + + } //if no results returned up to now, try to search through other fields as well: if (!Group.Entries.Any()) Group = _db.SearchForText(url);