feat: support building for Android/Termux - #581
Open
JasonHuang79 wants to merge 2 commits into
Open
JasonHuang79 wants to merge 2 commits into
JasonHuang79 wants to merge 2 commits into
Conversation
Add a workflow that cross-compiles maa-cli for Android and packages it together with the official MaaCore component, so maa-cli can run inside Termux on the device itself. What's included: - .github/workflows/build-android.yml: builds aarch64/x86_64-linux-android with the Android NDK, downloads the official MAAComponent-android-*.tar.gz for MaaCore, converts the OCR models to ncnn (Android uses OcrPackNcnn; the shared resource only ships onnx), and assembles a runnable package. - android/maa-android-connect.sh: helper that connects MaaCore to the local adb (mDNS / root-set tcp port / common ports), since Termux cannot use the Android native control path. - Fix TLS on Android: rustls-platform-verifier needs an Android Context via JNI to initialize, which a plain Termux process has no access to; every HTTPS request panicked with "Expect rustls-platform-verifier to be initialized". Android now uses the bundled Mozilla roots, other platforms keep the platform verifier (so self-signed certs in corporate networks still work). Verified on a rooted Android 12 x86_64 emulator: after deployment, `maa fight 1-7 --times 10` ran to completion and reported drops. The packages set RPATH ($ORIGIN for libs, $ORIGIN/../lib for bin/maa) so no LD_LIBRARY_PATH is needed -- setting it leaked into the adb child process and made it load the NDK libc++, which broke the connection.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #581 +/- ##
==========================================
+ Coverage 72.36% 72.58% +0.21%
==========================================
Files 72 72
Lines 6804 6756 -48
Branches 6804 6756 -48
==========================================
- Hits 4924 4904 -20
- Misses 1537 1557 +20
+ Partials 343 295 -48 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
Author
|
@wangl-cc 请求审查,我在这个仓库没有权限 |
`cargo deny check advisories` started failing with RUSTSEC-2026-0285:
rustls accepted TLS 1.3 handshake messages sent at the wrong encryption
level when they followed a key-changing message in the same record.
The advisory requires >= 0.23.45.
Note that a plain `cargo update -p rustls` is not enough: it only picks
0.23.43, which is still vulnerable. An explicit precise version is needed:
cargo update -p rustls --precise 0.23.45
This also bumps rustls-webpki 0.103.13 -> 0.103.15 as a side effect.
Member
|
为什么写了这么多的注释,而且我怎么感觉是把文档写进了脚本里呢? |
Member
|
另外,没必要单独建 Workflow,我们可以在 CI 和 Release 中都加上 Android。还有,我觉得没必要把 maa-cli 和 MaaCore 一起编译,能不能让 maa-cli 在 Android 上下载 MaaMeow 发布的 Core(如果他们发布了的话)? |
Member
Author
等我回去拷打大肥鱼() |
Member
Author
我本来是这么想的,但是后面发现他们的 Core 似乎有点不适配,等我一会去看看 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
我烧了一点token把 MAA-Meow 的一些功能搬过来了,考虑到这边一直没有 Android 适配,我加了一些东西
绝对不是我已经被llm惯坏了导致不会写代码了以下是AI总结:
Add a workflow that cross-compiles maa-cli for Android and packages it together with the official MaaCore component, so maa-cli can run inside Termux on the device itself.
What's included:
Verified on a rooted Android 12 x86_64 emulator: after deployment,
maa fight 1-7 --times 10ran to completion and reported drops. The packages set RPATH ($ORIGIN for libs, $ORIGIN/../lib for bin/maa) so no LD_LIBRARY_PATH is needed -- setting it leaked into the adb child process and made it load the NDK libc++, which broke the connection.Sourcery 摘要
支持 maa-cli 在 Android 上的 Termux 中使用捆绑的 MaaCore 组件进行构建和运行,并支持 adb 连接以及兼容 Android 的网络功能。
新功能:
错误修复:
增强:
构建:
CI:
文档:
Original summary in English
Sourcery 总结
支持 maa-cli 在 Android 的 Termux 中构建和运行,并捆绑 MaaCore 支持、adb 连接功能以及兼容 Android 的网络功能。
新功能:
错误修复:
增强功能:
构建:
CI:
文档:
Original summary in English
Summary by Sourcery
Enable maa-cli to build and run in Termux on Android with bundled MaaCore support, adb connectivity, and Android-compatible networking.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Documentation: