From 852a3a845a6a482ed7d7791eeed0712cc439d7e0 Mon Sep 17 00:00:00 2001 From: LeddaZ Date: Sun, 12 Jan 2020 22:43:09 +0100 Subject: [PATCH] v14 update --- src/ADBManager/fastboot.Designer.vb | 30 ++++++++++++++++++-- src/ADBManager/fastboot.vb | 44 ++++++++++++++++++++++++++--- src/ADBManager/main.Designer.vb | 36 +++++++++++++++++++---- src/ADBManager/main.resx | 3 -- src/ADBManager/main.vb | 32 ++++++++++++++++++++- 5 files changed, 130 insertions(+), 15 deletions(-) diff --git a/src/ADBManager/fastboot.Designer.vb b/src/ADBManager/fastboot.Designer.vb index 17f38e9..e1c504d 100644 --- a/src/ADBManager/fastboot.Designer.vb +++ b/src/ADBManager/fastboot.Designer.vb @@ -33,6 +33,8 @@ Partial Class fastboot Me.BtnBootloader = New System.Windows.Forms.Button() Me.LblVer = New System.Windows.Forms.Label() Me.BtnFReboot = New System.Windows.Forms.Button() + Me.BtnFlashRecovery = New System.Windows.Forms.Button() + Me.BtnBootImage = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'BtnTheme @@ -140,24 +142,46 @@ Partial Class fastboot Me.LblVer.Name = "LblVer" Me.LblVer.Size = New System.Drawing.Size(36, 21) Me.LblVer.TabIndex = 35 - Me.LblVer.Text = "v13" + Me.LblVer.Text = "v14" ' 'BtnFReboot ' Me.BtnFReboot.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.BtnFReboot.Location = New System.Drawing.Point(233, 104) + Me.BtnFReboot.Location = New System.Drawing.Point(11, 165) Me.BtnFReboot.Name = "BtnFReboot" Me.BtnFReboot.Size = New System.Drawing.Size(105, 55) Me.BtnFReboot.TabIndex = 36 Me.BtnFReboot.Text = "Reboot" Me.BtnFReboot.UseVisualStyleBackColor = True ' + 'BtnFlashRecovery + ' + Me.BtnFlashRecovery.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.BtnFlashRecovery.Location = New System.Drawing.Point(233, 104) + Me.BtnFlashRecovery.Name = "BtnFlashRecovery" + Me.BtnFlashRecovery.Size = New System.Drawing.Size(105, 55) + Me.BtnFlashRecovery.TabIndex = 37 + Me.BtnFlashRecovery.Text = "Flash a recovery image" + Me.BtnFlashRecovery.UseVisualStyleBackColor = True + ' + 'BtnBootImage + ' + Me.BtnBootImage.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.BtnBootImage.Location = New System.Drawing.Point(344, 104) + Me.BtnBootImage.Name = "BtnBootImage" + Me.BtnBootImage.Size = New System.Drawing.Size(105, 55) + Me.BtnBootImage.TabIndex = 38 + Me.BtnBootImage.Text = "Boot an image" + Me.BtnBootImage.UseVisualStyleBackColor = True + ' 'fastboot ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.Black Me.ClientSize = New System.Drawing.Size(459, 267) + Me.Controls.Add(Me.BtnBootImage) + Me.Controls.Add(Me.BtnFlashRecovery) Me.Controls.Add(Me.BtnFReboot) Me.Controls.Add(Me.LblVer) Me.Controls.Add(Me.BtnBootloader) @@ -186,4 +210,6 @@ Partial Class fastboot Friend WithEvents BtnBootloader As Button Friend WithEvents LblVer As Label Friend WithEvents BtnFReboot As Button + Friend WithEvents BtnFlashRecovery As Button + Friend WithEvents BtnBootImage As Button End Class diff --git a/src/ADBManager/fastboot.vb b/src/ADBManager/fastboot.vb index 82b17ad..db0f032 100644 --- a/src/ADBManager/fastboot.vb +++ b/src/ADBManager/fastboot.vb @@ -53,14 +53,50 @@ End Sub Private Sub BtnFReboot_Click(sender As Object, e As EventArgs) Handles BtnFReboot.Click - Dim adb As New Process - Dim adbinfo As New System.Diagnostics.ProcessStartInfo With { + Dim fastboot As New Process + Dim fastbootinfo As New System.Diagnostics.ProcessStartInfo With { .FileName = "cmd.exe", .UseShellExecute = True, .CreateNoWindow = False, .Arguments = "/c fastboot reboot && pause" } - adb.StartInfo = adbinfo - adb.Start() + fastboot.StartInfo = fastbootinfo + fastboot.Start() + End Sub + + Private Sub BtnFlashRecovery_Click(sender As Object, e As EventArgs) Handles BtnFlashRecovery.Click + Dim img As String + img = InputBox("Enter the recovery image path", "Flash a recovery image") + If img = Nothing Then + MsgBox("You have entered an empty path.", MsgBoxStyle.Critical, "Error") + Else + Dim fastboot As New Process + Dim fastbootinfo As New System.Diagnostics.ProcessStartInfo With { + .FileName = "cmd.exe", + .UseShellExecute = True, + .CreateNoWindow = False, + .Arguments = "/c fastboot flash recovery " + img + " && pause" + } + fastboot.StartInfo = fastbootinfo + fastboot.Start() + End If + End Sub + + Private Sub BtnBootImage_Click(sender As Object, e As EventArgs) Handles BtnBootImage.Click + Dim boot As String + boot = InputBox("Enter the image path", "Boot an image") + If boot = Nothing Then + MsgBox("You have entered an empty path.", MsgBoxStyle.Critical, "Error") + Else + Dim fastboot As New Process + Dim fastbootinfo As New System.Diagnostics.ProcessStartInfo With { + .FileName = "cmd.exe", + .UseShellExecute = True, + .CreateNoWindow = False, + .Arguments = "/c fastboot boot " + boot + " && pause" + } + fastboot.StartInfo = fastbootinfo + fastboot.Start() + End If End Sub End Class \ No newline at end of file diff --git a/src/ADBManager/main.Designer.vb b/src/ADBManager/main.Designer.vb index 0242579..c61c678 100644 --- a/src/ADBManager/main.Designer.vb +++ b/src/ADBManager/main.Designer.vb @@ -40,6 +40,8 @@ Partial Class main Me.BtnFastbootSwitch = New System.Windows.Forms.Button() Me.LblVer = New System.Windows.Forms.Label() Me.BtnInstall = New System.Windows.Forms.Button() + Me.BtnKillServer = New System.Windows.Forms.Button() + Me.BtnLogcat = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'LblTitle @@ -108,9 +110,9 @@ Partial Class main 'BtnNetwork ' Me.BtnNetwork.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.BtnNetwork.Location = New System.Drawing.Point(345, 103) + Me.BtnNetwork.Location = New System.Drawing.Point(234, 164) Me.BtnNetwork.Name = "BtnNetwork" - Me.BtnNetwork.Size = New System.Drawing.Size(103, 55) + Me.BtnNetwork.Size = New System.Drawing.Size(105, 55) Me.BtnNetwork.TabIndex = 7 Me.BtnNetwork.Text = "Connect over network" Me.BtnNetwork.UseVisualStyleBackColor = True @@ -120,7 +122,7 @@ Partial Class main Me.BtnDisconnect.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.BtnDisconnect.Location = New System.Drawing.Point(345, 164) Me.BtnDisconnect.Name = "BtnDisconnect" - Me.BtnDisconnect.Size = New System.Drawing.Size(103, 55) + Me.BtnDisconnect.Size = New System.Drawing.Size(105, 55) Me.BtnDisconnect.TabIndex = 8 Me.BtnDisconnect.Text = "Disconnect from network" Me.BtnDisconnect.UseVisualStyleBackColor = True @@ -148,7 +150,7 @@ Partial Class main 'BtnRecord ' Me.BtnRecord.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.BtnRecord.Location = New System.Drawing.Point(234, 164) + Me.BtnRecord.Location = New System.Drawing.Point(345, 103) Me.BtnRecord.Name = "BtnRecord" Me.BtnRecord.Size = New System.Drawing.Size(105, 55) Me.BtnRecord.TabIndex = 12 @@ -207,7 +209,7 @@ Partial Class main Me.LblVer.Name = "LblVer" Me.LblVer.Size = New System.Drawing.Size(36, 21) Me.LblVer.TabIndex = 17 - Me.LblVer.Text = "v13" + Me.LblVer.Text = "v14" ' 'BtnInstall ' @@ -219,12 +221,34 @@ Partial Class main Me.BtnInstall.Text = "Install APK file" Me.BtnInstall.UseVisualStyleBackColor = True ' + 'BtnKillServer + ' + Me.BtnKillServer.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.BtnKillServer.Location = New System.Drawing.Point(123, 225) + Me.BtnKillServer.Name = "BtnKillServer" + Me.BtnKillServer.Size = New System.Drawing.Size(105, 55) + Me.BtnKillServer.TabIndex = 19 + Me.BtnKillServer.Text = "Terminate ADB" + Me.BtnKillServer.UseVisualStyleBackColor = True + ' + 'BtnLogcat + ' + Me.BtnLogcat.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.BtnLogcat.Location = New System.Drawing.Point(234, 225) + Me.BtnLogcat.Name = "BtnLogcat" + Me.BtnLogcat.Size = New System.Drawing.Size(105, 55) + Me.BtnLogcat.TabIndex = 20 + Me.BtnLogcat.Text = "Grab a logcat" + Me.BtnLogcat.UseVisualStyleBackColor = True + ' 'main ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.Black Me.ClientSize = New System.Drawing.Size(459, 336) + Me.Controls.Add(Me.BtnLogcat) + Me.Controls.Add(Me.BtnKillServer) Me.Controls.Add(Me.BtnInstall) Me.Controls.Add(Me.LblVer) Me.Controls.Add(Me.BtnFastbootSwitch) @@ -268,4 +292,6 @@ Partial Class main Friend WithEvents BtnFastbootSwitch As Button Friend WithEvents LblVer As Label Friend WithEvents BtnInstall As Button + Friend WithEvents BtnKillServer As Button + Friend WithEvents BtnLogcat As Button End Class diff --git a/src/ADBManager/main.resx b/src/ADBManager/main.resx index 5aa25bf..5455b6a 100644 --- a/src/ADBManager/main.resx +++ b/src/ADBManager/main.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - True diff --git a/src/ADBManager/main.vb b/src/ADBManager/main.vb index f77ac0d..dbb52ad 100644 --- a/src/ADBManager/main.vb +++ b/src/ADBManager/main.vb @@ -100,7 +100,7 @@ Private Sub BtnRecord_Click(sender As Object, e As EventArgs) Handles BtnRecord.Click Dim name As String - name = InputBox("Enter the filename", "Record screen") + name = InputBox("Enter the filename without the extension", "Record screen") If name = Nothing Then MsgBox("You have entered an empty filename.", MsgBoxStyle.Critical, "Error") Else @@ -169,4 +169,34 @@ adb.Start() End If End Sub + + Private Sub BtnKillServer_Click(sender As Object, e As EventArgs) Handles BtnKillServer.Click + Dim adb As New Process + Dim adbinfo As New System.Diagnostics.ProcessStartInfo With { + .FileName = "cmd.exe", + .UseShellExecute = True, + .CreateNoWindow = False, + .Arguments = "/c adb kill-server && pause" + } + adb.StartInfo = adbinfo + adb.Start() + End Sub + + Private Sub BtnLogcat_Click(sender As Object, e As EventArgs) Handles BtnLogcat.Click + Dim log As String + log = InputBox("Enter the logcat filename without the extension. Press Ctrl+C to stop.", "Grab a logcat") + If log = Nothing Then + MsgBox("You have entered an empty filename.", MsgBoxStyle.Critical, "Error") + Else + Dim adb As New Process + Dim adbinfo As New System.Diagnostics.ProcessStartInfo With { + .FileName = "cmd.exe", + .UseShellExecute = True, + .CreateNoWindow = False, + .Arguments = "/c adb logcat > " + log + ".txt" + } + adb.StartInfo = adbinfo + adb.Start() + End If + End Sub End Class