diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index 4f10b70dc..d5d936985 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -17,7 +17,7 @@ Off Properties\AndroidManifest.xml false - v7.1 + v8.0 armeabi,armeabi-v7a,x86 Xamarin.Android.Net.AndroidClientHandler @@ -287,6 +287,7 @@ + @@ -1062,6 +1063,9 @@ + + + diff --git a/src/Android/AutofillFrameworkService.cs b/src/Android/AutofillFrameworkService.cs new file mode 100644 index 000000000..07ae9a617 --- /dev/null +++ b/src/Android/AutofillFrameworkService.cs @@ -0,0 +1,30 @@ +using Android; +using Android.App; +using Android.OS; +using Android.Runtime; +using Android.Service.Autofill; +using Android.Util; + +namespace Bit.Android +{ + [Service(Permission = Manifest.Permission.BindAutofillService, Label = "bitwarden")] + [IntentFilter(new string[] { "android.service.autofill.AutofillService" })] + [MetaData("android.autofill", Resource = "@xml/autofillservice")] + [Register("com.x8bit.bitwarden.AutofillFrameworkService")] + public class AutofillFrameworkService : global::Android.Service.Autofill.AutofillService + { + public override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal, FillCallback callback) + { + var structure = request.FillContexts[request.FillContexts.Count - 1].Structure; + var data = request.ClientState; + } + + public override void OnSaveRequest(SaveRequest request, SaveCallback callback) + { + var context = request.FillContexts; + var structure = context[context.Count - 1].Structure; + var data = request.ClientState; + + } + } +} diff --git a/src/Android/Properties/AndroidManifest.xml b/src/Android/Properties/AndroidManifest.xml index a4df64b43..fe6c67628 100644 --- a/src/Android/Properties/AndroidManifest.xml +++ b/src/Android/Properties/AndroidManifest.xml @@ -1,6 +1,6 @@ - + diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index b6eae7d99..2b082bb55 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -5397,7 +5397,10 @@ namespace Bit.Android public const int accessibilityservice = 2131099648; // aapt resource value: 0x7f060001 - public const int filepaths = 2131099649; + public const int autofillservice = 2131099649; + + // aapt resource value: 0x7f060002 + public const int filepaths = 2131099650; static Xml() { diff --git a/src/Android/Resources/xml/autofillservice.xml b/src/Android/Resources/xml/autofillservice.xml new file mode 100644 index 000000000..422e6f3e4 --- /dev/null +++ b/src/Android/Resources/xml/autofillservice.xml @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/test/Android.Test/Android.Test.csproj b/test/Android.Test/Android.Test.csproj index 094231395..6afe7e168 100644 --- a/test/Android.Test/Android.Test.csproj +++ b/test/Android.Test/Android.Test.csproj @@ -16,7 +16,7 @@ Resources\Resource.Designer.cs Off false - v7.1 + v8.0 Properties\AndroidManifest.xml