|
|
7 mesiacov pred | |
|---|---|---|
| .. | ||
| docs | 7 mesiacov pred | |
| public | 8 mesiacov pred | |
| scripts | 9 mesiacov pred | |
| src | 7 mesiacov pred | |
| src-tauri | 7 mesiacov pred | |
| .DS_Store | 7 mesiacov pred | |
| .gitignore | 9 mesiacov pred | |
| .npmrc | 9 mesiacov pred | |
| README.md | 9 mesiacov pred | |
| SECURITY.md | 9 mesiacov pred | |
| build-exe.sh | 9 mesiacov pred | |
| build-windows.ps1 | 9 mesiacov pred | |
| config.example.json | 9 mesiacov pred | |
| default-config.json | 8 mesiacov pred | |
| index.html | 9 mesiacov pred | |
| package-lock.json | 8 mesiacov pred | |
| package.json | 8 mesiacov pred | |
| tsconfig.json | 9 mesiacov pred | |
| vite.config.ts | 8 mesiacov pred | |
本项目采用Tauri + Vue3 + TypeScript方案重构原PyQt6客户端,并完整集成SteamDesktopAuthenticator的核心功能。
http://localhost:8000
%APPDATA%\BuffClient\config.json~/Library/Application Support/BuffClient/config.json~/.local/share/BuffClient/config.json# 启动应用后,访问API配置页面
npm run tauri:dev
# 然后在应用内修改API地址
# 1. 找到配置文件位置
# 2. 编辑config.json文件
{
"api": {
"base_url": "https://your-api-server.com",
"timeout": 30,
"software_code": "buff-xp-steam-sh"
},
"security": {
"encryption_enabled": true,
"key_rotation_days": 10,
"heartbeat_interval": 30
}
}
# 复制默认配置
cp config.example.json /path/to/config/directory/config.json
# 启动应用后,检查控制台日志确认配置已加载
npm run tauri:dev
{
"api": {
"base_url": "http://localhost:8000",
"timeout": 30
}
}
{
"api": {
"base_url": "http://test-api.example.com:8080",
"timeout": 60
}
}
{
"api": {
"base_url": "https://api.buff-client.com",
"timeout": 30
}
}
客户端会自动创建默认配置文件,你也可以参考项目根目录的 config.example.json:
{
"api": {
"base_url": "http://localhost:8000",
"timeout": 30,
"software_code": "buff-xp-steam-sh"
},
"security": {
"encryption_enabled": true,
"key_rotation_days": 10,
"heartbeat_interval": 30
}
}
// Rust后端实现TOTP算法
pub fn generate_code_for_time(&self, time: u64) -> Result<String, Box<dyn std::error::Error>>
// 获取确认列表
pub async fn fetch_confirmations(&self) -> Result<Vec<Confirmation>, Box<dyn std::error::Error>>
// 接受/拒绝确认
pub async fn accept_confirmation(&self, conf: &Confirmation) -> Result<bool, Box<dyn std::error::Error>>
pub async fn deny_confirmation(&self, conf: &Confirmation) -> Result<bool, Box<dyn std::error::Error>>
| 方面 | 原PyQt6 | 新Tauri |
|---|---|---|
| 代码保护 | Python字节码 | Rust原生机器码 |
| 逆向难度 | ⭐⭐ | ⭐⭐⭐⭐⭐ |
| 内存安全 | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| 运行时安全 | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
# 安装Tauri CLI
npm install -g @tauri-apps/cli
# 安装Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 安装依赖
npm install
# 启动开发服务器
npm run tauri dev
# 构建应用
npm run tauri build
早期版本包含了预打包的浏览器二进制(存放在 browsers/ 目录)用于自动化测试或无头执行。当前工程已迁移为使用系统安装的浏览器,不再需要包含这些二进制文件。
如果你本地还有 browsers/ 目录,占用较多磁盘空间,可以安全删除:
# 在 client-tauri 目录下运行
npm run clean:browsers
# 或手动删除
rm -rf ./browsers
构建脚本已配置为使用系统浏览器(如 Chrome/Chromium/Firefox),不再从 Playwright 下载内置浏览器。
通过Tauri + Rust方案,我们不仅解决了原PyQt6的安全性问题,还获得了更好的性能和用户体验。SDA核心功能的完整集成确保了Steam自动化操作的安全性和可靠性。
这个方案为你的项目提供了长期可持续的技术基础,既保证了安全性,又兼顾了开发效率。