Files
openless/openless-all/app/android
Chris233 fc38edd1a3 refactor: consolidate Core 2.0 and restore cross-platform behavior (#1019)
* refactor: split Linux egui host from shared backend

* fix: keep CI contracts portable across runners

* fix(ci): preserve CRLF while removing qwen dependency

* fix(ci): regenerate target lockfile and install ripgrep

* fix(ci): gate desktop-only selection voice module

* ci: limit native build parallelism on cross-platform runners

* fix(host): expose blocking task seam to coordinator

* fix(settings): avoid macOS default hotkey collision

* docs: record cross-platform CI evidence

* ci: expose Linux validation package artifact

* ci: grant reusable Linux package permissions

* refactor: remove legacy coordinator dictation facade

* ci: skip unsupported MSI prerelease builds

* ci: install minisign only for signed Linux releases

* fix: keep test-only coordinator session helper

* refactor: move style preview diagnostics into core

* fix: import shared preferences type from core

* refactor: centralize enabled vocabulary projection

* ci: install ripgrep for Linux package gates

* test: make source contract line-ending agnostic

* fix: keep Linux desktop entry standards compliant

* docs: expose core style diagnostics contract

* ci: resolve Linux package version in app directory

* refactor: centralize ASR vocabulary priority

* fix: use shared vocabulary note constant

* refactor: keep vocabulary priority inside core

* test: retain starting-stop queue coverage

* ci: scope Linux updater URL to the current repository

* docs: close implementation and artifact evidence

* docs: record final CI artifact evidence

* fix(android): align updater plugin versions

* fix(android): pin updater crate exactly

* refactor(core): remove unused type anchor

* docs: record final artifact runs

* fix(remote-input): preserve beta status fields

* fix(tauri): finish beta host merge

* fix(asr): pass scoped operation to native qwen adapter

* fix(macos): bundle mlx metallib as a resource

* test(remote-input): update status wire contract

* feat: share Less Computer voice flow with Linux

* refactor(core): centralize host-independent runtime policy

* refactor(core): complete 2.0 backend consolidation

* fix(ci): prepare Sherpa after cache restore

* fix(macos): route native model paths through Core store

* fix(macos): use ModelStore catalog API

* fix(ci): serialize macOS native test build

* test(ci): preserve macOS cargo diagnostics

* fix(macos): release input source lock before await

* test(core): replace legacy hotkey injection gate

* test(core): move Codex sandbox contract into Core

* fix(core): close final runtime policy gaps

* fix(windows): terminate coding agent process trees

* fix(core): complete local model migration

* fix(credentials): align Core LLM model account

* fix(core): restore 1.x parity across shared backend

* fix(android): complete shared backend stubs

* fix: close cross-platform migration review gaps

* fix: complete migration lifecycles and platform compatibility

* docs: define desktop 2.0 acceptance and Linux handoff

* fix: close desktop parity and session lifecycle gaps

* fix: finish voice lifecycle and desktop feedback parity

* fix: close desktop cancellation and feedback race gaps

* fix: honor proxy settings and reject stale session effects

* fix: dispatch native cleanup on host runtimes and order events

* fix: keep optional recording effects best effort

* fix: close desktop agent model and QA lifecycle gaps

* fix: preserve desktop raw voice and QA turn ownership

* fix: finalize desktop dictation and QA feedback
2026-09-06 18:39:46 +08:00
..

OpenLess Android 平台代码

Android 相关 Rust、Kotlin 与前端代码的统一入口。桌面端通过 #[cfg(not(mobile))] 分层,不受影响。

目录结构

android/
├── kotlin/              # Kotlin 模板(CI 复制到 gen/android/)
├── manifests/           # AndroidManifest snippet + res/xml
└── frontend/            # React 模块(Vite 别名 @android)

src-tauri/src/android/   # Rust 运行时模块(crate::android)

Rust(src-tauri/src/android/)

模块 职责
jni.rs JNI 工具(clipboard、overlay service、accessibility)
native_bridge.rs Kotlin ↔ Coordinator JNI 入口
overlay.rs 悬浮窗权限与 show/hide
accessibility.rs 无障碍服务状态与 paste
shizuku.rs Shizuku 状态诊断与受控无障碍恢复
insert.rs 跨 App 文本插入策略
updater.rs 应用内更新(manifest 拉取、minisign 校验、系统安装器)
updater_logic.rs 更新 URL / 版本比较纯函数(全平台可测)
types.rs Android 偏好与状态类型

主 crate 通过 mod android; 引入,常用 API 经 crate::android:: 扁平 re-export。

Kotlin(android/kotlin/)

tauri android init 后由 scripts/copy-android-scaffolding.mjs 复制到 src-tauri/gen/android/app/src/main/java/com/openless/app/。

Manifest 合并脚本:

前端(android/frontend/,别名 @android)

路径 职责
lib/androidTypes.ts Android 偏好与状态 TS 类型
lib/androidIpc.ts overlay / accessibility / Shizuku Tauri invoke
lib/androidMicrophonePermission.ts WebView 麦克风权限辅助
components/AndroidPermissionsPanel.tsx 设置页 Android 权限与 overlay 配置

src/lib/types.ts 与 src/lib/ipc.ts 保留 re-export,现有 import 路径仍可用。

构建与 CI

CI(overlay / 无障碍 ADB 测试 APK) — 合并 v1 麦克风权限 + overlay / 无障碍 manifest,用于真机 ADB 测试完整悬浮窗与无障碍能力(非仅应用内听写):

cd openless-all/app
npm ci && npm run build
CI=true npm run tauri -- android init --ci
node scripts/copy-android-scaffolding.mjs
node scripts/merge-android-v1-manifest.mjs
node scripts/merge-android-overlay-manifest.mjs
node scripts/merge-android-shizuku-manifest.mjs
node scripts/patch-android-shizuku-deps.mjs
CI=true npm run tauri:android:build

Workflow: .github/workflows/android-apk.yml

本地 overlay / 无障碍开发(v3) — 与 CI 相同的 manifest 合并链,使用本地 init / copy 脚本:

cd openless-all/app
npm run tauri:android:init
npm run copy:android-scaffolding
node scripts/merge-android-v1-manifest.mjs
node scripts/merge-android-overlay-manifest.mjs
node scripts/merge-android-shizuku-manifest.mjs
node scripts/patch-android-shizuku-deps.mjs
npm run tauri:android:build

相关文档