Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions adbGUI/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
Expand Down Expand Up @@ -86,6 +87,9 @@ private void CloseApplication()
Debug.WriteLine(" > Killing all child processes...");
CLI.StopWithShell();

// Save last ip config
File.WriteAllText("data.dat", tst_IpAdress.Text);

Debug.WriteLine(" > Closing application...");
Environment.Exit(0);
}
Expand Down Expand Up @@ -123,6 +127,12 @@ private void MainForm_KeyDown(object sender, KeyEventArgs e)

private void MainForm_Load(object sender, EventArgs e)
{
// Load last ip config
if (File.Exists("data.dat"))
{
tst_IpAdress.Text = File.ReadAllText("data.dat").Trim();
}

// Begin and cancel so the RichTextBox will stay clean. Otherwise it will start in line 2.
CLI.Commandline.BeginOutputReadLine();
CLI.Commandline.CancelOutputRead();
Expand All @@ -140,7 +150,6 @@ private void MainForm_Load(object sender, EventArgs e)
if (HelperClass.AlwaysClearConsole) { rtb_console.Invoke((MethodInvoker)(() => rtb_console.Clear())); }
};


// We start a thread which continuously (see RICHTEXTBOX_REFRSH_INTERVAL)
// reads stringBuilder and fills the RichTextBox and then empties stringBuilder.
new Thread(AppendToRichTextBox).Start();
Expand All @@ -154,6 +163,7 @@ private void MainForm_Load(object sender, EventArgs e)
//Select custom command control
cbx_customCommand.Select();
}

private void Rtb_console_Resize(object sender, EventArgs e)
{
rtb_console.ScrollToCaret();
Expand Down Expand Up @@ -278,7 +288,7 @@ private void Tsb_Power_Click(object sender, EventArgs e)
case "Reboot Fastboot":
HelperClass.Execute("adb reboot fastboot");
break;
case "Reboot Emergency Download (Qualcomm Only)":
case "Reboot Emergency Download (Qualcomm Only)":
HelperClass.Execute("adb reboot edl");
break;
case "Samsung Odin/Download mode (Samsung only)":
Expand Down
1 change: 1 addition & 0 deletions adbGUI/Methods/CLI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static void KillChildProcessesAsync()

public static void KillChildProcessesWithShell()
{
HelperClass.Execute("adb kill-server");
string input = "taskkill /F ";

foreach (int pid in GetChildProcesses())
Expand Down