Skip to content

Commit

Permalink
Update StringHelper.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mujianwu committed Oct 30, 2024
1 parent 4db72c8 commit a7b0f50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions UotanToolbox/Common/StringHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a7b0f50

Please sign in to comment.