示例#1
0
        private static void LogcatCallback()
        {
            CConsole.GCFM("logcat").outputToLog = false;
            CConsole.GCFM("logcat").OutputReceived += (output, e) =>
            {
                if (output.Contains("enqueueNotificationInternal"))
                {
                    string[] split = output.Split();

                    string package = split[4].Split('=')[1];
                    if (package == "android") return;

                    string f1 = split[11];
                    string f2 = f1.Split('=')[1];
                    string f3 = f2.Substring(2);
                    uint flags = 0;
                    bool succ = uint.TryParse(f3, System.Globalization.NumberStyles.HexNumber, null, out flags);

                    if (!succ) return;

                    Notification n = new Notification(package, Convert.ToInt32(flags));

                    OnNotificationEvent(n);

                    n = null;
                }
            };
            CConsole.GCFM("logcat").ExecuteCommand("adb logcat");
        }
示例#2
0
 private static void OnNotificationEvent(Notification n)
 {
     if (NotificationEvent != null)
     {
         NotificationEvent(n);
     }
 }
示例#3
0
文件: frmMain.cs 项目: pipe01/adb-net
 private void AndroidDevice_NotificationEvent(Notification notification)
 {
     MessageBox.Show(notification.PackageName);
 }