Exemplo n.º 1
0
        private void Trv_commandTreeView_DoubleClick(object sender, EventArgs e)
        {
            // todo add network capture tcpdump
            try
            {
                string tag;

                if ((tag = trv_commandTreeView.SelectedNode.Tag.ToString()) != null)
                {
                    if (tag.StartsWith("adb ") || tag.StartsWith("fastboot "))
                    {
                        // seriennummer für fastboot implementieren
                        cmdProcess.StartProcessing(tag, formMethods.SelectedDevice());
                    }

                    else if (tag.StartsWith("#"))
                    {
                        switch (tag)
                        {
                        case "#prop":
                            new SetProp(cmdProcess, formMethods).Show();
                            break;

                        case "#screenshot":

                            if (!String.IsNullOrEmpty(formMethods.SelectedDevice()))
                            {
                                saveFileDialog.FileName = "screenshot_" + DateTime.Now.ToString().Replace(' ', '_').Replace(':', '.');
                                saveFileDialog.Filter   = "PNG Image(.png)|*.png";
                                if (saveFileDialog.ShowDialog() == DialogResult.OK)
                                {
                                    cmdProcess.StartProcessing("adb shell screencap -p > " + saveFileDialog.FileName, formMethods.SelectedDevice());
                                }
                            }

                            break;

                        case "#screenrecord":
                            if (screenRecord == null || screenRecord.IsDisposed)
                            {
                                screenRecord = new ScreenRecord(cmdProcess, formMethods);
                                screenRecord.Show();
                            }
                            else
                            {
                                screenRecord.Focus();
                            }
                            break;

                        case "#spoofmac":
                            if (spoofMac == null || spoofMac.IsDisposed)
                            {
                                spoofMac = new SpoofMac(cmdProcess, formMethods);
                                spoofMac.Show();
                            }
                            else
                            {
                                spoofMac.Focus();
                            }
                            break;

                        case "#resolution":
                            if (resolutionChange == null || resolutionChange.IsDisposed)
                            {
                                resolutionChange = new ResolutionChange(cmdProcess, formMethods);
                                resolutionChange.Show();
                            }
                            else
                            {
                                resolutionChange.Focus();
                            }
                            break;

                        case "#density":
                            if (densityChange == null || densityChange.IsDisposed)
                            {
                                densityChange = new Density(cmdProcess, formMethods);
                                densityChange.Show();
                            }
                            else
                            {
                                densityChange.Focus();
                            }
                            break;

                        case "#files":
                            if (fileOps == null || fileOps.IsDisposed)
                            {
                                fileOps = new FileOps(cmdProcess, formMethods);
                                fileOps.Show();
                            }
                            else
                            {
                                fileOps.Focus();
                            }
                            break;

                        case "#installuninstall":
                            if (installUninstall == null || installUninstall.IsDisposed)
                            {
                                installUninstall = new InstallUninstall(cmdProcess, formMethods);
                                installUninstall.Show();
                            }
                            else
                            {
                                installUninstall.Focus();
                            }
                            break;

                        case "#sideload":
                            if (sideLoad == null || sideLoad.IsDisposed)
                            {
                                sideLoad = new Sideload(cmdProcess, formMethods);
                                sideLoad.Show();
                            }
                            else
                            {
                                sideLoad.Focus();
                            }
                            break;

                        case "#backuprestore":
                            if (backupRestore == null || backupRestore.IsDisposed)
                            {
                                backupRestore = new BackupRestore(cmdProcess, formMethods);
                                backupRestore.Show();
                            }
                            else
                            {
                                backupRestore.Focus();
                            }
                            break;

                        case "#logcatadvanced":
                            if (logcatAdvanced == null || logcatAdvanced.IsDisposed)
                            {
                                logcatAdvanced = new LogcatAdvanced(cmdProcess, formMethods);
                                logcatAdvanced.Show();
                            }
                            else
                            {
                                logcatAdvanced.Focus();
                            }
                            break;

                        case "#credits":
                            new Credits().ShowDialog();
                            break;
                        }
                    }
                }
            }
            catch (Exception) { }
        }