Conversation
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并给出了一些整体性的反馈:
- 在
AndroidNativeControlUnitMgr中,MethodParam的字符串字段(例如package_name、client_type、text)是通过函数参数的std::string::c_str()设置的;如果外部库异步使用这些指针,就会产生悬空指针——建议在文档中明确或在实现上强制只进行同步使用,或者把这些字符串存储在对象成员所拥有的存储中,以确保它们在调用期间及必要时在调用之后的生命周期是有保障的。 AndroidNativeControlUnitMgr中的scroll(int dx, int dy)方法不像其他 ControlUnit 的重写方法那样带有override说明符;如果它是用于实现ControlUnitAPI中的虚函数,建议添加override,既保持一致性,又能在编译期发现签名不匹配的问题。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `AndroidNativeControlUnitMgr`, the `MethodParam` string fields (e.g., `package_name`, `client_type`, `text`) are set to `std::string::c_str()` from function parameters; if the external library uses these pointers asynchronously, this will dangle—consider documenting or enforcing synchronous use, or storing the strings in member-owned storage so their lifetime is guaranteed during and after the call as needed.
- The `scroll(int dx, int dy)` method in `AndroidNativeControlUnitMgr` lacks an `override` specifier unlike the other ControlUnit overrides; if it is meant to implement a virtual in `ControlUnitAPI`, consider adding `override` for consistency and to catch signature mismatches at compile time.
## Individual Comments
### Comment 1
<location path="source/MaaAndroidNativeControlUnit/Manager/AndroidNativeControlUnitMgr.h" line_range="53" />
<code_context>
+ bool key_down(int key) override;
+ bool key_up(int key) override;
+
+ bool scroll(int dx, int dy);
+
+ bool inactive() override;
</code_context>
<issue_to_address>
**issue (bug_risk):** The scroll method is missing an override specifier and may not match the base class signature.
Please add `override` to `scroll` and verify its full signature (including constness and parameter types) exactly matches the declaration in `ControlUnitAPI`. Otherwise, calls via a `ControlUnitAPI*` may not dispatch to this implementation as intended.
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- In
AndroidNativeControlUnitMgr, theMethodParamstring fields (e.g.,package_name,client_type,text) are set tostd::string::c_str()from function parameters; if the external library uses these pointers asynchronously, this will dangle—consider documenting or enforcing synchronous use, or storing the strings in member-owned storage so their lifetime is guaranteed during and after the call as needed. - The
scroll(int dx, int dy)method inAndroidNativeControlUnitMgrlacks anoverridespecifier unlike the other ControlUnit overrides; if it is meant to implement a virtual inControlUnitAPI, consider addingoverridefor consistency and to catch signature mismatches at compile time.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `AndroidNativeControlUnitMgr`, the `MethodParam` string fields (e.g., `package_name`, `client_type`, `text`) are set to `std::string::c_str()` from function parameters; if the external library uses these pointers asynchronously, this will dangle—consider documenting or enforcing synchronous use, or storing the strings in member-owned storage so their lifetime is guaranteed during and after the call as needed.
- The `scroll(int dx, int dy)` method in `AndroidNativeControlUnitMgr` lacks an `override` specifier unlike the other ControlUnit overrides; if it is meant to implement a virtual in `ControlUnitAPI`, consider adding `override` for consistency and to catch signature mismatches at compile time.
## Individual Comments
### Comment 1
<location path="source/MaaAndroidNativeControlUnit/Manager/AndroidNativeControlUnitMgr.h" line_range="53" />
<code_context>
+ bool key_down(int key) override;
+ bool key_up(int key) override;
+
+ bool scroll(int dx, int dy);
+
+ bool inactive() override;
</code_context>
<issue_to_address>
**issue (bug_risk):** The scroll method is missing an override specifier and may not match the base class signature.
Please add `override` to `scroll` and verify its full signature (including constness and parameter types) exactly matches the declaration in `ControlUnitAPI`. Otherwise, calls via a `ControlUnitAPI*` may not dispatch to this implementation as intended.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
source/MaaAndroidNativeControlUnit/Manager/AndroidNativeControlUnitMgr.h
Outdated
Show resolved
Hide resolved
|
ControlUnit 重构了下,有冲突了 #1235 |
OK |
c783b8b to
df114d0
Compare
|
@sourcery-ai review it |
There was a problem hiding this comment.
Hey - 我发现了 1 个问题
供 AI 代理使用的提示词
请根据本次代码审查中的评论进行修改:
## 单条评论
### 评论 1
<location path="source/MaaAndroidNativeControlUnit/General/AndroidExternalLib.h" line_range="147-156" />
<code_context>
+
+MAA_NS_BEGIN
+
+class AndroidNativeExternalLibraryHolder : public LibraryHolder<AndroidNativeExternalLibraryHolder>
+{
+public:
+ static std::optional<AndroidNativeNS::AndroidExternalFunctions>
+ create_functions(const std::filesystem::path& library_path);
+
+private:
+ static constexpr std::string get_locked_pixels_func_name_ = "GetLockedPixels";
+ static constexpr std::string unlock_pixels_func_name_ = "UnlockPixels";
+ static constexpr std::string attach_thread_func_name_ = "AttachThread";
+ static constexpr std::string detach_thread_func_name_ = "DetachThread";
+ static constexpr std::string dispatch_input_message_func_name_ = "DispatchInputMessage";
+};
+
</code_context>
<issue_to_address>
**issue (bug_risk):** `static constexpr std::string` 成员是非良构的;请改用 `const char*` 或 `inline const std::string`。
`std::string` 不是字面量类型,因此这些声明无法作为 `static constexpr` 通过编译。可以使用:
```cpp
static constexpr const char* get_locked_pixels_func_name_ = "GetLockedPixels";
// ... etc
```
或者,如果你确实需要 `std::string` 且使用的是 C++17 及以上:
```cpp
static inline const std::string get_locked_pixels_func_name_ = "GetLockedPixels";
// ... etc
```
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="source/MaaAndroidNativeControlUnit/General/AndroidExternalLib.h" line_range="147-156" />
<code_context>
+
+MAA_NS_BEGIN
+
+class AndroidNativeExternalLibraryHolder : public LibraryHolder<AndroidNativeExternalLibraryHolder>
+{
+public:
+ static std::optional<AndroidNativeNS::AndroidExternalFunctions>
+ create_functions(const std::filesystem::path& library_path);
+
+private:
+ static constexpr std::string get_locked_pixels_func_name_ = "GetLockedPixels";
+ static constexpr std::string unlock_pixels_func_name_ = "UnlockPixels";
+ static constexpr std::string attach_thread_func_name_ = "AttachThread";
+ static constexpr std::string detach_thread_func_name_ = "DetachThread";
+ static constexpr std::string dispatch_input_message_func_name_ = "DispatchInputMessage";
+};
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The `static constexpr std::string` members are ill-formed; use `const char*` or `inline const std::string` instead.
`std::string` is not a literal type, so these declarations won’t compile as `static constexpr`. Use either:
```cpp
static constexpr const char* get_locked_pixels_func_name_ = "GetLockedPixels";
// ... etc
```
or, if you specifically need `std::string` and are on C++17+:
```cpp
static inline const std::string get_locked_pixels_func_name_ = "GetLockedPixels";
// ... etc
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
source/MaaAndroidNativeControlUnit/General/AndroidExternalLib.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Adds an Android-native ControlUnit shared library and wires it into the optional build/CI flow so it can be reused by external Android projects (e.g., MAA-Meow), without integrating it into the main MaaFramework controller selection/runtime flow yet.
Changes:
- Introduce
MaaAndroidNativeControlUnitshared library with aControlUnitAPIimplementation and a small C API for creation + JNI thread attach/detach. - Add
WITH_ANDROID_NATIVE_CONTROLLERbuild option and hook the new target into thesource/andMaaFramework/CMake dependency graph (Android-only). - Update Android CMake presets and GitHub Actions Android build to use arch-specific presets and export
ANDROID_NDK_ROOT.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| source/MaaFramework/CMakeLists.txt | Make MaaFramework depend on the new Android native control unit when enabled. |
| source/CMakeLists.txt | Conditionally add the new control unit subdirectory to the build. |
| source/MaaAndroidNativeControlUnit/CMakeLists.txt | Define the new shared library target and install rules. |
| source/MaaAndroidNativeControlUnit/Manager/AndroidNativeControlUnitMgr.h | New Android native ControlUnit manager interface (implements ControlUnitAPI). |
| source/MaaAndroidNativeControlUnit/Manager/AndroidNativeControlUnitMgr.cpp | New Android native ControlUnit behavior (screencap + input dispatch). |
| source/MaaAndroidNativeControlUnit/General/ScopedThreadAttach.h | RAII helper for JNI thread attach/detach. |
| source/MaaAndroidNativeControlUnit/General/AndroidExternalLib.h | External Android library ABI wrapper definitions + loader holder. |
| source/MaaAndroidNativeControlUnit/General/AndroidExternalLib.cpp | External library dynamic loading + function resolution and dispatch. |
| source/MaaAndroidNativeControlUnit/API/AndroidNativeControlUnitAPI.cpp | Public C API to create/destroy and manage thread attach/detach. |
| include/MaaControlUnit/AndroidNativeControlUnitAPI.h | New exported header for the Android native control unit C API. |
| include/MaaControlUnit/MaaControlUnitAPI.h | Add the new Android native control unit API header to the umbrella include. |
| include/MaaControlUnit/ControlUnitAPI.h | Add the MaaAndroidNativeControlUnitHandle handle type alias. |
| CMakeLists.txt | Add WITH_ANDROID_NATIVE_CONTROLLER option and auto-disable it off-Android. |
| CMakePresets.json | Add arch-specific Android presets (x86_64, arm64-v8a) using ANDROID_NDK_ROOT. |
| .github/workflows/build.yml | Switch Android CI build/install to use the new presets and export ANDROID_NDK_ROOT. |
source/MaaAndroidNativeControlUnit/Manager/AndroidNativeControlUnitMgr.cpp
Outdated
Show resolved
Hide resolved
source/MaaAndroidNativeControlUnit/Manager/AndroidNativeControlUnitMgr.cpp
Outdated
Show resolved
Hide resolved
source/MaaAndroidNativeControlUnit/Manager/AndroidNativeControlUnitMgr.h
Outdated
Show resolved
Hide resolved
source/MaaAndroidNativeControlUnit/General/AndroidExternalLib.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Hey - 我发现了两个问题,并给出了一些高层次的反馈:
- 在
AndroidNativeExternalLibraryHolder中,静态函数名成员被声明为static constexpr std::string,在很多标准库组合下这是不合法的;建议将它们改为inline static constexpr const char[](或constexpr std::string_view),并将这些值传给get_function。 - 在
AndroidNativeControlUnitMgr::screencap中,抓取到的帧始终被当作CV_8UC3来处理,而没有参考ImageFormat或由stride隐含的每像素字节数;如果外部库返回的是 RGBA 或其它格式,就会导致数据被误读,因此更安全的做法是检查ImageFormat并进行相应的转换,或者在文档中明确并通过断言保证期望的格式。
面向 AI Agent 的提示
请根据以下代码审查意见进行修改:
## 整体意见
- 在 `AndroidNativeExternalLibraryHolder` 中,静态函数名成员被声明为 `static constexpr std::string`,在很多标准库组合下这是不合法的;建议将它们改为 `inline static constexpr const char[]`(或 `constexpr std::string_view`),并将这些值传给 `get_function`。
- 在 `AndroidNativeControlUnitMgr::screencap` 中,抓取到的帧始终被当作 `CV_8UC3` 来处理,而没有参考 `ImageFormat` 或由 `stride` 隐含的每像素字节数;如果外部库返回的是 RGBA 或其它格式,就会导致数据被误读,因此更安全的做法是检查 `ImageFormat` 并进行相应的转换,或者在文档中明确并通过断言保证期望的格式。
## 单条评论
### 评论 1
<location path=".github/workflows/build.yml" line_range="406-415" />
<code_context>
+ - name: Build MAA
</code_context>
<issue_to_address>
**suggestion (bug_risk):** 预设名称和安装时的 build_dir 逻辑存在重复,可能随着时间产生偏移。
`matrix.arch` → 预设名称 → 构建目录 的映射被定义了两次:一次在 `Build MAA`(`preset`)中,一次在 `Install`(`build_dir`)中。如果两者有任何一处单独修改,`cmake --install` 可能会指向错误的目录。请将这部分映射逻辑集中管理(例如,从 `matrix.arch` 推导出一个构建目录环境变量,并在两个步骤中共享使用),以保持同步。
建议实现方式:
```
- name: Build MAA
shell: bash
run: |
if [[ "${{ matrix.arch }}" == "x86_64" ]]; then
preset='NinjaMulti Android x64'
build_dir='build/android/x64'
else
preset='NinjaMulti Android arm64'
build_dir='build/android/arm64'
fi
# Export for subsequent steps (e.g. Install)
echo "MAA_BUILD_PRESET=$preset" >> "$GITHUB_ENV"
echo "MAA_BUILD_DIR=$build_dir" >> "$GITHUB_ENV"
cmake --preset "$preset" --build "$build_dir"
```
为了彻底落实该建议并避免 `Build MAA` 与 `Install` 之间的偏移,你还应该:
1. 找到当前在 `Install` 步骤中基于 `matrix.arch`(或预设)推导 `build_dir` 的代码,并移除这段本地映射逻辑。
2. 将 `Install` 步骤中对本地计算 `build_dir` 的所有使用,替换为集中管理的环境变量:
- 例如,对 CMake 安装目录使用 `${{ env.MAA_BUILD_DIR }}`:
`cmake --install "${{ env.MAA_BUILD_DIR }}"`(对其它使用构建目录的地方同理)。
3. 如果实际构建目录路径与 `build/android/x64` 和 `build/android/arm64` 不同,请在更新后的 `Build MAA` 步骤中相应调整 `build_dir` 的赋值,使两个步骤保持一致。
</issue_to_address>
### 评论 2
<location path="CMakeLists.txt" line_range="12" />
<code_context>
option(WITH_ADB_CONTROLLER "build with adb controller" ON)
option(WITH_WIN32_CONTROLLER "build with win32 controller" ON)
option(WITH_MACOS_CONTROLLER "build with macOS controller" ON)
+option(WITH_ANDROID_NATIVE_CONTROLLER "build with android native controller" ON)
option(WITH_CUSTOM_CONTROLLER "build with custom controller" ON)
option(WITH_PLAYCOVER_CONTROLLER "build with PlayCover controller for macOS" ON)
</code_context>
<issue_to_address>
**suggestion (typo):** 建议在选项描述中将 "Android" 首字母大写,以保持一致性与正确性。
该帮助字符串中使用了小写的 "android",而其它消息中都是以专有名词形式书写的 "Android"。请将此描述更新为 "build with Android native controller" 以保持一致。
```suggestion
option(WITH_ANDROID_NATIVE_CONTROLLER "build with Android native controller" ON)
```
</issue_to_address>帮我变得更有用!请在每条评论上点击 👍 或 👎,我会基于你的反馈改进后续 Review。
Original comment in English
Hey - I've found 2 issues, and left some high level feedback:
- In
AndroidNativeExternalLibraryHolder, the static function name members are declared asstatic constexpr std::string, which is ill-formed on many standard/library combinations; consider making theminline static constexpr const char[](orconstexpr std::string_view) and passing those toget_functioninstead. - In
AndroidNativeControlUnitMgr::screencap, the captured frame is always treated asCV_8UC3without consulting theImageFormator bytes-per-pixel implied bystride; if the external library returns RGBA or other formats this will misinterpret the data, so it would be safer either to checkImageFormatand convert appropriately or to document and assert the expected format.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `AndroidNativeExternalLibraryHolder`, the static function name members are declared as `static constexpr std::string`, which is ill-formed on many standard/library combinations; consider making them `inline static constexpr const char[]` (or `constexpr std::string_view`) and passing those to `get_function` instead.
- In `AndroidNativeControlUnitMgr::screencap`, the captured frame is always treated as `CV_8UC3` without consulting the `ImageFormat` or bytes-per-pixel implied by `stride`; if the external library returns RGBA or other formats this will misinterpret the data, so it would be safer either to check `ImageFormat` and convert appropriately or to document and assert the expected format.
## Individual Comments
### Comment 1
<location path=".github/workflows/build.yml" line_range="406-415" />
<code_context>
+ - name: Build MAA
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Preset name and install build_dir logic are duplicated and can drift over time.
The `matrix.arch` → preset name → build directory mapping is defined twice: once in `Build MAA` (`preset`) and again in `Install` (`build_dir`). If either changes independently, `cmake --install` may target the wrong directory. Please centralize this mapping (e.g., derive a single build-dir env var from `matrix.arch` and use it for both steps) to keep them in sync.
Suggested implementation:
```
- name: Build MAA
shell: bash
run: |
if [[ "${{ matrix.arch }}" == "x86_64" ]]; then
preset='NinjaMulti Android x64'
build_dir='build/android/x64'
else
preset='NinjaMulti Android arm64'
build_dir='build/android/arm64'
fi
# Export for subsequent steps (e.g. Install)
echo "MAA_BUILD_PRESET=$preset" >> "$GITHUB_ENV"
echo "MAA_BUILD_DIR=$build_dir" >> "$GITHUB_ENV"
cmake --preset "$preset" --build "$build_dir"
```
To fully implement the suggestion and avoid drift between `Build MAA` and `Install`, you should also:
1. Locate the `Install` step that currently derives `build_dir` based on `matrix.arch` (or the preset) and remove that local mapping logic.
2. Replace any usage of the locally computed `build_dir` in the `Install` step with the centralized environment variable:
- Use `${{ env.MAA_BUILD_DIR }}` for the CMake install directory, for example:
`cmake --install "${{ env.MAA_BUILD_DIR }}"` (and similarly for any other references to the build directory).
3. If the actual build directory paths differ from `build/android/x64` and `build/android/arm64`, adjust the `build_dir` assignments in the updated `Build MAA` step to match your existing layout so that both steps remain consistent.
</issue_to_address>
### Comment 2
<location path="CMakeLists.txt" line_range="12" />
<code_context>
option(WITH_ADB_CONTROLLER "build with adb controller" ON)
option(WITH_WIN32_CONTROLLER "build with win32 controller" ON)
option(WITH_MACOS_CONTROLLER "build with macOS controller" ON)
+option(WITH_ANDROID_NATIVE_CONTROLLER "build with android native controller" ON)
option(WITH_CUSTOM_CONTROLLER "build with custom controller" ON)
option(WITH_PLAYCOVER_CONTROLLER "build with PlayCover controller for macOS" ON)
</code_context>
<issue_to_address>
**suggestion (typo):** Consider capitalizing "Android" in the option description for consistency and correctness.
The help string uses lowercase "android" while other messages use capitalized "Android" as a proper noun. Please update this description to "build with Android native controller" for consistency.
```suggestion
option(WITH_ANDROID_NATIVE_CONTROLLER "build with Android native controller" ON)
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| #include "MaaControlUnit/ControlUnitAPI.h" | ||
| #include "MaaFramework/MaaDef.h" | ||
|
|
||
| #ifdef __ANDROID__ |
There was a problem hiding this comment.
这些接口不放在平台宏里吧,参考 win32 和 playcover,impl 里报错就行了
| virtual bool find_device(/*out*/ std::vector<std::string>& devices) = 0; | ||
| }; | ||
|
|
||
| #ifdef __ANDROID__ |
| return false; | ||
| } | ||
|
|
||
| if (loaded_) { |
There was a problem hiding this comment.
改好了,之间不太会用LibraryHolder,包了一层
| uint32_t width; | ||
| uint32_t height; | ||
| uint32_t stride; | ||
| uint32_t length; | ||
| void* data; | ||
| void* frame_ref; |
| uint32_t length; | ||
| void* data; | ||
| void* frame_ref; | ||
| } FrameInfo; |
| return false; | ||
| } | ||
|
|
||
| std::this_thread::sleep_for(std::chrono::milliseconds(50)); |
There was a problem hiding this comment.
看看能不能用 MaaControllerFeature_UseMouseDownAndUpInsteadOfClick 和 MaaControllerFeature_UseKeyboardDownAndUpInsteadOfClick
CMakePresets.json
Outdated
| "jobs": 16 | ||
| } | ||
| ] | ||
| "version": 5, |
|
@sourcery-ai review it |
There was a problem hiding this comment.
你好——我发现了 1 个问题,并给出了一些整体性的反馈:
- 针对 Android 的线程附加逻辑目前分散在
ControllerAgent(通过ScopedAndroidNativeThreadAttach和dynamic_pointer_cast)以及控制单元本身之间;建议将这套 RAII 式的 attach/detach 处理集中到 Android 原生的控制单元层(或一个共享的辅助工具)中,这样可以让ControllerAgent保持平台无关性,并避免引入 Android 特定的#ifdef/类型转换。
面向 AI 代理的提示词
Please address the comments from this code review:
## Overall Comments
- The Android-specific thread attach logic is currently split between `ControllerAgent` (via `ScopedAndroidNativeThreadAttach` and a `dynamic_pointer_cast`) and the control unit itself; consider centralizing this RAII attach/detach handling in the Android-native control unit layer (or a shared helper) so `ControllerAgent` can remain platform-agnostic and avoid the Android-specific `#ifdef`/cast.
## Individual Comments
### Comment 1
<location path="docs/en_us/2.2-IntegratedInterfaceOverview.md" line_range="267" />
<code_context>
+
+Create an Android native controller backed by `MaaAndroidNativeControlUnit` for native screenshot and input on Android.
+
+> `screen_resolution` must match both the control unit's raw screenshot resolution and touch coordinate space, otherwise screencap fails immediately.
+
### MaaCustomControllerCreate
</code_context>
<issue_to_address>
**nitpick (typo):** Consider fixing the comma splice in this sentence for clearer grammar.
The phrase `, otherwise` joins two independent clauses and creates a comma splice. Consider instead: `...touch coordinate space; otherwise, screencap fails immediately.` or `...touch coordinate space. Otherwise, screencap fails immediately.`
```suggestion
> `screen_resolution` must match both the control unit's raw screenshot resolution and touch coordinate space; otherwise, screencap fails immediately.
```
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The Android-specific thread attach logic is currently split between
ControllerAgent(viaScopedAndroidNativeThreadAttachand adynamic_pointer_cast) and the control unit itself; consider centralizing this RAII attach/detach handling in the Android-native control unit layer (or a shared helper) soControllerAgentcan remain platform-agnostic and avoid the Android-specific#ifdef/cast.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The Android-specific thread attach logic is currently split between `ControllerAgent` (via `ScopedAndroidNativeThreadAttach` and a `dynamic_pointer_cast`) and the control unit itself; consider centralizing this RAII attach/detach handling in the Android-native control unit layer (or a shared helper) so `ControllerAgent` can remain platform-agnostic and avoid the Android-specific `#ifdef`/cast.
## Individual Comments
### Comment 1
<location path="docs/en_us/2.2-IntegratedInterfaceOverview.md" line_range="267" />
<code_context>
+
+Create an Android native controller backed by `MaaAndroidNativeControlUnit` for native screenshot and input on Android.
+
+> `screen_resolution` must match both the control unit's raw screenshot resolution and touch coordinate space, otherwise screencap fails immediately.
+
### MaaCustomControllerCreate
</code_context>
<issue_to_address>
**nitpick (typo):** Consider fixing the comma splice in this sentence for clearer grammar.
The phrase `, otherwise` joins two independent clauses and creates a comma splice. Consider instead: `...touch coordinate space; otherwise, screencap fails immediately.` or `...touch coordinate space. Otherwise, screencap fails immediately.`
```suggestion
> `screen_resolution` must match both the control unit's raw screenshot resolution and touch coordinate space; otherwise, screencap fails immediately.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: MistEO <[email protected]>
仅构建 libMaaAndroidNativeControlUnit.so 先不参与MaaFramework Controller流程
用于在 MAA-Meow 中复用
Summary by Sourcery
添加一个 Android 原生控制单元库,并将其接入构建和控制器基础设施,但暂未集成到主 MaaFramework 控制器流程中。
新功能:
增强:
构建:
WITH_ANDROID_NATIVE_CONTROLLERCMake 选项以及相关子目录、目标和依赖项,用于构建 Android 原生控制单元共享库。ANDROID_NDK_ROOT供下游工具使用。CI:
Original summary in English
Summary by Sourcery
Add an Android native control unit library and wire it into the build and controller infrastructure, without yet integrating it into the main MaaFramework controller flow.
New Features:
Enhancements:
Build:
CI:
Summary by Sourcery
添加一个基于全新 Android 原生控制单元库的 Android 原生控制器,并将其接入现有框架、绑定层以及构建/CI 流程,通过仅限 Android 的构建选项进行控制。
新特性:
增强功能:
构建:
WITH_ANDROID_NATIVE_CONTROLLERCMake 选项,并将MaaAndroidNativeControlUnit目标接入核心构建和安装流程,仅在 Android 平台启用。ANDROID_NDK_ROOT,并从特定架构的构建目录进行安装。CI:
Original summary in English
Summary by Sourcery
Add an Android-native controller backed by a new Android native control unit library and wire it into the framework, bindings, and build/CI, gated behind an Android-only build option.
New Features:
Enhancements:
Build:
CI:
Original summary in English
Summary by Sourcery
添加一个基于全新 Android 原生控制单元库的 Android 原生控制器,并将其接入现有框架、绑定层以及构建/CI 流程,通过仅限 Android 的构建选项进行控制。
新特性:
增强功能:
构建:
WITH_ANDROID_NATIVE_CONTROLLERCMake 选项,并将MaaAndroidNativeControlUnit目标接入核心构建和安装流程,仅在 Android 平台启用。ANDROID_NDK_ROOT,并从特定架构的构建目录进行安装。CI:
Original summary in English
Summary by Sourcery
Add an Android-native controller backed by a new Android native control unit library and wire it into the framework, bindings, and build/CI, gated behind an Android-only build option.
New Features:
Enhancements:
Build:
CI:
Original summary in English
Summary by Sourcery
添加一个基于全新 Android 原生控制单元库的 Android 原生控制器,并将其接入现有框架、绑定层以及构建/CI 流程,通过仅限 Android 的构建选项进行控制。
新特性:
增强功能:
构建:
WITH_ANDROID_NATIVE_CONTROLLERCMake 选项,并将MaaAndroidNativeControlUnit目标接入核心构建和安装流程,仅在 Android 平台启用。ANDROID_NDK_ROOT,并从特定架构的构建目录进行安装。CI:
Original summary in English
Summary by Sourcery
Add an Android-native controller backed by a new Android native control unit library and wire it into the framework, bindings, and build/CI, gated behind an Android-only build option.
New Features:
Enhancements:
Build:
CI:
Original summary in English
Summary by Sourcery
添加一个基于全新 Android 原生控制单元库的 Android 原生控制器,并将其接入现有框架、绑定层以及构建/CI 流程,通过仅限 Android 的构建选项进行控制。
新特性:
增强功能:
构建:
WITH_ANDROID_NATIVE_CONTROLLERCMake 选项,并将MaaAndroidNativeControlUnit目标接入核心构建和安装流程,仅在 Android 平台启用。ANDROID_NDK_ROOT,并从特定架构的构建目录进行安装。CI:
Original summary in English
Summary by Sourcery
Add an Android-native controller backed by a new Android native control unit library and wire it into the framework, bindings, and build/CI, gated behind an Android-only build option.
New Features:
Enhancements:
Build:
CI: