示例#1
0
        private void Btn_LogcatAdvancedStart_Click(object sender, EventArgs e)
        {
            var alternativeBuffers = GetAlternativeBufferString();
            var regEx = GetRegularExpressionString();
            var quitAfterNumberOfLines = GetQuitAfterNumberOfLines();
            var bypassRegEx            = GetBypassRegEx();
            var pidFilter           = GetPidFilter();
            var recentNumberOfLines = GetRecentNumberOfLines();
            var specifiedTime       = GetSpecifiedTime();
            var outputFormat        = GetOutputFormat();
            var outputFilter        = GetOutputFilter();


            if (cbo_LogcatAdvancedSeparateWindow.Checked)
            {
                _lOut.Show();
                _altAdb.StartProcessing(
                    "adb logcat" + outputFilter + alternativeBuffers + outputFormat + quitAfterNumberOfLines +
                    recentNumberOfLines + specifiedTime + regEx + bypassRegEx + pidFilter,
                    _formMethods.SelectedDevice());
            }
            else
            {
                _adb.StartProcessing(
                    "adb logcat" + outputFilter + alternativeBuffers + outputFormat + quitAfterNumberOfLines +
                    recentNumberOfLines + specifiedTime + regEx + bypassRegEx + pidFilter,
                    _formMethods.SelectedDevice());
            }
        }
示例#2
0
        private void Btn_LogcatAdvancedClearBuffers_Click(object sender, EventArgs e)
        {
            var alternativeBuffers = GetAlternativeBufferString();

            if (!string.IsNullOrEmpty(alternativeBuffers))
            {
                _adb.StartProcessing("adb logcat" + alternativeBuffers + " -c", _formMethods.SelectedDevice());
            }
        }
示例#3
0
文件: FileOps.cs 项目: skinzor/adbGUI
 private void Btn_FileOpsPushPush_Click(object sender, EventArgs e)
 {
     if (txt_FileOpsPushTo.Text == "" || txt_FileOpsPushFrom.Text == "")
     {
         MessageBox.Show("Please select a file and chose destination!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         var s = "adb push \"" + txt_FileOpsPushFrom.Text + "\"" + " \"" + txt_FileOpsPushTo.Text + "\"";
         adb.StartProcessing(s, formMethods.SelectedDevice());
     }
 }
示例#4
0
        private void Btn_BackupStart_Click(object sender, EventArgs e)
        {
            var          name   = " -f \"" + txt_BackupPathTo.Text + "\"";
            var          apk    = " -noapk";
            var          shared = " -noshared";
            const string all    = " -all";
            var          system = " -system";


            if (cbo_BackupPackage.Checked == false)
            {
                if (txt_BackupPathTo.Text == "")
                {
                    MessageBox.Show(@"Please select a destination!", @"Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
                else
                {
                    if (cbo_BackupWithApk.Checked)
                    {
                        apk = " -apk";
                    }
                    if (cbo_BackupShared.Checked)
                    {
                        shared = " -shared";
                    }
                    if (cbo_BackupNoSystem.Checked)
                    {
                        system = " -nosystem";
                    }

                    _adb.StartProcessing("adb backup" + apk + shared + all + system + name,
                                         _formMethods.SelectedDevice());
                }
            }
            else
            {
                var package = cbx_BackupPackage.SelectedItem.ToString();

                if (txt_BackupPathTo.Text == "")
                {
                    MessageBox.Show(@"Please select a destination!", @"Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
                else
                {
                    _adb.StartProcessing("adb backup -apk " + package + name, _formMethods.SelectedDevice());
                }
            }
        }
示例#5
0
        private void Btn_InstallUninstallInstall_DragDrop(object sender, DragEventArgs e)
        {
            string[] s = (string[])e.Data.GetData(DataFormats.FileDrop, false);
            for (int i = 0; i < s.Length; i++)
            {
                txt_InstallUninstallPackageInstall.Text = s[i];
                if (s[i].EndsWith(".apk"))
                {
                    var filename = "\"" + txt_InstallUninstallPackageInstall.Text + "\"";

                    adb.StartProcessing("adb install -r " + filename, formMethods.SelectedDevice());
                    RefreshInstalledApps();
                }
            }
        }
示例#6
0
        private void Btn_SpoofMacSet_Click(object sender, EventArgs e)
        {
            var s = txt_SpoofMacAdress.Text;

            var r = new Regex(@"(([a-f]|[0-9]|[A-F]){2}\:){5}([a-f]|[0-9]|[A-F]){2}\b");

            if (r.Match(s).Success)
            {
                _adb.StartProcessing("adb shell su root ifconfig wlan0 hw ether " + s, _formMethods.SelectedDevice());
            }
            else
            {
                MessageBox.Show(@"Please enter a valid MAC address", @"Error");
            }
        }
示例#7
0
        private void Btn_InstallUninstallInstall_Click(object sender, EventArgs e)
        {
            var s = "\"" + txt_InstallUninstallPackageInstall.Text + "\"";

            if (txt_InstallUninstallPackageInstall.Text != "")
            {
                _adb.StartProcessing("adb install " + s, _formMethods.SelectedDevice());

                RefreshInstalledApps();
            }
            else
            {
                MessageBox.Show(@"Please select a file!", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#8
0
        private void Btn_SpoofMacSet_Click(object sender, EventArgs e)
        {
            // todo Größe der Buttons kleiner machen, damit die mit der Textbox passen
            var s = txt_SpoofMacAdress.Text;

            var r = new Regex(@"(([a-f]|[0-9]|[A-F]){2}\:){5}([a-f]|[0-9]|[A-F]){2}\b");

            if (r.Match(s).Success)
            {
                adb.StartProcessing("adb shell su root ifconfig wlan0 hw ether " + s, formMethods.SelectedDevice());
            }
            else
            {
                MessageBox.Show("Please enter a valid MAC address", "Error");
            }
        }
示例#9
0
        private void Btn_InstallUninstallInstall_Click(object sender, EventArgs e)
        {
            // Funktionen einbauen: starten, stoppen, cache leeren, apk ziehen, aktivieren, deaktivieren
            var    s      = "\"" + txt_InstallUninstallPackageInstall.Text + "\"";
            string serial = " -s " + formMethods.SelectedDevice();

            if (txt_InstallUninstallPackageInstall.Text != "")
            {
                adb.StartProcessing("adb install " + s, formMethods.SelectedDevice());

                RefreshInstalledApps();
            }
            else
            {
                MessageBox.Show("Please select a file!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#10
0
        private void Btn_screenRecordStart_Click(object sender, EventArgs e)
        {
            var size      = "";
            var rotate    = "";
            var bitrate   = "";
            var timelimit = "--time-limit " + trb_screenRecordTimeLimit.Value + " ";

            _time = trb_screenRecordTimeLimit.Value;

            if (cbo_ScreenRecordCustomResolution.Checked)
            {
                size = " --size " + txt_screenRecordResolution.Text + " ";
            }

            if (cbo_ScreenRecordRotate.Checked)
            {
                rotate = " --rotate ";
            }

            if (txt_ScreenRecordBitrate.Text != "")
            {
                bitrate = " --bit-rate " + txt_ScreenRecordBitrate.Text + " ";
            }


            saveFileDialog.FileName = "record";
            saveFileDialog.Filter   = @"Video File (*.mp4)|*.mp4";

            if (saveFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            const string phoneDestination = "/sdcard/screenrecord.mp4";
            var          localDestination = saveFileDialog.FileName;

            _adb.StartProcessing(
                "adb shell screenrecord --verbose" + size + bitrate + timelimit + rotate + phoneDestination,
                _formMethods.SelectedDevice());
            timer.Enabled = true;
            _adb.StartProcessing(
                "adb pull " + phoneDestination + " " + localDestination + " && adb shell rm " + phoneDestination,
                _formMethods.SelectedDevice());
        }
示例#11
0
文件: Sideload.cs 项目: Propaz/adbGUI
 private void Btn_SideloadStart_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txt_SideloadPath.Text))
     {
         var s = "adb sideload \"" + txt_SideloadPath.Text + "\"";
         _adb.StartProcessing(s, _formMethods.SelectedDevice());
     }
     else
     {
         MessageBox.Show(@"Please select a file!", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#12
0
 private void Btn_Erase_Click(object sender, EventArgs e)
 {
     if (txt_Erase.Text == "")
     {
         MessageBox.Show(@"Please specify a partition to erase!", @"Error", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
     else
     {
         var s = "fastboot erase " + txt_Erase.Text;
         _adb.StartProcessing(s, _formMethods.SelectedDevice());
     }
 }
示例#13
0
文件: Flash.cs 项目: WuAGe2020/adbgui
 private void Btn_Flash_Click(object sender, EventArgs e)
 {
     if (txt_FlashImageFile.Text == "" || txt_FlashToPartition.Text == "")
     {
         MessageBox.Show(@"Please select a file and specify a destination partition!", @"Error", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
     else
     {
         var s = $"fastboot flash {txt_FlashToPartition.Text} {txt_FlashImageFile.Text}";
         _adb.StartProcessing(s, _formMethods.SelectedDevice());
     }
 }
示例#14
0
 private void Btn_showDpi_Click(object sender, EventArgs e)
 {
     _adb.StartProcessing("adb shell wm density", _formMethods.SelectedDevice());
 }
示例#15
0
 private void Btn_ResolutionChangeReset_Click(object sender, EventArgs e) => _adb.StartProcessing("adb shell wm size reset", _formMethods.SelectedDevice());
示例#16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Btn_executeCommand_Click(object sender, EventArgs e)
        {
            var command = cbx_customCommand.Text;

            if (!string.IsNullOrEmpty(command))
            {
                cbx_customCommand.Items.Add(command);

                _cmdProcess.StartProcessing(command, _formMethods.SelectedDevice());
            }
            else
            {
                MessageBox.Show(@"Please enter a command!", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#17
0
        private void Btn_FileOpsPullList_Click(object sender, EventArgs e)
        {
            var path = txt_FileOpsPullFrom.Text;

            _adb.StartProcessing("adb shell ls -la " + path + " -F", _formMethods.SelectedDevice());
        }
示例#18
0
文件: SpoofMac.cs 项目: Propaz/adbGUI
 private void Btn_SpoofMacReset_Click(object sender, EventArgs e)
 {
     _adb.StartProcessing("adb shell su root ifconfig wlan0 down", _formMethods.SelectedDevice());
 }
示例#19
0
 private void Btn_setProp_Click(object sender, EventArgs e)
 {
     adb.StartProcessing("adb shell su root setprop " + txt_setPropKey.Text + " " + txt_setPropValue.Text, formMethods.SelectedDevice());
 }
 private void Btn_ResolutionChangeSet_Click(object sender, EventArgs e)
 {
     _adb.StartProcessing("adb shell wm size " + txt_phoneResolution.Text, _formMethods.SelectedDevice());
 }