From 66f60a206ab40de50cfb703573e79b224295167e Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Wed, 9 Jul 2025 16:49:56 +0800 Subject: [PATCH] ci: ubuntu build --- src/MaaCore/Controller/AdbController.cpp | 48 ++++++++++++------------ src/MaaCore/Controller/AdbController.h | 2 +- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/MaaCore/Controller/AdbController.cpp b/src/MaaCore/Controller/AdbController.cpp index 4f9042a305..8c9d33fd40 100644 --- a/src/MaaCore/Controller/AdbController.cpp +++ b/src/MaaCore/Controller/AdbController.cpp @@ -252,29 +252,6 @@ void asst::AdbController::set_mumu_package(const std::string& client_type) #endif } -void asst::AdbController::init_ld_extras([[maybe_unused]] const AdbCfg& adb_cfg, const std::string& address) -{ -#if !ASST_WITH_EMULATOR_EXTRAS - Log.error("MaaCore is not compiled with ASST_WITH_EMULATOR_EXTRAS"); -#else - if (adb_cfg.extras.empty()) { - LogWarn << "adb_cfg.extras is empty"; - return; - } - - std::filesystem::path ld_path = utils::path(adb_cfg.extras.get("path", "")); - int ld_index; - if (adb_cfg.extras.contains("index")) { - ld_index = adb_cfg.extras.get("index", 0); - } - else { - ld_index = get_ld_index(address); - } - int ld_pid = adb_cfg.extras.get("pid", 0); - m_ld_extras.init(ld_path, ld_index, ld_pid, m_width, m_height); -#endif -} - int asst::AdbController::get_ld_index(const std::string& address) { LogTrace << VAR(address); @@ -312,6 +289,31 @@ int asst::AdbController::get_ld_index(const std::string& address) return 0; } +void asst::AdbController::init_ld_extras(const AdbCfg& adb_cfg, const std::string& address) +{ +#if !ASST_WITH_EMULATOR_EXTRAS + std::ignore = adb_cfg; + std::ignore = address; + Log.error("MaaCore is not compiled with ASST_WITH_EMULATOR_EXTRAS"); +#else + if (adb_cfg.extras.empty()) { + LogWarn << "adb_cfg.extras is empty"; + return; + } + + std::filesystem::path ld_path = utils::path(adb_cfg.extras.get("path", "")); + int ld_index; + if (adb_cfg.extras.contains("index")) { + ld_index = adb_cfg.extras.get("index", 0); + } + else { + ld_index = get_ld_index(address); + } + int ld_pid = adb_cfg.extras.get("pid", 0); + m_ld_extras.init(ld_path, ld_index, ld_pid, m_width, m_height); +#endif +} + void asst::AdbController::close_socket() noexcept { m_platform_io->close_socket(); diff --git a/src/MaaCore/Controller/AdbController.h b/src/MaaCore/Controller/AdbController.h index c752d7e13a..9dd13b1a58 100644 --- a/src/MaaCore/Controller/AdbController.h +++ b/src/MaaCore/Controller/AdbController.h @@ -96,7 +96,7 @@ protected: static int get_mumu_index(const std::string& address); void init_mumu_extras(const AdbCfg& adb_cfg, const std::string& address); void set_mumu_package(const std::string& client_type); - void init_ld_extras([[maybe_unused]] const AdbCfg& adb_cfg, const std::string& address); + void init_ld_extras(const AdbCfg& adb_cfg, const std::string& address); static int get_ld_index(const std::string& address); // 转换 data 中的 CRLF 为 LF:有些模拟器自带的 adb,exec-out 输出的 \n 会被替换成 \r\n,