Feature: Support input blocking and privacy overlay on Android hosts

remote_block_input rejected anything but Windows because the Android
client had no COMMAND_SCREEN_BLOCK_INPUT handler. This adds the overlay
on the client and the server gating, and wires up COMMAND_SCREEN_BLANK.

Client: the accessibility service hangs a full-screen
TYPE_ACCESSIBILITY_OVERLAY on itself. block=true makes it transparent
and touchable so it swallows physical taps; black=true paints it black.
Both are absolute states, so repeated commands are idempotent, and the
handler clears the overlay when the screen sub-connection dies (Android
has no "released when the calling thread exits" fallback). During a
remote gesture the overlay is flipped to FLAG_NOT_TOUCHABLE, mirroring
Windows' BlockInput(false) wrap; the flag change and the injection must
be separated by a short delay or the gesture is swallowed.

Server: CLIENT_CAP_PRIVACY_OVERLAY distinguishes new APKs from old ones;
Linux/macOS and old APKs still get -32005 up front. Tool masks,
instructions and mcp/tools.json follow the change. COMMAND_SCREEN_BLANK
is implemented but not exposed as a tool: MediaProjection captures the
overlay, so blacking out the screen blinds the operator too and cannot
emulate Windows' WDA_EXCLUDEFROMCAPTURE.

Verified on the Android 15 emulator: blocked taps are swallowed while
remote clicks still land, the block re-arms after each gesture, the
watchdog auto-unblocks at the deadline, a dropped sub-connection clears
the overlay, and a black overlay shows up in both screencap and
get_screenshot. The committed ghost.apk is stale; rebuild before release.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-11-11 21:58:54 +01:00
1 parent 445bd8bbb9
commit a801a2999a
9 files changed
+306 -24

No files matched your search

+4 -3
View File
@@ -117,7 +117,7 @@ GATE = {
# win/lnx/mac —— client/、linux/、macos/ 都有该命令的处理分支,且服务端不拦
# win/lnx —— 远程控制只实现于 Windows/Linux(McpServer.cpp:2728);
# 以及 macOS 客户端有实现但服务端未开放的 kill_process
# 仅 win —— 服务/注册表/键日志/活动历史/文件写/块输入/host_* /power_action
# 仅 win —— 服务/注册表/键日志/活动历史/文件写/host_* /power_action
# (power_action 实际走 TOKEN_MACHINE_MANAGE,不是通用电源命令)
#
# 支持面是产品定位的阶梯:win 100% > lnx 46% > mac 28% ≈ apk 16%。
@@ -176,7 +176,7 @@ PLATFORMS = {
"upload_file": _TRIO,
# 远程控制:Windows / Linux 全功能;Android 只支持整屏目标,输入翻译成触摸与全局动作
# (remote_open/close/keyboard/mouse/clipboard),remote_block_input 仍仅 Windows
# (remote_open/close/keyboard/mouse/clipboard),remote_block_input 另支持新版 Android
"remote_open": _WLA,
"remote_close": _WLA,
"remote_keyboard": _WLA,
@@ -201,7 +201,8 @@ PLATFORMS = {
"move_path": _WIN,
"create_folder": _WIN,
"copy_files_c2c": _TRIO, # 两端并集:源端仅 win,目标端 win/lnx/mac,见 ROLES
"remote_block_input": _WIN,
# Windows 用 BlockInput();Android 新版用无障碍全屏 overlay(CLIENT_CAP_PRIVACY_OVERLAY)
"remote_block_input": _WINAPK,
"operate_window": _WIN, # WSLIST 能列窗口,但窗口操作仅 Windows 实现
"power_action": _WIN, # 实际走 TOKEN_MACHINE_MANAGE
# TOKEN_UNINSTALL:Windows 客户端一直有该分支;Android 新版映射为系统卸载确认框