From a7b0f50eb40ed8d7760c8507afbaf2c5409ab999 Mon Sep 17 00:00:00 2001 From: mujianwu Date: Wed, 30 Oct 2024 16:55:05 +0800 Subject: [PATCH] Update StringHelper.cs --- UotanToolbox/Common/StringHelper.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/UotanToolbox/Common/StringHelper.cs b/UotanToolbox/Common/StringHelper.cs index e7633d8..676e05d 100644 --- a/UotanToolbox/Common/StringHelper.cs +++ b/UotanToolbox/Common/StringHelper.cs @@ -58,7 +58,7 @@ public static string[] FastbootDevices(string FastbootInfo) public static string[] HDCDevices(string HDCInfo) { string[] devices = HDCInfo.Split(separator, StringSplitOptions.RemoveEmptyEntries); - devices = devices.Where(s => !String.IsNullOrEmpty(s) && !s.Contains("[Empty]")).ToArray(); + devices = devices.Where(s => !String.IsNullOrEmpty(s) && !s.Contains("[Empty]") && !s.Contains("FreeChannelContinue")).ToArray(); return devices; } @@ -193,7 +193,11 @@ public static string RemoveLineFeed(string str) { string[] lines = str.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); string result = string.Concat(lines); - return string.IsNullOrEmpty(result) || result.Contains("not found") || result.Contains("dialog on your device") || result.Contains("device offline") || result.Contains("closed") + if (result.Contains("FreeChannelContinue")) + { + result = lines[0]; + } + return string.IsNullOrEmpty(result) || result.Contains("not found") || result.Contains("dialog on your device") || result.Contains("device offline") || result.Contains("closed") || result.Contains("fail!") ? "--" : result; }