Skip to content

feat: android#127

Draft
MistEO wants to merge 1 commit intomainfrom
feat/android
Draft

feat: android#127
MistEO wants to merge 1 commit intomainfrom
feat/android

Conversation

@MistEO
Copy link
Copy Markdown
Owner

@MistEO MistEO commented Mar 25, 2026

Summary by Sourcery

添加初始的 Android/移动平台支持,包括对仅限桌面功能的运行时开关,以及 Android 特定的路径和构建配置。

新功能:

  • 引入 Android 专用的处理逻辑,用于权限提升检查、文件打开、外部进程执行、MaaFramework 库加载以及应用数据目录。
  • 添加移动端/桌面端平台检测工具,并对 UI 布局、快捷键、系统托盘行为以及仅限桌面的检查逻辑进行适配,避免在移动端运行不兼容功能。
  • 生成 Android 工程脚手架(Gradle、manifest、资源、Kotlin Activity、Rust 构建集成)以及用于打包 MaaFramework Android 库的辅助脚本。

增强:

  • MaaFramework 的加载逻辑重构为可复用的辅助工具,并扩展以支持 Linux/Android 的共享库命名规则。
  • 仅在桌面平台启用系统托盘和 WebView2 集成,在移动端提供空实现(no-op)。
  • 改进小屏幕/移动端视口下的响应式布局和触控操作体验,并根据平台收紧控制器类型过滤逻辑。
  • 将部分 MXU 自定义操作(启动、杀进程、电源控制、通知)限制在桌面端执行,在移动端改为记录日志并不执行操作(log-and-no-op)。

构建:

  • 拆分 Tauri 依赖,使 tray/global-shortcut/autostart/notify-rust 仅在非 Android/iOS 目标上包含,并调整 reqwest 使用 rustls
  • 新增 Android Gradle wrapper、构建脚本、Rust Gradle 插件接线,以及为生成的 Android 应用模块提供配置。
Original summary in English

Summary by Sourcery

Add initial Android/mobile platform support, including runtime gating of desktop-only features and Android-specific paths and build config.

New Features:

  • Introduce Android-specific handling for elevation checks, file opening, external process execution, MaaFramework library loading, and app data directories.
  • Add mobile/desktop platform detection utilities and adapt UI layout, hotkeys, tray behavior, and desktop-only checks to avoid running on mobile.
  • Generate an Android project scaffold (Gradle, manifest, resources, Kotlin activity, Rust build integration) and helper script for bundling MaaFramework Android libraries.

Enhancements:

  • Refactor MaaFramework loading into a reusable helper and extend it to Linux/Android shared library naming.
  • Make system tray and WebView2 integration conditional on desktop platforms and provide no-op implementations on mobile.
  • Improve responsive layout and touch affordances for smaller/mobile viewports and tighten controller-type filtering based on platform.
  • Restrict certain MXU custom actions (launch, kill process, power control, notifications) to desktop and make them log-and-no-op on mobile.

Build:

  • Split Tauri dependencies so tray/global-shortcut/autostart/notify-rust are only included on non-Android/iOS targets and adjust reqwest to use rustls.
  • Add Android Gradle wrapper, build scripts, Rust Gradle plugin wiring, and configuration for the generated Android app module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant