Feature: Support remote chat on Android hosts
The chat tools were Windows-only because the Android client had no COMMAND_CHAT handler: the server asked for a chat sub-connection and the command was silently dropped, leaving chat_open to time out. This adds the full path on the client and the matching server gating. Client: COMMAND_CHAT on the main connection spawns a chat thread that opens an authenticated sub-connection, sends TOKEN_CHAT_START and waits for the server to bind it. Incoming GBK lines are decoded and dispatched to ChatSession, which drives an in-app chat activity; when accessibility is available the activity is pulled to the front, otherwise a tappable notification is posted. Outgoing text is strictly GBK encoded so emoji and unmappable characters are rejected instead of becoming '?'. When the server ends the session the activity closes itself, matching the Windows client's DestroyWindow, and a new session starts from an empty log. Server: a new CLIENT_CAP_REMOTE_CHAT bit lets the server tell new APKs from old ones. ResolveHost now accepts Windows and Android hosts and rejects older APKs up front with -32005 rather than waiting for the command to expire. Tool platform masks, instructions, the docs matrix and mcp/tools.json follow the same change. Verified end to end on the Android 15 emulator: chat_open pops the activity, Chinese text from the server renders, a device reply reaches chat_wait, and ending the session from the master closes the activity instead of leaving a dead window. The committed ghost.apk is stale and must be rebuilt before release. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
f33a205fd9
commit
915c587964
14 files changed
+695
-29
No files matched your search
@@ -351,7 +351,9 @@ const char* kServerInstructions =
|
||||
u8"输入被翻译成触摸手势与 ESC(返回)/ HOME(桌面)/ APPS(任务列表)/ PRINTSCREEN(截屏)"
|
||||
u8"等全局动作,只支持整屏目标;remote_lock_screen 用系统的锁屏动作;注入依赖"
|
||||
u8"无障碍服务、抓屏依赖已授权录屏,两者都没有能力位可查,命令下发成功不代表生效),"
|
||||
u8"卸载主机(uninstall_host,会拉起系统的卸载确认框,需要有人在设备上点确认),以及 "
|
||||
u8"卸载主机(uninstall_host,会拉起系统的卸载确认框,需要有人在设备上点确认)、"
|
||||
u8"远程交谈(chat_open / chat_send / chat_wait / chat_close,聊天界面在 App 内,"
|
||||
u8"需要声明 CLIENT_CAP_REMOTE_CHAT 的新版 APK,老 APK 返回 -32005),以及 "
|
||||
u8"host_set_remark / host_set_watch_level 这两个只改服务端本地数据的工具。其余一律不支持"
|
||||
u8"(客户端未实现 SYSTEM 与 SHELL)。\n"
|
||||
u8"copy_files_c2c 是唯一有方向性的工具:源端 src_id 必须是 win,目标端 dst_id 可以是 "
|
||||
@@ -10299,10 +10301,10 @@ const ToolPlatform kToolPlatforms[] = {
|
||||
{ "host_control_window", kPlatWin },
|
||||
{ "host_control_service", kPlatWin },
|
||||
{ "host_control_task", kPlatWin },
|
||||
{ "chat_open", kPlatWin },
|
||||
{ "chat_send", kPlatWin },
|
||||
{ "chat_wait", kPlatWin },
|
||||
{ "chat_close", kPlatWin },
|
||||
{ "chat_open", kPlatWin|kPlatApk },
|
||||
{ "chat_send", kPlatWin|kPlatApk },
|
||||
{ "chat_wait", kPlatWin|kPlatApk },
|
||||
{ "chat_close", kPlatWin|kPlatApk },
|
||||
};
|
||||
|
||||
// 未知的 clientType 一律按 Windows:EXE/DLL/MEXE/SC/MDLL 都走这个分支,
|
||||
|
||||
Reference in new issue
Block a user