コード例 #1
0
ファイル: AndroidDevice.cs プロジェクト: pipe01/adb-net
        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
ファイル: AndroidDevice.cs プロジェクト: pipe01/adb-net
 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);
 }