Compare commits
1 Commits
2478--auto
...
2458--seed
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c934755e1c |
@@ -72,13 +72,6 @@ namespace Kp2aAutofillParserTest
|
||||
RunTestFromAutofillInput(resourceName, "com.expressvpn.vpn", null);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HandlesAutospillGracefully()
|
||||
{
|
||||
var resourceName = "Kp2aAutofillParserTest.autospill.json";
|
||||
RunTestFromAutofillInput(resourceName, "com.vivaldi.browser", "m.facebook.com");
|
||||
}
|
||||
|
||||
private void RunTestFromAutofillInput(string resourceName, string expectedPackageName = null, string expectedWebDomain = null)
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
|
@@ -9,7 +9,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="autospill.json" />
|
||||
<None Remove="chrome-android10-amazon-it.json" />
|
||||
<None Remove="com-expressvpn-vpn-android13.json" />
|
||||
<None Remove="com-ifs-banking-fiid3364-android13.json" />
|
||||
@@ -55,9 +54,6 @@
|
||||
<EmbeddedResource Include="com-servicenet-mobile-no-focus.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="autospill.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="imdb.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
|
@@ -1,48 +0,0 @@
|
||||
{
|
||||
"InputFields": [
|
||||
{
|
||||
"IdEntry": "native_username",
|
||||
"ClassName": "android.widget.EditText",
|
||||
"AutofillHints": null,
|
||||
"IsFocused": false,
|
||||
"InputType": 1,
|
||||
"HtmlInfoTag": null,
|
||||
"HtmlInfoTypeAttribute": null,
|
||||
"ExpectedAssignedHints": ["username"]
|
||||
},
|
||||
{
|
||||
"IdEntry": "native_password",
|
||||
"ClassName": "android.widget.EditText",
|
||||
"AutofillHints": null,
|
||||
"IsFocused": false,
|
||||
"InputType": 129,
|
||||
"HtmlInfoTag": null,
|
||||
"HtmlInfoTypeAttribute": null,
|
||||
"ExpectedAssignedHints": []
|
||||
},
|
||||
{
|
||||
"IdEntry": "webview_email",
|
||||
"ClassName": "android.widget.EditText",
|
||||
"AutofillHints": [ "email" ],
|
||||
"IsFocused": true,
|
||||
"InputType": 0,
|
||||
"HtmlInfoTag": null,
|
||||
"HtmlInfoTypeAttribute": null,
|
||||
"ExpectedAssignedHints": [ "emailAddress" ]
|
||||
},
|
||||
{
|
||||
"IdEntry": "webview_password",
|
||||
"ClassName": "android.widget.EditText",
|
||||
"AutofillHints": [
|
||||
"password"
|
||||
],
|
||||
"IsFocused": false,
|
||||
"InputType": 0,
|
||||
"HtmlInfoTag": null,
|
||||
"HtmlInfoTypeAttribute": null,
|
||||
"ExpectedAssignedHints": [ "password" ]
|
||||
}
|
||||
],
|
||||
"PackageId": "com.vivaldi.browser",
|
||||
"WebDomain": "m.facebook.com"
|
||||
}
|
@@ -68,5 +68,8 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\values\Strings.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
|
||||
</Project>
|
@@ -31,17 +31,8 @@ namespace PluginTOTP
|
||||
_muteWarnings = muteWarnings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if specified Entry contains Settings that are not null.
|
||||
/// </summary>
|
||||
internal bool SettingsCheck(IDictionary<string, string> entryFields)
|
||||
{
|
||||
string settings;
|
||||
entryFields.TryGetValue(SettingsFieldName, out settings);
|
||||
return !String.IsNullOrEmpty(settings);
|
||||
}
|
||||
|
||||
internal bool SeedCheck(IDictionary<string, string> entryFields)
|
||||
|
||||
internal bool HasSeed(IDictionary<string, string> entryFields)
|
||||
{
|
||||
string seed;
|
||||
entryFields.TryGetValue(SeedFieldName, out seed);
|
||||
@@ -100,15 +91,15 @@ namespace PluginTOTP
|
||||
}
|
||||
|
||||
private string[] SettingsGet(IDictionary<string, string> entryFields)
|
||||
{
|
||||
return entryFields[SettingsFieldName].Split(';');
|
||||
}
|
||||
{
|
||||
return entryFields.TryGetValue(SettingsFieldName, out var settings) ? settings.Split(';') : new[] { "30", "6" };
|
||||
}
|
||||
|
||||
public TotpData GetTotpData(IDictionary<string, string> entryFields)
|
||||
{
|
||||
TotpData res = new TotpData();
|
||||
|
||||
if (SettingsCheck(entryFields) && SeedCheck(entryFields))
|
||||
if (HasSeed(entryFields))
|
||||
{
|
||||
bool ValidInterval; bool ValidLength; bool ValidUrl;
|
||||
if (SettingsValidate(entryFields, out ValidInterval, out ValidLength, out ValidUrl))
|
||||
|
Reference in New Issue
Block a user