From 4747fd2daf92694bc9d62af3df820cd417b955ed Mon Sep 17 00:00:00 2001
From: mjsoftware <1406993111@qq.com>
Date: Tue, 11 Mar 2025 14:35:49 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E6=81=A2=E5=A4=8D?=
=?UTF-8?q?=E9=BB=98=E8=AE=A4TCP=E7=AB=AF=E5=8F=A3(5555)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
AdbTools/MainWindow.xaml | 1 +
AdbTools/MainWindow.xaml.cs | 21 +++++++++++++++++++++
AdbTools/Properties/AssemblyInfo.cs | 4 ++--
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/AdbTools/MainWindow.xaml b/AdbTools/MainWindow.xaml
index c7a4807..9849ce3 100644
--- a/AdbTools/MainWindow.xaml
+++ b/AdbTools/MainWindow.xaml
@@ -17,6 +17,7 @@
diff --git a/AdbTools/MainWindow.xaml.cs b/AdbTools/MainWindow.xaml.cs
index a2aaf2b..3a671cf 100644
--- a/AdbTools/MainWindow.xaml.cs
+++ b/AdbTools/MainWindow.xaml.cs
@@ -424,6 +424,27 @@ namespace AdbTools
Timer_Tick(null, null);
}
+ private void resetPortItem_Click(object sender, RoutedEventArgs e)
+ {
+ int index = deviceList.SelectedIndex;
+ Device device = deviceAddressList[index];
+ if (MessageBoxResult.OK == MessageBox.Show($"确定要对设备【{device.ShowDeviceName}】执行【恢复默认TCP端口(5555)】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
+ {
+ waitAnimation(true);
+ CmdExecutor.ExecuteCommandAndReturnAsync(new string[] { $"{adbPath} -s {device.DeviceMark} tcpip 5555 " }, result =>
+ {
+ waitAnimation(false);
+ MessageBox.Show($"设备【{device.ShowDeviceName}】恢复默认TCP端口(5555)成功", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
+ },
+ err =>
+ {
+ waitAnimation(false);
+ MessageBox.Show($"设备【{device.ShowDeviceName}】恢复默认TCP端口(5555)失败!\r\n检查设备是否已离线。", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return true;
+ });
+ }
+ }
+
private void resetPXItem_Click(object sender, RoutedEventArgs e)
{
int index = deviceList.SelectedIndex;
diff --git a/AdbTools/Properties/AssemblyInfo.cs b/AdbTools/Properties/AssemblyInfo.cs
index 719fe42..8d0e6f2 100644
--- a/AdbTools/Properties/AssemblyInfo.cs
+++ b/AdbTools/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.1")]
-[assembly: AssemblyFileVersion("1.1.1")]
+[assembly: AssemblyVersion("1.1.2")]
+[assembly: AssemblyFileVersion("1.1.2")]