mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
optimized the way of testing adb port
This commit is contained in:
@@ -1140,8 +1140,10 @@ namespace MaaWpfGui.Main
|
||||
return false;
|
||||
}
|
||||
|
||||
string[] address_ = address.Split(':');
|
||||
string host = address_[0];
|
||||
// normal -> [host]:[port]
|
||||
// LDPlayer -> emulator-[port]
|
||||
string[] address_ = address.Contains(":") ? address.Split(':') : address.Split('-');
|
||||
string host = address_[0].Equals("emulator") ? "127.0.0.1" : address_[0];
|
||||
int port = int.Parse(address_[1]);
|
||||
|
||||
using (var client = new TcpClient())
|
||||
|
||||
@@ -2543,6 +2543,12 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
/// <returns>path</returns>
|
||||
public static string GetBluestacksConfig()
|
||||
{
|
||||
var conf = ConfigurationHelper.GetValue(ConfigurationKeys.BluestacksConfigPath, string.Empty);
|
||||
if (!string.IsNullOrEmpty(conf))
|
||||
{
|
||||
return conf;
|
||||
}
|
||||
|
||||
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(BluestacksNxtRegistryKey))
|
||||
{
|
||||
if (key != null)
|
||||
@@ -2555,12 +2561,6 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
}
|
||||
|
||||
var conf = ConfigurationHelper.GetValue(ConfigurationKeys.BluestacksConfigPath, string.Empty);
|
||||
if (!string.IsNullOrEmpty(conf))
|
||||
{
|
||||
return conf;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user