From fd97f7e2015030f949205836085168a0775f4f7f Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 27 Nov 2022 21:38:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Emaatouch=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/minitouch/maatouch/minitouch | Bin 0 -> 10891 bytes resource/config.json | 41 ++++++++++++++---- src/MeoAssistant/AsstCaller.cpp | 8 ++-- src/MeoAssistant/Controller.cpp | 5 +-- .../Resources/Localizations/en-us.xaml | 1 + .../Resources/Localizations/zh-cn.xaml | 1 + .../ViewModels/SettingsViewModel.cs | 1 + 7 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 3rdparty/resource/minitouch/maatouch/minitouch diff --git a/3rdparty/resource/minitouch/maatouch/minitouch b/3rdparty/resource/minitouch/maatouch/minitouch new file mode 100644 index 0000000000000000000000000000000000000000..02db3af473258fae9a24f29079f3da32ca3c5460 GIT binary patch literal 10891 zcmbVyWl)^YvN!DF?g4^?;2zu^f=h6h;7)K|SO~#g7KflAcyQkYcUjz>;O_SFKetZZ zdr#d@?@V=7&(q!0Jv}{N`uV9T0ukU|2MQb&3Kakm4$YeDb;bWm0(^1*HLb%zj4YvEdN;%mWf2Asn3A|B58o zx<=2G4i0Wh84eEpH4<|NGdDL&H#Q4P?;d|Y|3%r9lk{9;Q2(#TT6`f;_pif375v3t z+1%K>W__yj=hO{{Q(xYtIMQlUD@M}nPN<_eQWX&}DB7YQN$Tl0c!ALk70{QC)pb*k z07HNyOLPL8?~3SkI5uWxsP3KCRy0Eqi@ySm9xkrZ1>AN#c81frI&;hKPWJ#N54;)A z<0HUO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r5@H6e*d>s+;p+aSml8I^BIiB4xE zi$>R8sXyL+y7V=3wxV+933HTjOxee&g~0wO9iVgby=zB-JCsK z&0n#HX0C4L062_)NnQnT@Ni_W^M8!jGWqvfO%Wad2mD9&eVhx`A=S^lS+ z|AbBcx0}dU_J4pV|7G|u>3_xdpJo1U!`Gsx|38cVzc={5)ArvRATa)C64ewDk^Ye* PyiW3e-qx!I9Nhl{#k}AS literal 0 HcmV?d00001 diff --git a/resource/config.json b/resource/config.json index 495ad341d0..c5b4b1f20e 100644 --- a/resource/config.json +++ b/resource/config.json @@ -60,7 +60,7 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", @@ -83,7 +83,7 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", @@ -106,7 +106,7 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", @@ -129,7 +129,7 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", @@ -152,7 +152,7 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", @@ -175,7 +175,7 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", @@ -199,7 +199,7 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", @@ -222,7 +222,7 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", @@ -245,11 +245,34 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" + }, + "MaaTouch": { + "devices": "[Adb] devices", + "addressRegex": "(.+)\tdevice", + "connect": "[Adb] connect [AdbSerial]", + "uuid": "[Adb] -s [AdbSerial] shell settings get secure android_id", + "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", + "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", + "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", + "displayFormat": "%d%d", + "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", + "ncAddress": "[Adb] -s [AdbSerial] shell \" cat /proc/net/arp | grep : \"", + "ncPort": 6723, + "screencapRawWithGzip": "[Adb] -s [AdbSerial] exec-out \"screencap | gzip -1\"", + "screencapEncode": "[Adb] -s [AdbSerial] exec-out screencap -p", + "release": "[Adb] kill-server", + "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", + "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", + "abilist": "[Adb] -s [AdbSerial] shell echo maatouch", + "orientation": "[Adb] -s [AdbSerial] shell echo 0", + "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", + "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", + "callMinitouch": "[Adb] -s [AdbSerial] shell \"export CLASSPATH=/data/local/tmp/[minitouchWorkingFile]; app_process /data/local/tmp com.shxyke.MaaTouch.App\"" } } } diff --git a/src/MeoAssistant/AsstCaller.cpp b/src/MeoAssistant/AsstCaller.cpp index f55ad3c724..9ecf58ad65 100644 --- a/src/MeoAssistant/AsstCaller.cpp +++ b/src/MeoAssistant/AsstCaller.cpp @@ -48,15 +48,17 @@ bool AsstSetUserDir(const char* path) bool AsstLoadResource(const char* path) { + using namespace asst::utils::path_literals; + auto os_path = asst::utils::path(path); + auto res_path = os_path / "resource"_p; if (asst::ResDir.empty()) { - asst::ResDir.set(os_path); + asst::ResDir.set(res_path); } if (asst::UserDir.empty()) { asst::UserDir.set(os_path); } - using namespace asst::utils::path_literals; - inited = asst::ResourceLoader::get_instance().load(os_path / "resource"_p); + inited = asst::ResourceLoader::get_instance().load(res_path); return inited; } diff --git a/src/MeoAssistant/Controller.cpp b/src/MeoAssistant/Controller.cpp index e2c2bd1cef..28a1f6e841 100644 --- a/src/MeoAssistant/Controller.cpp +++ b/src/MeoAssistant/Controller.cpp @@ -1507,9 +1507,8 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a } std::string abilist = call_command(cmd_replace(adb_cfg.abilist)).value_or(""); - constexpr std::array OrderedABI = { - "x86_64", "x86", "arm64-v8a", "armeabi-v7a", "armeabi", - }; + constexpr std::array OrderedABI = { "x86_64", "x86", "arm64-v8a", + "armeabi-v7a", "armeabi", "maatouch" }; std::string_view optimal_abi = "armeabi-v7a"; for (const auto& abi : OrderedABI) { if (abilist.find(abi) != std::string::npos) { diff --git a/src/MeoAsstGui/Resources/Localizations/en-us.xaml b/src/MeoAsstGui/Resources/Localizations/en-us.xaml index 99800e578e..22e27bc77e 100644 --- a/src/MeoAsstGui/Resources/Localizations/en-us.xaml +++ b/src/MeoAsstGui/Resources/Localizations/en-us.xaml @@ -60,6 +60,7 @@ Nox XYAZ Old version of WSA + MaaTouch Compatible Mode Morale Threshold diff --git a/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml b/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml index 26d59fc0f7..1d45adb250 100644 --- a/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml +++ b/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml @@ -60,6 +60,7 @@ 夜神模拟器 逍遥模拟器 WSA 旧版本 + MaaTouch 兼容模式 基建工作心情阈值 diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs index 4c59a035b8..a4ebf9cc10 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs @@ -176,6 +176,7 @@ namespace MeoAsstGui new CombData { Display = Localization.GetString("Nox"), Value = "Nox" }, new CombData { Display = Localization.GetString("XYAZ"), Value = "XYAZ" }, new CombData { Display = Localization.GetString("WSA"), Value = "WSA" }, + new CombData { Display = Localization.GetString("MaaTouch"), Value = "MaaTouch" }, new CombData { Display = Localization.GetString("Compatible"), Value = "Compatible" }, }; From d10034da02cb374cff8cf35b7eb5d69292981c48 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 27 Nov 2022 23:18:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84minitouch?= =?UTF-8?q?=E7=9A=84=E9=80=89=E6=8B=A9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/config.json | 8 +++ src/MeoAssistant/Controller.cpp | 66 ++++++++++--------- src/MeoAssistant/Resource/GeneralConfiger.cpp | 5 ++ src/MeoAssistant/Resource/GeneralConfiger.h | 1 + 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/resource/config.json b/resource/config.json index c5b4b1f20e..ec88e08523 100644 --- a/resource/config.json +++ b/resource/config.json @@ -16,6 +16,14 @@ "adbSwipeDurationMultiplier_Doc": "adb 滑动延迟倍数", "minitouchExtraSwipeDist": 100, "minitouchExtraSwipeDuration": 200, + "minitouchProgramsOrder": [ + "x86_64", + "x86", + "arm64-v8a", + "armeabi-v7a", + "armeabi", + "maatouch" + ], "penguinReport": { "Doc": "企鹅物流汇报: https://penguin-stats.cn/", "cmdFormat": "curl -H \"Content-Type: application/json\" -s -S -m 10 -i -d \"[body]\" \"https://penguin-stats.io/PenguinStats/api/v2/report\" --ssl-no-revoke [extra]", diff --git a/src/MeoAssistant/Controller.cpp b/src/MeoAssistant/Controller.cpp index 28a1f6e841..cfdf3ec1af 100644 --- a/src/MeoAssistant/Controller.cpp +++ b/src/MeoAssistant/Controller.cpp @@ -456,7 +456,6 @@ bool asst::Controller::call_and_hup_minitouch(const std::string& cmd) release_minitouch(true); Log.info(cmd); - m_minitouch_avaiable = false; constexpr int PipeReadBuffSize = 4096ULL; constexpr int PipeWriteBuffSize = 64 * 1024ULL; @@ -639,7 +638,6 @@ bool asst::Controller::call_and_hup_minitouch(const std::string& cmd) m_minitouch_props.x_scaling = static_cast(m_minitouch_props.max_x) / m_width; m_minitouch_props.y_scaling = static_cast(m_minitouch_props.max_y) / m_height; - m_minitouch_avaiable = true; return true; } @@ -1506,42 +1504,46 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a return false; } - std::string abilist = call_command(cmd_replace(adb_cfg.abilist)).value_or(""); - constexpr std::array OrderedABI = { "x86_64", "x86", "arm64-v8a", - "armeabi-v7a", "armeabi", "maatouch" }; - std::string_view optimal_abi = "armeabi-v7a"; - for (const auto& abi : OrderedABI) { - if (abilist.find(abi) != std::string::npos) { - optimal_abi = abi; - break; + do { + m_minitouch_avaiable = false; + + std::string abilist = call_command(cmd_replace(adb_cfg.abilist)).value_or("maatouch"); + std::string_view optimal_abi; + for (const auto& abi : Config.get_options().minitouch_programs_order) { + if (abilist.find(abi) != std::string::npos) { + optimal_abi = abi; + break; + } } - } - Log.info("The optimal abi is", optimal_abi); + Log.info("The optimal abi is", optimal_abi); - auto minitouch_cmd_rep = [&](const std::string& cfg_cmd) -> std::string { - using namespace asst::utils::path_literals; - return utils::string_replace_all( - cmd_replace(cfg_cmd), - { - { "[minitouchLocalPath]", - utils::path_to_utf8_string(ResDir.get() / "minitouch"_p / optimal_abi / "minitouch"_p) }, - { "[minitouchWorkingFile]", m_uuid }, - }); - }; + auto minitouch_cmd_rep = [&](const std::string& cfg_cmd) -> std::string { + using namespace asst::utils::path_literals; + return utils::string_replace_all( + cmd_replace(cfg_cmd), + { + { "[minitouchLocalPath]", + utils::path_to_utf8_string(ResDir.get() / "minitouch"_p / optimal_abi / "minitouch"_p) }, + { "[minitouchWorkingFile]", m_uuid }, + }); + }; - call_command(minitouch_cmd_rep(adb_cfg.push_minitouch)); - call_command(minitouch_cmd_rep(adb_cfg.chmod_minitouch)); + if (!call_command(minitouch_cmd_rep(adb_cfg.push_minitouch))) break; + if (!call_command(minitouch_cmd_rep(adb_cfg.chmod_minitouch))) break; - m_adb.call_minitouch = minitouch_cmd_rep(adb_cfg.call_minitouch); - call_and_hup_minitouch(m_adb.call_minitouch); + m_adb.call_minitouch = minitouch_cmd_rep(adb_cfg.call_minitouch); + if (!call_and_hup_minitouch(m_adb.call_minitouch)) break; - std::string orientation_str = call_command(cmd_replace(adb_cfg.orientation)).value_or("0"); - if (!orientation_str.empty()) { - char first = orientation_str.front(); - if (first == '0' || first == '1' || first == '2' || first == '3') { - m_minitouch_props.orientation = static_cast(first - '0'); + std::string orientation_str = call_command(cmd_replace(adb_cfg.orientation)).value_or("0"); + if (!orientation_str.empty()) { + char first = orientation_str.front(); + if (first == '0' || first == '1' || first == '2' || first == '3') { + m_minitouch_props.orientation = static_cast(first - '0'); + } } - } + + m_minitouch_avaiable = true; + } while (false); // try to find the fastest way if (!screencap()) { diff --git a/src/MeoAssistant/Resource/GeneralConfiger.cpp b/src/MeoAssistant/Resource/GeneralConfiger.cpp index 5ee58a8580..6620fcb83a 100644 --- a/src/MeoAssistant/Resource/GeneralConfiger.cpp +++ b/src/MeoAssistant/Resource/GeneralConfiger.cpp @@ -18,6 +18,11 @@ bool asst::GeneralConfiger::parse(const json::value& json) m_options.adb_swipe_duration_multiplier = options_json.get("adbSwipeDurationMultiplier", 10.0); m_options.minitouch_extra_swipe_dist = options_json.get("minitouchExtraSwipeDist", 100); m_options.minitouch_extra_swipe_duration = options_json.get("minitouchExtraSwipeDuration", -1); + if (auto order = options_json.find("minitouchProgramsOrder")) { + for (const auto& type : *order) { + m_options.minitouch_programs_order.emplace_back(type.as_string()); + } + } m_options.penguin_report.cmd_format = options_json.get("penguinReport", "cmdFormat", std::string()); m_options.yituliu_report.cmd_format = options_json.get("yituliuReport", "cmdFormat", std::string()); m_options.depot_export_template.ark_planner = diff --git a/src/MeoAssistant/Resource/GeneralConfiger.h b/src/MeoAssistant/Resource/GeneralConfiger.h index 66e54a92a9..c86fe7174a 100644 --- a/src/MeoAssistant/Resource/GeneralConfiger.h +++ b/src/MeoAssistant/Resource/GeneralConfiger.h @@ -42,6 +42,7 @@ namespace asst double adb_swipe_duration_multiplier = 0; // adb 滑动持续时间倍数 int minitouch_extra_swipe_dist = 0; int minitouch_extra_swipe_duration = -1; + std::vector minitouch_programs_order; PenguinReportCfg penguin_report; // 企鹅物流汇报: // 每次到结算界面,汇报掉落数据至企鹅物流 https://penguin-stats.cn/ DepotExportTemplate depot_export_template; // 仓库识别结果导出模板 From bb01defc1cc9f2da90a14f7d985dd3129ac94450 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 28 Nov 2022 23:57:20 +0800 Subject: [PATCH 3/4] fix: merge error --- src/MeoAssistant/Controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MeoAssistant/Controller.cpp b/src/MeoAssistant/Controller.cpp index cfdf3ec1af..052304130b 100644 --- a/src/MeoAssistant/Controller.cpp +++ b/src/MeoAssistant/Controller.cpp @@ -1509,7 +1509,7 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a std::string abilist = call_command(cmd_replace(adb_cfg.abilist)).value_or("maatouch"); std::string_view optimal_abi; - for (const auto& abi : Config.get_options().minitouch_programs_order) { + for (const auto& abi : Configer.get_options().minitouch_programs_order) { if (abilist.find(abi) != std::string::npos) { optimal_abi = abi; break; From d59cbe7c7e03fd0d7b1e102d6fc3fbd5694b0df7 Mon Sep 17 00:00:00 2001 From: MistEO Date: Tue, 29 Nov 2022 00:02:22 +0800 Subject: [PATCH 4/4] docs: update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1daafdcf9b..d180f26d34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v4.7.3 + +- 新增 `MaaTouch` 连接配置 项,推荐在 minitouch 无法使用,但又不想用 `兼容触控模式` 时开启 @aa889788 @MistEO +- 修复 minitouch 路径错误无法使用的问题 @MistEO + ## v4.7.2 - 修复 刷理智 掉落识别 在极端情况下疯狂上传的问题 @MistEO