diff --git a/src/Android/AutofillService.cs b/src/Android/AutofillService.cs index b5fd2a330..eeed6e8a2 100644 --- a/src/Android/AutofillService.cs +++ b/src/Android/AutofillService.cs @@ -23,7 +23,6 @@ namespace Bit.Android private const string SystemUiPackage = "com.android.systemui"; private const string BitwardenPackage = "com.x8bit.bitwarden"; private const string BitwardenWebsite = "bitwarden.com"; - private const string BitwardenAccessibilityTag = "bw_access"; private static Dictionary SupportedBrowsers => new List { @@ -67,10 +66,15 @@ namespace Bit.Android private static HashSet FilteredPackageNames => new HashSet { + SystemUiPackage, "com.google.android.googlequicksearchbox", "com.google.android.apps.nexuslauncher", "com.google.android.launcher", - SystemUiPackage + "com.computer.desktop.ui.launcher", + "com.launcher.notelauncher", + "com.anddoes.launcher", + "com.actionlauncher.playstore", + "ch.deletescape.lawnchair.plah" }; private readonly IAppSettingsService _appSettings; @@ -82,12 +86,6 @@ namespace Bit.Android _appSettings = Resolver.Resolve(); } - private void Log(string message) - { - global::Android.Util.Log.WriteLine(global::Android.Util.LogPriority.Info, - BitwardenAccessibilityTag, message); - } - public override void OnAccessibilityEvent(AccessibilityEvent e) { var powerManager = (PowerManager)GetSystemService(PowerService); @@ -102,27 +100,18 @@ namespace Bit.Android try { - if(e.PackageName.Contains("logcat")) - { - return; - } - if(string.IsNullOrWhiteSpace(e?.PackageName) || FilteredPackageNames.Contains(e.PackageName) || e.PackageName.Contains("launcher")) { - Log("FILTERED - " + e.PackageName + " fired event " + e.EventType); return; } - Log(e.PackageName + " fired event " + e.EventType); - var root = RootInActiveWindow; if(root == null || root.PackageName != e.PackageName) { return; } - /* //var testNodes = GetWindowNodes(root, e, n => n.ViewIdResourceName != null && n.Text != null, false); //var testNodesData = testNodes.Select(n => new { id = n.ViewIdResourceName, text = n.Text }); //testNodes.Dispose(); @@ -230,13 +219,9 @@ namespace Bit.Android notificationManager?.Dispose(); root.Dispose(); e.Dispose(); - */ } // Suppress exceptions so that service doesn't crash - catch(Exception ex) - { - Log("Exception occurred: " + ex.Message); - } + catch { } } public override void OnInterrupt()