feat: 接入端到端 demo 与签名变体
- Flutter 桌面端通过 dart:ffi 调用 Rust Core cdylib - 实现 ECDH P-256 密钥协商、HKDF 子密钥派生、AES-256-GCM 控制帧 - Android 被控端用派生密钥做控制帧加密与媒体包 MAC - 新增 libopus JNI 骨架,默认回退 MediaCodec - 新增 aosp/zhanxun/neutral 签名变体与系统 sharedUserId - 本机独立信令服务与设置页开关 - 新增 .gitignore 排除所有编译产物与打包目录
This commit is contained in:
commit
31b9a52eb4
154 files changed
+13287
No files matched your search
@@ -0,0 +1,101 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ControlToolbar extends StatelessWidget {
|
||||
const ControlToolbar({super.key, required this.enabled, required this.onEvent});
|
||||
|
||||
final bool enabled;
|
||||
final void Function(String type, Map<String, dynamic> payload) onEvent;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.gamepad),
|
||||
const SizedBox(width: 8),
|
||||
Text('远程控制', style: Theme.of(context).textTheme.titleSmall),
|
||||
const Spacer(),
|
||||
if (!enabled)
|
||||
Text('连接后可用', style: Theme.of(context).textTheme.labelSmall),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
_Action(
|
||||
icon: Icons.touch_app,
|
||||
label: '点击中心',
|
||||
enabled: enabled,
|
||||
onPressed: () => onEvent('touch', {
|
||||
'action': 0,
|
||||
'pointerId': 1,
|
||||
'x': 960,
|
||||
'y': 540,
|
||||
'pressure': 800,
|
||||
}),
|
||||
),
|
||||
_Action(
|
||||
icon: Icons.arrow_back,
|
||||
label: '返回',
|
||||
enabled: enabled,
|
||||
onPressed: () => onEvent('key', {'action': 0, 'keycode': 4, 'modifiers': 0}),
|
||||
),
|
||||
_Action(
|
||||
icon: Icons.home,
|
||||
label: '主页',
|
||||
enabled: enabled,
|
||||
onPressed: () => onEvent('key', {'action': 0, 'keycode': 3, 'modifiers': 0}),
|
||||
),
|
||||
_Action(
|
||||
icon: Icons.mouse,
|
||||
label: '滚轮向下',
|
||||
enabled: enabled,
|
||||
onPressed: () => onEvent('wheel', {'deltaX': 0, 'deltaY': -1, 'buttons': 0}),
|
||||
),
|
||||
_Action(
|
||||
icon: Icons.content_paste,
|
||||
label: '发送剪贴板',
|
||||
enabled: enabled,
|
||||
onPressed: () => onEvent('clipboard', {'text': 'TTSTD Connect'}),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _Action extends StatelessWidget {
|
||||
const _Action({
|
||||
required this.icon,
|
||||
required this.label,
|
||||
required this.enabled,
|
||||
required this.onPressed,
|
||||
});
|
||||
|
||||
final IconData icon;
|
||||
final String label;
|
||||
final bool enabled;
|
||||
final VoidCallback onPressed;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return OutlinedButton.icon(
|
||||
onPressed: enabled ? onPressed : null,
|
||||
icon: Icon(icon, size: 18),
|
||||
label: Text(label),
|
||||
style: OutlinedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user