mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
parsed ShouldAutofill with app URL blacklist
This commit is contained in:
parent
4b9fa5041c
commit
b0cabbbfc2
3 changed files with 16 additions and 2 deletions
|
@ -35,6 +35,12 @@ namespace Bit.Android.Autofill
|
||||||
"com.ecosia.android","com.opera.mini.native.beta","org.mozilla.fennec_aurora","com.qwant.liberty"
|
"com.ecosia.android","com.opera.mini.native.beta","org.mozilla.fennec_aurora","com.qwant.liberty"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The URLs are blacklisted from autofilling
|
||||||
|
public static HashSet<string> BlacklistedUris = new HashSet<string>
|
||||||
|
{
|
||||||
|
"androidapp://android", "androidapp://com.x8bit.bitwarden", "androidapp://com.oneplus.applocker"
|
||||||
|
};
|
||||||
|
|
||||||
public static async Task<List<FilledItem>> GetFillItemsAsync(Parser parser, ICipherService service)
|
public static async Task<List<FilledItem>> GetFillItemsAsync(Parser parser, ICipherService service)
|
||||||
{
|
{
|
||||||
var items = new List<FilledItem>();
|
var items = new List<FilledItem>();
|
||||||
|
|
|
@ -34,8 +34,7 @@ namespace Bit.Android.Autofill
|
||||||
var parser = new Parser(structure);
|
var parser = new Parser(structure);
|
||||||
parser.Parse();
|
parser.Parse();
|
||||||
|
|
||||||
if(string.IsNullOrWhiteSpace(parser.Uri) || parser.Uri == "androidapp://com.x8bit.bitwarden" ||
|
if(!parser.ShouldAutofill)
|
||||||
parser.Uri == "androidapp://android" || !parser.FieldCollection.Fillable)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,15 @@ namespace Bit.Android.Autofill
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ShouldAutofill
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return !string.IsNullOrWhiteSpace(Uri) && !AutofillHelpers.BlacklistedUris.Contains(Uri) &&
|
||||||
|
FieldCollection != null && FieldCollection.Fillable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Parse()
|
public void Parse()
|
||||||
{
|
{
|
||||||
for(var i = 0; i < _structure.WindowNodeCount; i++)
|
for(var i = 0; i < _structure.WindowNodeCount; i++)
|
||||||
|
|
Loading…
Reference in a new issue