feat(receiver): 授权开关与按需投屏,新增 LocalSend 风格文件服务
- 新增 Prefs 持久化 + BootReceiver 开机自启,主开关打开后进入应用/开机自动准备待命 - Service 拆为待命/投屏两阶段:待命只维持广播与控制通道,不建编码器、不创建 VirtualDisplay - 新增控制帧 msgType=8 Mirror:主控端请求投屏,被控端弹窗确认并校验屏幕录制权限后才开流 - 新增 MirrorRequestActivity 透明确认页(通知兜底 + 30s 超时自动拒绝) - 投屏按本机真实分辨率(不强制横屏)适配,旋转/分辨率变化自动重建采集 - 新增 LocalSend 风格 HTTP 文件服务(53317,含 info/browse/download/upload/mirror),目录做根路径越权校验,主界面提供存储与通知权限申请 - 控制通道 msgType=7 增加 op=list 目录浏览;Rust/Dart 同步支持投屏请求并加工具栏按钮
This commit is contained in:
1 parent
3feddb3434
commit
f87ef59d98
23 files changed
+1840
-274
No files matched your search
@@ -300,6 +300,7 @@ pub unsafe extern "C" fn ttstd_control_decode(
|
||||
ControlEventKind::Key(_) => "key",
|
||||
ControlEventKind::Wheel(_) => "wheel",
|
||||
ControlEventKind::Clipboard(_) => "clipboard",
|
||||
ControlEventKind::Mirror(_) => "mirror",
|
||||
};
|
||||
let json = format!(
|
||||
"{{\"sequence\":{},\"msgType\":{},\"kind\":\"{}\"}}",
|
||||
@@ -358,6 +359,12 @@ pub unsafe extern "C" fn ttstd_demo_send_control(
|
||||
bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6], bytes[7],
|
||||
]),
|
||||
)),
|
||||
// 8 = 投屏请求/停止:[action:u8] + 可选 UTF-8 说明
|
||||
8 if !bytes.is_empty() => Some(crate::demo_server::mirror_event(
|
||||
sequence,
|
||||
bytes[0],
|
||||
String::from_utf8_lossy(&bytes[1..]).to_string(),
|
||||
)),
|
||||
_ => None,
|
||||
};
|
||||
match event {
|
||||
|
||||
Reference in new issue
Block a user