From a3ba8803ea6833844aadb01acd2faffc55ad4f6a Mon Sep 17 00:00:00 2001 From: MistEO Date: Tue, 31 May 2022 00:40:23 +0800 Subject: [PATCH] =?UTF-8?q?fix.=E4=BF=AE=E5=A4=8DHyperV=E5=B0=8F=E5=90=8E?= =?UTF-8?q?=E9=97=A8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/模拟器支持.md | 8 ++++---- src/MeoAsstGui/Helper/AsstProxy.cs | 1 + src/MeoAsstGui/ViewModels/SettingsViewModel.cs | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/模拟器支持.md b/docs/模拟器支持.md index 663b571d35..370db8259f 100644 --- a/docs/模拟器支持.md +++ b/docs/模拟器支持.md @@ -14,10 +14,10 @@ - 在模拟器 `设定` - `进阶` 中打开 `Android调试桥` - 由于蓝叠 Hyper-V 的端口号在不断变动,所以留了个专用的小后门: - - 开启一次 MAA,会在同目录下生成 `gui.json` 文件 - - 在蓝叠模拟器的安装目录下找到 `bluestacks.conf` 这个文件 - - 将 `bluestacks.conf` 的完整路径 填入 `gui.json` - `Bluestacks.Config.Path` 的值,保存文件 - - 重启 MAA, 会自动获取当次的 adb 地址 + 1. 在蓝叠模拟器的安装目录下找到 `bluestacks.conf` 这个文件 + 2. 开启 MAA,会在同目录下生成 `gui.json` ,打开它 + 3. 新增一个字段 `Bluestacks.Config.Path`,填入 `bluestacks.conf` 的完整路径 + 4. LinkStart! ### 夜神模拟器 diff --git a/src/MeoAsstGui/Helper/AsstProxy.cs b/src/MeoAsstGui/Helper/AsstProxy.cs index 353eaea114..c183532c90 100644 --- a/src/MeoAsstGui/Helper/AsstProxy.cs +++ b/src/MeoAsstGui/Helper/AsstProxy.cs @@ -608,6 +608,7 @@ namespace MeoAsstGui return false; } } + settings.TryToSetBlueStacksHyperVAddress(); if (settings.AdbPath.Length == 0) { error = "请选择 adb 路径"; diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs index 1e5a93d787..5f4ca9e3ef 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs @@ -57,7 +57,6 @@ namespace MeoAsstGui InfrastInit(); ToastPositionInit(); - TryToSetBlueStacksHyperVAddress(); } private List _listTitle = new List(); @@ -1011,6 +1010,8 @@ namespace MeoAsstGui ConnectConfig = emulators.First(); AdbPath = adapter.GetAdbPathByEmulatorName(ConnectConfig) ?? AdbPath; UpdateAddressByConfig(); + TryToSetBlueStacksHyperVAddress(); + return true; } @@ -1048,7 +1049,6 @@ namespace MeoAsstGui { if (bluestacksConfig.Length == 0) { - ViewStatusStorage.Set("Bluestacks.Config.Path", ""); return; } if (!File.Exists(bluestacksConfig))