private async void mButton_Reboot_Click(object sender, EventArgs e) { MonoFlat.MonoFlat_Button btn = (MonoFlat.MonoFlat_Button)sender; btn.Enabled = false; string arg = null; string tag = btn.Tag.ToString(); if (tag == "bootloader") { arg = "reboot-bootloader"; } if (tag == "download") { arg = "oem reboot-download"; } if (tag == "os") { arg = "reboot"; } if (arg == null) { return; } await Task.Run(() => Fastboot(arg).Dispose()); btn.Enabled = true; }
private async void mButton_Token_Click(object sender, EventArgs e) { MonoFlat.MonoFlat_Button btn = (MonoFlat.MonoFlat_Button)sender; btn.Enabled = false; string arg = null; string tag = btn.Tag.ToString(); if (tag == "new") { arg = "dump kstoken 0 0 0"; } if (tag == "old") { arg = "oem get_ks_token"; } await Task.Run(() => { Process p = Fastboot(arg); if (File.Exists("0")) { File.Delete("0"); } string text = p.StandardError.ReadToEnd(); if (!string.IsNullOrEmpty(text)) { AppendText("\r\n" + text + "\r\n"); } ShowToken(text); p.Dispose(); }); btn.Enabled = true; }
private async void mButton_Flash_Click(object sender, EventArgs e) { MonoFlat.MonoFlat_Button btn = (MonoFlat.MonoFlat_Button)sender; btn.Enabled = false; if (openFileDialog1.ShowDialog() == DialogResult.OK) { string file = openFileDialog1.FileName; await Task.Run(() => { Process p = Fastboot("flash kstoken \"" + file + "\""); string text = p.StandardError.ReadToEnd(); if (!string.IsNullOrEmpty(text)) { AppendText("\r\n" + text + "\r\n"); } p.Dispose(); }); } btn.Enabled = true; }
private void InitializeComponent() { this.monoFlat_ThemeContainer1 = new MonoFlat.MonoFlat_ThemeContainer(); this.monoFlat_ControlBox1 = new MonoFlat.MonoFlat_ControlBox(); this.txtLog = new System.Windows.Forms.TextBox(); this.button3 = new MonoFlat.MonoFlat_Button(); this.button2 = new MonoFlat.MonoFlat_Button(); this.checkBox1 = new MonoFlat.MonoFlat_CheckBox(); this.cboxOverwrite = new System.Windows.Forms.ComboBox(); this.label3 = new MonoFlat.MonoFlat_Label(); this.txtPassword = new MonoFlat.MonoFlat_TextBox(); this.label2 = new MonoFlat.MonoFlat_Label(); this.txtLocation = new MonoFlat.MonoFlat_TextBox(); this.label1 = new MonoFlat.MonoFlat_Label(); this.monoFlat_ThemeContainer1.SuspendLayout(); this.SuspendLayout(); // // monoFlat_ThemeContainer1 // this.monoFlat_ThemeContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(41)))), ((int)(((byte)(50))))); this.monoFlat_ThemeContainer1.Controls.Add(this.monoFlat_ControlBox1); this.monoFlat_ThemeContainer1.Controls.Add(this.txtLog); this.monoFlat_ThemeContainer1.Controls.Add(this.button3); this.monoFlat_ThemeContainer1.Controls.Add(this.button2); this.monoFlat_ThemeContainer1.Controls.Add(this.checkBox1); this.monoFlat_ThemeContainer1.Controls.Add(this.cboxOverwrite); this.monoFlat_ThemeContainer1.Controls.Add(this.label3); this.monoFlat_ThemeContainer1.Controls.Add(this.txtPassword); this.monoFlat_ThemeContainer1.Controls.Add(this.label2); this.monoFlat_ThemeContainer1.Controls.Add(this.txtLocation); this.monoFlat_ThemeContainer1.Controls.Add(this.label1); this.monoFlat_ThemeContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.monoFlat_ThemeContainer1.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.monoFlat_ThemeContainer1.Location = new System.Drawing.Point(0, 0); this.monoFlat_ThemeContainer1.Name = "monoFlat_ThemeContainer1"; this.monoFlat_ThemeContainer1.Padding = new System.Windows.Forms.Padding(10, 70, 10, 9); this.monoFlat_ThemeContainer1.RoundCorners = true; this.monoFlat_ThemeContainer1.Sizable = true; this.monoFlat_ThemeContainer1.Size = new System.Drawing.Size(393, 529); this.monoFlat_ThemeContainer1.SmartBounds = true; this.monoFlat_ThemeContainer1.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation; this.monoFlat_ThemeContainer1.TabIndex = 0; this.monoFlat_ThemeContainer1.Text = "XProtect - Portable"; // // monoFlat_ControlBox1 // this.monoFlat_ControlBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.monoFlat_ControlBox1.EnableHoverHighlight = true; this.monoFlat_ControlBox1.EnableMaximizeButton = false; this.monoFlat_ControlBox1.EnableMinimizeButton = true; this.monoFlat_ControlBox1.Location = new System.Drawing.Point(281, 15); this.monoFlat_ControlBox1.Name = "monoFlat_ControlBox1"; this.monoFlat_ControlBox1.Size = new System.Drawing.Size(100, 25); this.monoFlat_ControlBox1.TabIndex = 22; this.monoFlat_ControlBox1.Text = "monoFlat_ControlBox1"; // // txtLog // this.txtLog.BackColor = System.Drawing.Color.White; this.txtLog.ForeColor = System.Drawing.SystemColors.ControlDarkDark; this.txtLog.Location = new System.Drawing.Point(12, 73); this.txtLog.Multiline = true; this.txtLog.Name = "txtLog"; this.txtLog.ReadOnly = true; this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.txtLog.Size = new System.Drawing.Size(369, 201); this.txtLog.TabIndex = 20; this.txtLog.Text = "XProtector - Portable\r\n\r\n------------------------------------------\r\nProgram star" + "ted\r\n"; // // button3 // this.button3.BackColor = System.Drawing.Color.Transparent; this.button3.Font = new System.Drawing.Font("Segoe UI", 12F); this.button3.Image = null; this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button3.Location = new System.Drawing.Point(290, 302); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(91, 41); this.button3.TabIndex = 19; this.button3.Text = "Browse ..."; this.button3.TextAlignment = System.Drawing.StringAlignment.Center; this.button3.Click += new System.EventHandler(this.button3_Click); // // button2 // this.button2.BackColor = System.Drawing.Color.Transparent; this.button2.Font = new System.Drawing.Font("Segoe UI", 12F); this.button2.Image = null; this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button2.Location = new System.Drawing.Point(12, 477); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(366, 40); this.button2.TabIndex = 18; this.button2.Text = "Decrypt"; this.button2.TextAlignment = System.Drawing.StringAlignment.Center; this.button2.Click += new System.EventHandler(this.button2_Click); // // checkBox1 // this.checkBox1.Checked = false; this.checkBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.checkBox1.Location = new System.Drawing.Point(150, 446); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(153, 16); this.checkBox1.TabIndex = 17; this.checkBox1.Text = "Open folder when done"; this.checkBox1.CheckedChanged += new MonoFlat.MonoFlat_CheckBox.CheckedChangedEventHandler(this.checkBox1_CheckedChanged); // // cboxOverwrite // this.cboxOverwrite.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboxOverwrite.FormattingEnabled = true; this.cboxOverwrite.Items.AddRange(new object[] { "Ask", "Force", "None"}); this.cboxOverwrite.Location = new System.Drawing.Point(12, 444); this.cboxOverwrite.Name = "cboxOverwrite"; this.cboxOverwrite.Size = new System.Drawing.Size(121, 22); this.cboxOverwrite.TabIndex = 16; this.cboxOverwrite.SelectedIndexChanged += new System.EventHandler(this.cboxOverwrite_SelectedIndexChanged); // // label3 // this.label3.AutoSize = true; this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("Segoe UI", 9F); this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(116)))), ((int)(((byte)(125)))), ((int)(((byte)(132))))); this.label3.Location = new System.Drawing.Point(9, 426); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(93, 15); this.label3.TabIndex = 15; this.label3.Text = "Overwrite Policy"; // // txtPassword // this.txtPassword.BackColor = System.Drawing.Color.Transparent; this.txtPassword.Font = new System.Drawing.Font("Tahoma", 11F); this.txtPassword.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(176)))), ((int)(((byte)(183)))), ((int)(((byte)(191))))); this.txtPassword.Image = null; this.txtPassword.Location = new System.Drawing.Point(12, 372); this.txtPassword.MaxLength = 32767; this.txtPassword.Multiline = false; this.txtPassword.Name = "txtPassword"; this.txtPassword.ReadOnly = false; this.txtPassword.Size = new System.Drawing.Size(366, 41); this.txtPassword.TabIndex = 14; this.txtPassword.TextAlignment = System.Windows.Forms.HorizontalAlignment.Left; this.txtPassword.UseSystemPasswordChar = true; // // label2 // this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("Segoe UI", 9F); this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(116)))), ((int)(((byte)(125)))), ((int)(((byte)(132))))); this.label2.Location = new System.Drawing.Point(12, 354); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(60, 15); this.label2.TabIndex = 13; this.label2.Text = "Password:"******"Tahoma", 11F); this.txtLocation.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(176)))), ((int)(((byte)(183)))), ((int)(((byte)(191))))); this.txtLocation.Image = null; this.txtLocation.Location = new System.Drawing.Point(12, 302); this.txtLocation.MaxLength = 32767; this.txtLocation.Multiline = false; this.txtLocation.Name = "txtLocation"; this.txtLocation.ReadOnly = true; this.txtLocation.Size = new System.Drawing.Size(272, 41); this.txtLocation.TabIndex = 12; this.txtLocation.TextAlignment = System.Windows.Forms.HorizontalAlignment.Left; this.txtLocation.UseSystemPasswordChar = false; // // label1 // this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("Segoe UI", 9F); this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(116)))), ((int)(((byte)(125)))), ((int)(((byte)(132))))); this.label1.Location = new System.Drawing.Point(9, 283); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(167, 15); this.label1.TabIndex = 11; this.label1.Text = "Extract the decrypted file(s) to:"; // // Form1 // this.ClientSize = new System.Drawing.Size(393, 529); this.Controls.Add(this.monoFlat_ThemeContainer1); this.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.KeyPreview = true; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "Form1"; this.Text = "XProtect - Portable"; this.TransparencyKey = System.Drawing.Color.Fuchsia; this.Load += new System.EventHandler(this.Form1_Load); this.Shown += new System.EventHandler(this.Form1_Shown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); this.monoFlat_ThemeContainer1.ResumeLayout(false); this.monoFlat_ThemeContainer1.PerformLayout(); this.ResumeLayout(false); }