Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.IO;
- using System.Diagnostics;
- namespace Swiss_ADB_utillity
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- OpenFileDialog openfile = new OpenFileDialog();
- openfile.Filter = "APK|*.apk";
- openfile.Title = "Open a file..";
- if (openfile.ShowDialog() == DialogResult.OK)
- {
- apkTextbox.Text = openfile.FileName;
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "adb.exe";
- startInfo.Arguments = " install \"" + apkTextbox.Text + "\"";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- private void button4_Click(object sender, EventArgs e)
- {
- FolderBrowserDialog backupfolder = new FolderBrowserDialog();
- backupfolder.Description = "Choose backup location";
- if (backupfolder.ShowDialog() == DialogResult.OK)
- {
- backupTextbox.Text = backupfolder.SelectedPath + "\\backup.ab";
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "adb.exe";
- startInfo.Arguments = " backup -all -f \"" + apkTextbox.Text + "\"";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- private void button6_Click(object sender, EventArgs e)
- {
- OpenFileDialog openfile = new OpenFileDialog();
- openfile.Filter = "ZIP files|*.zip";
- openfile.Title = "Open a file..";
- if (openfile.ShowDialog() == DialogResult.OK)
- {
- sideloadTextbox.Text = openfile.FileName;
- }
- }
- private void button5_Click(object sender, EventArgs e)
- {
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "adb.exe";
- startInfo.Arguments = " sideload \"" + sideloadTextbox.Text + "\"";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- private void button7_Click(object sender, EventArgs e)
- {
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "adb.exe";
- startInfo.Arguments = " reboot";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- private void button8_Click(object sender, EventArgs e)
- {
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "adb.exe";
- startInfo.Arguments = " reboot recovery";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- private void button9_Click(object sender, EventArgs e)
- {
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "adb.exe";
- startInfo.Arguments = " reboot bootloader";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- private void button10_Click(object sender, EventArgs e)
- {
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "fastboot.exe";
- startInfo.Arguments = " reboot";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- private void button11_Click(object sender, EventArgs e)
- {
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "fastboot.exe";
- startInfo.Arguments = " oem unlock";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- private void button13_Click(object sender, EventArgs e)
- {
- OpenFileDialog openfile = new OpenFileDialog();
- openfile.Filter = "ZIP files|*.zip";
- openfile.Title = "Open a file..";
- if (openfile.ShowDialog() == DialogResult.OK)
- {
- flashzipTextbox.Text = openfile.FileName;
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "fastboot.exe";
- startInfo.Arguments = " flash \"" + openfile.FileName + "\"";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- }
- private void button12_Click(object sender, EventArgs e)
- {
- OpenFileDialog openfile = new OpenFileDialog();
- openfile.Filter = "IMG files|*.img";
- openfile.Title = "Open a file..";
- if (openfile.ShowDialog() == DialogResult.OK)
- {
- flashsystemTextbox.Text = openfile.FileName;
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "fastboot.exe";
- startInfo.Arguments = " flash system \"" + openfile.FileName + "\"";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- }
- private void button14_Click(object sender, EventArgs e)
- {
- OpenFileDialog openfile = new OpenFileDialog();
- openfile.Filter = "IMG files|*.img";
- openfile.Title = "Open a file..";
- if (openfile.ShowDialog() == DialogResult.OK)
- {
- flashdataTextbox.Text = openfile.FileName;
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "fastboot.exe";
- startInfo.Arguments = " flash data \"" + openfile.FileName + "\"";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- }
- private void button15_Click(object sender, EventArgs e)
- {
- OpenFileDialog openfile = new OpenFileDialog();
- openfile.Filter = "IMG files|*.img";
- openfile.Title = "Open a file..";
- if (openfile.ShowDialog() == DialogResult.OK)
- {
- flashrecoveryTextbox.Text = openfile.FileName;
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "fastboot.exe";
- startInfo.Arguments = " flash recovery \"" + openfile.FileName + "\"";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- }
- private void button16_Click(object sender, EventArgs e)
- {
- OpenFileDialog openfile = new OpenFileDialog();
- openfile.Filter = "IMG files|*.img";
- openfile.Title = "Open a file..";
- if (openfile.ShowDialog() == DialogResult.OK)
- {
- flashbootTextbox.Text = openfile.FileName;
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.CreateNoWindow = true;
- startInfo.UseShellExecute = false;
- startInfo.RedirectStandardOutput = true;
- startInfo.FileName = "fastboot.exe";
- startInfo.Arguments = " flash boot \"" + openfile.FileName + "\"";
- process.StartInfo = startInfo;
- process.Start();
- Console.Text = Console.Text + process.StandardOutput.ReadToEnd();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement