Files
pp-bot 52a3f0f45c
Some checks failed
CI / Lint (push) Has been cancelled
feat(e2e): 端对端加密完全对齐老项目 — cipher_guard_sdk 修正 + EncryptionManager 集成
修正 cipher_guard_sdk 4 个关键密码学差异使其与老 Flutter 项目 (im-client-im-dev) 和 iOS
EncryptionManager 完全互操作:

1. AES: 显式 SIC/CTR 模式 + 16 zero-byte IV(原 SDK 用随机 IV + KDF 派生密钥)
2. RSA: bare RSAEngine 无 PKCS1 padding(原 SDK 用 PKCS1Encoding)
3. Session key: 32-char alphanumeric ASCII(原 SDK 用 base64 random bytes)
4. Wire format: base64(ciphertext) 无 IV 前缀

新增 EncryptionManager:
- Per-chat round-based key chain(最多 10 rounds/chat,FIFO 淘汰)
- 登录后自动 setup:RSA 密钥对生成/存储 + 公钥上传 + chat 密钥拉取解密
- API 集成:cipher/v2/key/my, key/set, chat/my
- 消息加密返回 JSON envelope {"round":N,"data":"<base64>"}
- 消息解密兼容 JSON envelope + legacy raw base64

集成到消息流:
- SendMessageUseCase: 发送前加密 content → wireContent
- WsMessageService: 收到消息后解密 content + lastMsg
- 无密钥时 fallback 到明文(对齐 iOS 行为)

注意:/app/api/cipher/v2/key/set 仍为预发布接口,仅测试阶段使用

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 21:44:00 +09:00

153 lines
3.2 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: im_app
description: "Customer IM Client"
publish_to: none
version: 0.1.0
environment:
sdk: ^3.11.0
dependencies:
flutter:
sdk: flutter
# Workspace SDK packages - 使用 git dependency 控制版本
networks_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: networks_sdk/v0.0.1
path: packages/networks_sdk
storage_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: storage_sdk/v0.0.1
path: packages/storage_sdk
media_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: media_sdk/v0.0.1
path: packages/media_sdk
rtc_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: rtc_sdk/v0.0.1
path: packages/rtc_sdk
notification_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: notification_sdk/v0.0.1
path: packages/notification_sdk
protocol_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: protocol_sdk/v0.0.1
path: packages/protocol_sdk
l10n_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: l10n_sdk/v0.0.1
path: packages/l10n_sdk
cipher_guard_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: cipher_guard_sdk/v0.0.1
path: packages/cipher_guard_sdk
im_log_sdk:
git:
url: https://gitea.winwayinfo.com/CUS-IM/customer-im-client.git
ref: im_log_sdk/v0.0.1
path: packages/im_log_sdk
# 状态管理 - Riverpod
flutter_riverpod: ^3.0.0
riverpod_annotation: ^4.0.0
# 不可变状态 - Freezed
freezed_annotation: ^3.0.0
# JSON 序列化
json_annotation: ^4.8.1
# 路由导航
go_router: ^12.0.0
# 网络状态监听
connectivity_plus: ^6.1.0
# JWT 解析token 过期检测、主动刷新)
dart_jsonwebtoken: ^3.1.0
# 数据库schema 定义在 im_app连接/CRUD 封装在 storage_sdk
drift: ^2.22.0
# 设备信息deviceId / deviceName
device_info_plus: ^11.0.0
# 文件打开(#30
open_filex: ^4.4.1
# 音频播放(#31
audioplayers: ^6.1.0
# 视频播放(#32
video_player: ^2.9.2
chewie: ^1.9.0
# 小程序 WebView#25
webview_flutter: ^4.8.0
# 图片预览 — 全屏 pinch-to-zoom#32
photo_view: ^0.15.0
# 图片选取 — 相册/相机(#33
image_picker: ^1.1.2
# 图片编辑 — 裁剪/旋转(#34
image_cropper: ^5.0.1
# 图片网络缓存 — 磁盘+内存双缓存(#57
cached_network_image: ^3.3.1
crypto: ^3.0.6
# 本地键值存储(加密 key chain 持久化)
shared_preferences: ^2.5.3
# 图片保存到相册(#32
image_gallery_saver_plus: ^3.0.5
# 分享(#32
share_plus: ^10.0.0
dev_dependencies:
flutter_test:
sdk: flutter
integration_test:
sdk: flutter
# 代码生成
drift_dev: ^2.22.0
build_runner: ^2.4.6
riverpod_generator: ^4.0.0
freezed: ^3.0.0
json_serializable: ^6.7.1
# 代码检查
flutter_lints: ^6.0.0
very_good_analysis: ^5.1.0
# 测试
mocktail: ^1.0.1
flutter:
uses-material-design: true
assets:
- assets/