Author SHA1 Message Date
admin b7461cee27 docs(protect): 补二次加壳的功能级实测(双层产物走完设备管理页与行内解绑) 2026-11-24 03:46:37 +08:00
admin 02bb727f33 merge docs/shell-device-ui:壳设备管理页文档与验收 mock
Docker Build / Build and Push Docker Image (push) Successful in 6s
Docker Build / Deploy to Server (push) Successful in 2s
2026-11-24 03:26:28 +08:00
admin 9b7cc01c3a docs(shell): 设备管理页/手机端界面/验收清单/踩坑记录 + 可复现的 mock 服务端脚本 2026-11-24 03:26:28 +08:00
admin c21326eea8 merge feat/shell-title:设备页标题随页面切换
Docker Build / Build and Push Docker Image (push) Successful in 32s
Docker Build / Deploy to Server (push) Successful in 2s
2026-11-24 02:48:57 +08:00
admin 98ca1a6190 feat(shell): 设备管理页时窗口标题改为「设备管理 - 应用名」,返回时复原 2026-11-24 02:48:57 +08:00
admin 7d1ad7a417 merge feat/shell-device-page:设备满页改为独立设备管理页
Docker Build / Build and Push Docker Image (push) Successful in 32s
Docker Build / Deploy to Server (push) Successful in 2s
2026-11-23 22:10:56 +08:00
admin 6067e9517e feat(shell): 设备满页改成独立设备管理页(窗口放大/隐藏tab/每行带解绑按钮,去掉序号输入) 2026-11-23 22:10:49 +08:00
admin ccdf5bd19b merge feat/shell-device-ui:壳设备页在线状态/手动解绑、文案、手机端界面
Docker Build / Build and Push Docker Image (push) Successful in 31s
Docker Build / Deploy to Server (push) Successful in 3s
2026-11-23 21:22:10 +08:00
admin a98c9a36ac feat(shell): 设备列表显示在线状态 + 手动选择解绑(不选不动手)+ 文案下线改解绑 + 手机端双输入框界面 2026-11-23 21:22:02 +08:00
admin 40c930cdbb merge feat/rename-cloud-encryption:界面文案改为云端加密
Docker Build / Build and Push Docker Image (push) Successful in 1m0s
Docker Build / Deploy to Server (push) Successful in 3s
2026-11-23 19:26:50 +08:00
11 changed files with 7487 additions and 6 deletions
Binary file not shown.
Binary file not shown.
+36
View File
@@ -19,6 +19,42 @@
| 改造前:壳(默认)→ DogProtect | 13 ❌ | 整文件 CRC 与变长后的文件对不上 |
| DogProtect → 壳(不论模式) | 222 ❌ | 引导把控制权交给 DogProtect 的 loader,交不过去 |
### 用当前壳资产(含设备管理页)重测 —— 功能级验证
上面那批是「能不能启动」;下面这批验证**双层产物里的壳功能是否完整**(2026-11 当前资产:
`blob64.bin` 10,000 字节、`shell64_dui.bin` 907,264 字节,dark 皮肤):
```
单层 dp_single.exe 957,440 字节 → wine exit=124
双层 dp_double.exe(DogProtect 外挂)7,326,720 字节 → wine exit=124
```
把双层产物接上 mock 服务端走完整流程,实测请求序列:
```
POST /api/v1/app/dogtest/login {"login_type":"account","username":"123","password":"***",
"device_id":"C36E-0A03-F08D","device_name":"VIAEON","device_type":"windows",
"instance_id":"C36E-0A03-F08D"} ← 被 403 DEVICE_LIMIT 拦下
→ 界面切到独立「设备管理」页(窗口 620×620、标题「设备管理 - dogtest」、3 行设备各带解绑按钮)
点第 2 行「解绑」
POST /api/v1/app/dogtest/unbind-device-with-auth {"username":"123","password":"***",
"device_id":"BBBB-4444-5555-6666"} ← 第 2 台,不是最早那台
POST /api/v1/app/dogtest/login … ← 解绑后自动重试
```
结论:**DogProtect 外层不影响壳内的设备管理页、行内解绑、窗口放大与标题切换**,双层产物功能与单层一致。
复现命令:
```bash
# 1) 打壳(api 用完整 login URL)
./packthemed sample.exe single.exe cfg.json dark
# 2) 外层再加 DogProtect(项目文件里 InputFileName 指向 single.exe)
LD_LIBRARY_PATH=<vmprotect>/bin <vmprotect>/bin/64/release/dogprotect_con \
single.exe double.exe -pf project.dog
# 3) 跑起来 + mock 服务端(scripts/mock-vfy-device-limit.py)按 docs/shell-device-ui.md 的清单验收
```
## 引导补丁(1 字节,可逆)
引导里整文件 CRC 的比较是 `cmp [hdr+0x28], eax` 紧跟 `je <通过>`;把那个 `je` 改成 `jmp`,
+149
View File
@@ -0,0 +1,149 @@
# 验证壳的设备管理页(Windows / Android)
这份文档记录 2026-11 这轮壳改动的**最终形态、交互契约、验收方法和踩过的坑**,换人接手不用再从二进制里挖。
涉及资产:
| 资产 | 说明 |
|---|---|
| `backend/internal/protect/assets/shell64_dui.bin` | x64 DuiLib 壳(7 套皮肤:dark/light/industrial/compact/split/card/terminal) |
| `backend/internal/protect/assets/shell64.bin`、`shell32.bin` | classic(Direct2D 单皮肤)壳 |
| `backend/internal/protect/assets/shell_smali.tgz` | Android 壳(smali 源码,加壳时由 apktool 合并进 APK) |
| `shell/duilib/shell9_v6.cpp` + `skins_v4.h` | DuiLib 壳的完整源码(XML 皮肤在头文件里) |
| `shell/classic/shell6.cpp` | classic 壳源码 |
> 改完源码后:`shell/duilib/build-duilib.sh` → 产物拷进 `assets/shell64_dui.bin` → **必须重编 `cmd/packthemed`**(见坑 1)。
---
## 1. 设备满时:独立「设备管理」页(QQ 式)
触发:登录返回 HTTP 403 + `error_code=DEVICE_LIMIT_EXCEEDED`。
行为:
1. 窗口从登录页尺寸(470×428 一类)**临时放大到 620×620 并居中**
2. 标题栏文字切为 **`设备管理 - <应用名>`**(cfg 的 `name`)
3. 内容区小标题 `设备管理`,副标题 `已绑定 3 / 2 台,解绑一台后即可登录`
4. 登录页的 4 个 tab(登录/注册/卡密充值/忘记密码)与品牌字**隐藏**
5. 每台设备一行卡片:`序号. 名称 设备ID ● 在线 / ○ 离线`,**右侧一个蓝色「解绑」按钮**
6. 底部:`解绑最早一台` / `重试` / `返回`
7. **点哪一行的「解绑」就解绑那一台**;成功后自动重试登录
8. 点「返回 / 重试」→ 标题复原为 `软件授权验证`、tab 回来、窗口缩回原尺寸
### 交互契约(前端 ↔ 后端)
| 步骤 | 请求 | 说明 |
|---|---|---|
| 登录 | `POST /api/v1/app/:appKey/login` `{login_type,username,password,device_id,device_name,device_type,instance_id}` | 设备绑定 + 会话都在这一步完成 |
| 被拦 | HTTP 403 `{error_code:"DEVICE_LIMIT_EXCEEDED", data:{max_devices, device_count, devices:[{id,device_id,device_name,device_type,online_count,created_at}]}}` | 壳解析 `devices` 渲染列表,`online_count>0` → ● 在线 |
| 解绑 | `POST /api/v1/app/:appKey/unbind-device-with-auth` `{username,password,device_id}` | 卡密用户走 `/card-unbind` `{card_key,device_id}` |
| 重试 | 再发一次 login | 解绑成功后自动重试,不用用户再点 |
**注意**:壳只做**解绑**(删绑定行、连带断会话),不做「下线/踢线」(`POST /instances/:instance_id/offline` 未接入)。所以界面文案里不能用「下线」,否则用户会以为能保留授权只断会话。
### 手动选择,不自动解
- 明细行是可点按钮:`devRowN`(信息)+ `devUnbindN`(右侧「解绑」),点击 → `UnbindDeviceIdx(N+1)`
- **序号输入框已整块拿掉**(`devIdx` / `btnUnbind` 在 XML 里 `visible="false"` 兜底保留,代码不再走输入路径)
- 空列表(服务端没返回明细)时只给「重试」,不会默认解绑任何一台
---
## 2. 卡密用户的「我的设备」
同一套面板复用(`g_devManage=1`):卡密就是身份,不需要先登录。
- 列表来源:`POST /api/v1/app/:appKey/card-devices` `{card_key}`
- 解绑:`POST /api/v1/app/:appKey/card-unbind` `{card_key,device_id}`
- 面板里多一个「卡密」输入框(`devCardKey`),未填时提示「先在『登录』里填入卡密,再点这里的『我的设备』」
---
## 3. Android 壳的界面(`shell_smali.tgz`)
没有 XML 布局、没有皮肤,是运行时拼的原生 `AlertDialog`:
```
┌────────────────────────────────────┐
│ <应用名>(cfg.name,缺省「验证」) │
│ 请输入账号或卡密完成验证 │
│ ┌────────────────────────────────┐ │
│ │ 账号或卡密 │ │
│ └────────────────────────────────┘ │
│ ┌────────────────────────────────┐ │
│ │ 密码(留空则用内置) │ │
│ └────────────────────────────────┘ │
│ 通过后自动进入应用 │
│ 验证 退出 │
└────────────────────────────────────┘
```
- 填了密码 → 覆盖 cfg 里的 `password`(`cfg.put("password", ...)`)后调 `verify()`
- 「退出」= `Activity.finish()` + `Process.killProcess(myPid())`
- 设备超限文案:`设备数超限,请先在平台解绑一台设备`
- 设备标识:`ANDROID-` + Android ID
- **手机端没有设备列表/自助解绑页**(只有这一道登录闸),要补就照桌面端的接口接 `/card-devices` + `/card-unbind`
改了 smali 先离线校验语法:
```bash
cd <解开 shell_smali.tgz 的目录>
smali assemble vfy -o /tmp/vfy.dex # 能出 dex 就说明语法与引用都对得上
tar czf shell_smali.tgz vfy # 结构必须是 vfy/*.smali
```
---
## 4. 验收方法(可复现)
需要:`Xvfb :99` + `openbox` + wine + 一个 mock 验证服务端。
```bash
# 1) mock 服务端:/login 一律回 403 DEVICE_LIMIT(3 台/上限 2),其它接口回成功
python3 scripts/mock-vfy-device-limit.py & # 监听 127.0.0.1:9998
# 2) 打一个 dark 主题的壳产物(api 必须是完整的 login URL)
cat > /tmp/cfg.json <<'JSON'
{"api":"http://127.0.0.1:9998/api/v1/app/dogtest/login","name":"dogtest","device_auto":1,"shell_ver":8,"theme":"dark","ver":"1.0.0"}
JSON
go build -o /tmp/packthemed ./cmd/packthemed # 改过 assets 必须重编!
/tmp/packthemed sample.exe /tmp/out.exe /tmp/cfg.json dark
# 3) 跑起来看
DISPLAY=:99 wine /tmp/out.exe
```
验收清单(每项都要肉眼/日志对得上):
- [ ] 单层产物启动 → 登录页(exit=124 = GUI 在等网络)
- [ ] 输入账号+密码点登录 → 服务端收到 login,含 `device_id/device_name/device_type/instance_id`
- [ ] 被 403 拦下 → **窗口放大、标题变「设备管理 - 应用名」、tab 消失、每行右侧有「解绑」**
- [ ] 列表在线状态与 mock 的 `online_count` 一致(● 在线 / ○ 离线)
- [ ] 点**第 2 行**「解绑」→ 服务端收到 `unbind-device-with-auth`,`device_id` = 第 2 台(不是最早那台)
- [ ] 解绑后自动重试登录
- [ ] 点「返回」→ 标题复原、tab 回来、窗口缩回登录尺寸
- [ ] 无「下线/踢线」按钮(当前设计不含该能力)
---
## 5. 踩过的坑(每条都真踩过)
1. **`cmd/packthemed` 是 `//go:embed` 内嵌壳资产的**:改完 `assets/*.bin` 不重编它,打出来的产物还是旧壳。
症状:改了半天什么都没变,字节数一模一样。规矩:**改资产 → `go build ./cmd/packthemed`**。
2. **wine 下 DuiLib 原生 EDIT 点击不转移焦点**:点一下只是激活窗口,输入会打到上一个输入框。
规矩:**同一点位点两次**(第一次激活、第二次聚焦)再输入。
3. **`devBody` 那个多行 Label 的字色在重编产物里压不住**:XML `textcolor`、运行时 `SetTextColor`、`SetAttribute("textcolor")` 都不行;`CListLabelElementUI` 连 `SetTextColor` 都没有;`CButtonUI::SetAttribute` 只吃 `hot/pushed/focusedtextcolor`。
最终解法:设备行做成**按钮**(信息按钮 + 解绑按钮),跟「重试/返回」同一套渲染 → 亮度和它们一致。
4. **`m_pm.SetSize` 不存在**(`CPaintManagerUI` 只有 `SetSizeBox`):窗口尺寸直接 `SetWindowPos`,DuiLib 会在 `WM_SIZE` 里自己重排。
5. **残留 wine 进程会叠窗污染截图**:脚本开头要 `wineserver -k9` + 杀光 `*.exe`,否则截到的是上一轮的窗口。
6. **`pkill -9 -f "themed/"` 会把自己杀掉**(命令行里含 `packthemed` 字样):模式写成 `wine.*themed/dev`。
7. **面板高度改大不能只改 XML**:`panelDevice` 用 `height="-1"` 跟随窗口,否则登录页会被撑出一个空面板。
8. 皮肤里只有 3 套有「软件授权验证」标题 Label(已命名 `lblTitle` 支持动态改),其余 4 套是 `VFY` 品牌栏设计,标题不随页切换属预期。
---
## 6. 已知未做
- 手机端的设备列表 / 自助解绑页(桌面端已有)
- 「下线(踢线)」按钮 —— 按需求方口径**不做**,有解绑即可
- 设备管理页在多语言 skin(industrial/terminal)里标题仍是各自品牌词,未做本地化
+67
View File
@@ -0,0 +1,67 @@
#!/usr/bin/env python3
"""mock 验证服务端(仅开发/验收用)
/login 一律回 HTTP 403 + error_code=DEVICE_LIMIT_EXCEEDED(带 3 台设备明细,上限 2),
/unbind-device-with-auth、/card-devices、/info、/check-update、/announcements 回成功 JSON。
用途:不需要真数据库就能把壳的「设备管理页 / 每行解绑 / 在线状态」全程跑一遍。
用法:python3 scripts/mock-vfy-device-limit.py (监听 127.0.0.1:9998)
配套验收步骤见 docs/shell-device-ui.md
"""
import json
import sys
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
DEVICES = [
{"id": 11, "device_id": "AAAA-1111-2222-3333", "device_name": "工作室-PC01", "device_type": "windows", "online_count": 1, "created_at": "2026-11-01T10:00:00+08:00"},
{"id": 12, "device_id": "BBBB-4444-5555-6666", "device_name": "笔记本-Liu", "device_type": "windows", "online_count": 0, "created_at": "2026-11-10T21:12:00+08:00"},
{"id": 13, "device_id": "CCCC-7777-8888-9999", "device_name": "ANDROID-9f3c", "device_type": "android", "online_count": 1, "created_at": "2026-11-20T08:30:00+08:00"},
]
class H(BaseHTTPRequestHandler):
def _log(self, body=b""):
sys.stderr.write("[mock] %s %s %s\n" % (self.command, self.path, body[:200].decode("utf-8", "replace")))
sys.stderr.flush()
def do_GET(self):
self._log()
if "info" in self.path:
return self._json(200, {"code": 200, "data": {
"allow_register": 1, "enable_register_verify": 1, "enable_password_reset": 1,
"password_reset_method": "email", "billing_type": "card", "max_devices": 2,
"name": "dogtest"}})
if "devices" in self.path or "instances" in self.path:
return self._json(200, {"code": 200, "data": {"devices": DEVICES, "max_devices": 2, "device_count": 3}})
return self._json(200, {"code": 200, "data": {}})
def do_POST(self):
n = int(self.headers.get("Content-Length") or 0)
body = self.rfile.read(n) if n else b""
self._log(body)
if self.path.rstrip("/").endswith("/login"):
# 与真实后端一致:error_code 放在 data 里;顶层也带一份,壳只按 "DEVICE_LIMIT" 字符串判断
return self._json(403, {"code": 403, "error_code": "DEVICE_LIMIT_EXCEEDED",
"message": "设备绑定数量已达上限,请解绑后再试",
"data": {"error_code": "DEVICE_LIMIT_EXCEEDED",
"max_devices": 2, "device_count": 3, "devices": DEVICES}})
if "unbind" in self.path:
return self._json(200, {"code": 200, "message": "解绑成功"})
if "card-devices" in self.path:
return self._json(200, {"code": 200, "data": {"devices": DEVICES, "max_devices": 2, "device_count": 3}})
return self._json(200, {"code": 200, "data": {}})
def _json(self, code, obj):
raw = json.dumps(obj, ensure_ascii=False, separators=(",", ":")).encode()
self.send_response(code)
self.send_header("Content-Type", "application/json; charset=utf-8")
self.send_header("Content-Length", str(len(raw)))
self.end_headers()
self.wfile.write(raw)
def log_message(self, *a):
pass
if __name__ == "__main__":
ThreadingHTTPServer(("127.0.0.1", 9998), H).serve_forever()
+19
View File
@@ -90,3 +90,22 @@ open(p, 'wb').write(bytes(d))
- 壳 DLL 的日志走 `logf_`(本仓库资产里已禁用)。要排查界面/网络问题时,用未打补丁的 DLL
或在源码里给 `logf_` 加重定向,别直接改 `%TEMP%` 路径——那是唯一能落盘的取证点。
- 验证界面需要窗口管理器:`Xvfb :99` + `openbox`,否则 wine 窗口不映射、截图全是黑屏。
## 设备已满页 / 我的设备页(2026-11 改版)
- **设备页做成独立页(QQ 那种观感)**:设备满时窗口从登录尺寸临时放大到 **620×620** 并居中,内容标题变「设备管理」、
登录页的 4 个 tab 与品牌字隐藏;点「返回/重试」时窗口尺寸与 tab 自动还原。
- 列表每行 = `HorizontalLayout(rowBoxN)` 里「信息按钮(devRowN) + 右侧蓝色『解绑』按钮(devUnbindN)」,行高 40、行间 6px;
文字 `序号. 名称 设备ID ● 在线 / ○ 离线`(`online_count > 0` 判在线)。
- **点哪行的『解绑』就解绑哪台**,不再需要输入序号(序号输入框整块隐藏,`devIdx`/`btnUnbind` 在 XML 里 `visible="false"` 兜底保留);
解绑成功后自动重试登录。实测:点第 2 行的解绑 → `POST /unbind-device-with-auth` 带的是第 2 台的 `device_id`。
- 文案:「设备数量已达上限,请先在平台**解绑**一台设备」「超出设备上限时请先**解绑**一台」——原来写「下线」,与按钮实际动作不一致。
- 踩坑:`packthemed` 用 `//go:embed` 内嵌壳资产,**改完 assets 必须重编 packthemed**,否则测的还是旧壳(我在这上面浪费过几轮)。
- 踩坑:wine 下 DuiLib 的原生 EDIT 子窗口点击不转移焦点,**要点两次**(第一次激活窗口、第二次才聚焦),否则输入会打到上一个输入框。
## 手机端壳(Android,`assets/shell_smali.tgz`)
- 用 `smali assemble vfy -o /tmp/x.dex` 可离线校验语法;平台侧走 apktool 合并 smali 后重建 APK。
- 界面是**运行时拼的原生 AlertDialog**(没有 XML 布局、没有皮肤):标题取 `cfg.name`,内容为竖向 LinearLayout(padding 16dp):
说明「请输入账号或卡密完成验证」+ 输入框「账号或卡密」+ 密码框(留空则用 cfg 里的 password)+ 提示「通过后自动进入应用」;
按钮「验证」(走 `verify()`)与「退出」(`finish()` + `killProcess`)。
- 设备超限文案:「设备数超限,请先在平台解绑一台设备」。手机端目前**没有**设备列表/自助解绑页(只有这一道登录闸)。
+1 -1
View File
@@ -23,7 +23,7 @@ mkdir -p "$OUTDIR"
# 导入表按实测产物取:ADVAPI32/bcrypt/COMCTL32/GDI32/gdiplus/KERNEL32/msvcrt/ole32/SHELL32/USER32/WINHTTP
x86_64-w64-mingw32-g++ -std=c++17 -O2 -shared -s \
-DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0601 -D_WIN32_LEAN_AND_MEAN \
-I"$DUILIB_DIR" -I"$DUILIB_DIR/DuiLib" -include "$DUILIB_DIR/shim/compat.h" -fpermissive -w \
-I"$DUILIB_DIR/shim" -I"$DUILIB_DIR" -I"$DUILIB_DIR/DuiLib" -I"$DUILIB_DIR/DuiLib/Core" -I"$DUILIB_DIR/DuiLib/Control" -I"$DUILIB_DIR/DuiLib/Layout" -I"$DUILIB_DIR/DuiLib/Utils" -include "$DUILIB_DIR/shim/compat.h" -fpermissive -w \
-o "$OUTDIR/shell64_dui.dll" "$SRC" "$LIBDUILIB" \
-static -lcomctl32 -lgdiplus -lole32 -loleaut32 -luuid -lshlwapi -limm32 -lwinmm -lversion \
-lgdi32 -luser32 -lwinhttp -ladvapi32 -lbcrypt -Wl,--kill-at
+88 -5
View File
@@ -42,9 +42,11 @@ static char g_lastResp[8192] = ""; // 上一次 /login 原始响应(设备
static int g_overlay = 0; // 0=正常 1=公告 2=更新 3=设备
static int g_devManage = 0; // 1 = 设备面板处于「我的设备」自助模式
struct DevItem { char id[64]; char name[64]; char created[32]; };
struct DevItem { char id[64]; char name[64]; char created[32]; int online; };
static DevItem g_devs[16];
static int g_devCount = 0, g_devMax = 0;
static int g_selIdx = 0; // 设备页手动选中的那台(1 起;0=未选)
static int g_baseW = 0, g_baseH = 0; // 登录页原始窗口尺寸(设备管理页会临时放大)
struct Notice { int id; char title[128]; char body[1024]; };
static Notice g_notices[8];
@@ -268,7 +270,7 @@ static int api_login(const char *user, const char *pass, char *msg, int cap) {
snprintf(g_lastResp, sizeof(g_lastResp), "%s", resp);
if (strstr(resp, "\"code\":0") || strstr(resp, "\"code\":200") || strstr(resp, "\"success\":true")) ok = 1;
if (!json_str(resp, "message", msg, cap) || !msg[0]) {
if (strstr(resp, "DEVICE_LIMIT")) snprintf(msg, cap, "设备数量已达上限,请先在平台下线一台设备");
if (strstr(resp, "DEVICE_LIMIT")) snprintf(msg, cap, "设备数量已达上限,请先在平台解绑一台设备");
else if (strstr(resp, "IP_LIMIT")) snprintf(msg, cap, "IP 绑定已达上限,请解绑后再试");
else if (ok) snprintf(msg, cap, "登录成功");
else snprintf(msg, cap, "账号或密码错误");
@@ -901,6 +903,11 @@ public:
if (!_tcsicmp(nm, _T("btnNoticeOk"))) { SaveNoticeSeen(); HideOverlays(); return; }
if (!_tcsicmp(nm, _T("btnUpdate"))) { DoUpdate(); return; }
if (!_tcsicmp(nm, _T("btnUpdLater"))) { HideOverlays(); return; }
if (!_tcsnicmp(nm, _T("devUnbind"), 9) || !_tcsnicmp(nm, _T("devRow"), 6)) {
int sel = _ttoi(nm + (!_tcsnicmp(nm, _T("devUnbind"), 9) ? 9 : 6)) + 1;
if (sel >= 1 && sel <= g_devCount) UnbindDeviceIdx(sel);
return;
}
if (!_tcsicmp(nm, _T("btnUnbind"))) { UnbindByIndex(); return; }
if (!_tcsicmp(nm, _T("btnUnbindOld"))) { UnbindOldest(); return; }
if (!_tcsicmp(nm, _T("btnRetryLogin"))) { HideOverlays(); DoLogin(); return; }
@@ -1191,7 +1198,26 @@ public:
}
}
void ShowTabsAgain() {
const TCHAR *names[] = {_T("tabLogin"), _T("tabRegister"), _T("tabCard"), _T("tabReset"), _T("lblApp"), _T("lblBrand")};
for (int i = 0; i < 6; i++) {
if (CControlUI *c = static_cast<CControlUI *>(m_pm.FindControl(names[i]))) c->SetVisible(true);
}
if (CLabelUI *h = static_cast<CLabelUI *>(m_pm.FindControl(_T("devHead")))) h->SetText(L"设备数量已满");
if (CLabelUI *t = static_cast<CLabelUI *>(m_pm.FindControl(_T("lblTitle")))) t->SetText(L"软件授权验证");
}
void RestoreWindowSize() {
if (g_baseW > 0) {
RECT rc; ::GetWindowRect(m_hWnd, &rc);
int sw = ::GetSystemMetrics(SM_CXSCREEN), sh = ::GetSystemMetrics(SM_CYSCREEN);
::SetWindowPos(m_hWnd, NULL, (sw - g_baseW) / 2, (sh - g_baseH) / 2, g_baseW, g_baseH, SWP_NOZORDER | SWP_NOACTIVATE);
}
}
void HideOverlays() {
RestoreWindowSize();
ShowTabsAgain();
HideByName("panelNotice"); HideByName("panelUpdate"); HideByName("panelDevice");
g_overlay = 0;
SwitchTab(g_tab);
@@ -1366,6 +1392,7 @@ public:
// 把 g_lastResp 里的设备数组解析到 g_devs/后面统一渲染
void ParseDevicesInto() {
g_devCount = 0;
g_selIdx = 0;
g_devMax = json_int(g_lastResp, "max_devices", g_maxDevices);
const char *p = g_lastResp;
while ((p = strstr(p, "\"device_id\":\"")) && g_devCount < 16) {
@@ -1379,13 +1406,51 @@ public:
}
snprintf(g_devs[g_devCount].id, sizeof(g_devs[0].id), "%s", id);
snprintf(g_devs[g_devCount].name, sizeof(g_devs[0].name), "%s", name[0] ? name : "未命名设备");
g_devs[g_devCount].online = 0;
if (const char *oc = strstr(p, "\"online_count\":")) g_devs[g_devCount].online = atoi(oc + 15);
g_devCount++;
p++;
}
}
// 设备列表渲染:每行 = 信息按钮 + 右侧「解绑」按钮;每行点哪个解哪台
void RenderDeviceList() {
for (int i = 0; i < 8; i++) {
TCHAR nm[16];
_stprintf(nm, _T("devRow%d"), i);
CButtonUI *b = static_cast<CButtonUI *>(m_pm.FindControl(nm));
TCHAR bn[16];
_stprintf(bn, _T("rowBox%d"), i);
CControlUI *box = static_cast<CControlUI *>(m_pm.FindControl(bn));
if (!b) continue;
if (i < g_devCount) {
wchar_t line[320];
swprintf(line, 320, L"%d. %ls %ls %ls", i + 1,
U8(g_devs[i].name).c_str(), U8(g_devs[i].id).c_str(),
g_devs[i].online > 0 ? L"\u25cf \u5728\u7ebf" : L"\u25cb \u79bb\u7ebf");
b->SetText(line);
if (box) box->SetVisible(true);
} else {
b->SetText(L"");
if (box) box->SetVisible(false);
}
}
}
void ShowDevicePanel() {
ParseDevicesInto();
g_selIdx = 0;
// 设备管理页比登录页大:临时放大窗口(QQ 那种独立设备页的观感)
if (g_baseW == 0) {
RECT rc; ::GetClientRect(m_hWnd, &rc);
g_baseW = rc.right - rc.left; g_baseH = rc.bottom - rc.top;
}
{
int nw = 620, nh = 620;
RECT rc; ::GetWindowRect(m_hWnd, &rc);
int sw = ::GetSystemMetrics(SM_CXSCREEN), sh = ::GetSystemMetrics(SM_CYSCREEN);
::SetWindowPos(m_hWnd, NULL, (sw - nw) / 2, (sh - nh) / 2, nw, nh, SWP_NOZORDER | SWP_NOACTIVATE);
}
std::wstring body;
for (int i = 0; i < g_devCount; i++) {
wchar_t line[256];
@@ -1393,6 +1458,7 @@ public:
body += line;
}
if (body.empty()) body = L"(服务器没有返回设备明细,可直接重试登录)";
else body = L"点选下面要解绑的那台设备,再按「解绑该设备」";
#ifdef VFY_DEBUG
{ HANDLE f = ::CreateFileW(L"C:\\vfy_dev.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
if (f != INVALID_HANDLE_VALUE) { std::string dump; char tmp[2048];
@@ -1400,11 +1466,21 @@ public:
dump = tmp; for (int i2 = 0; i2 < g_devCount; i2++) { snprintf(tmp, sizeof(tmp), "ITEM[%d] name=<%s> id=<%s>\n", i2, g_devs[i2].name, g_devs[i2].id); dump += tmp; }
DWORD wr = 0; ::WriteFile(f, dump.c_str(), (DWORD)dump.size(), &wr, NULL); ::CloseHandle(f); } }
#endif
if (CLabelUI *b = static_cast<CLabelUI *>(m_pm.FindControl(_T("devBody")))) b->SetText(body.c_str());
RenderDeviceList(); // 列表正文由它写进 devBody
wchar_t title[160];
swprintf(title, 160, L"已绑定 %d / %d 台,解绑一台后即可登录", g_devCount, g_devMax > 0 ? g_devMax : g_maxDevices);
if (CLabelUI *t = static_cast<CLabelUI *>(m_pm.FindControl(_T("devTitle")))) t->SetText(title);
ShowOverlay("panelDevice");
if (CLabelUI *h = static_cast<CLabelUI *>(m_pm.FindControl(_T("devHead")))) h->SetText(L"设备管理");
if (CLabelUI *t = static_cast<CLabelUI *>(m_pm.FindControl(_T("lblTitle")))) {
std::wstring wt = L"设备管理 - " + U8(g_name);
t->SetText(wt.c_str());
}
HideByName("tabLogin"); HideByName("tabRegister"); HideByName("tabCard"); HideByName("tabReset");
HideByName("lblApp"); HideByName("lblBrand");
if (CLabelUI *tp = static_cast<CLabelUI *>(m_pm.FindControl(_T("devTip"))))
tp->SetText(L"点任一行右侧的「解绑」即解绑那一台设备");
if (CEditUI *e = static_cast<CEditUI *>(m_pm.FindControl(_T("devIdx")))) { e->SetText(L""); e->SetVisible(false); }
}
// 一键解绑最早绑定的一台(服务器按 created_at DESC 返回,最后一台最老)
@@ -1465,7 +1541,7 @@ public:
text += line;
}
if (text.empty()) text = L"当前没有已绑定设备";
if (CLabelUI *b = static_cast<CLabelUI *>(m_pm.FindControl(_T("devBody")))) b->SetText(text.c_str());
RenderDeviceList(); // 列表正文由它写进 devBody
wchar_t title[160];
swprintf(title, 160, L"已绑定 %d / %d 台,解绑一台即可换设备登录", g_devCount, g_devMax > 0 ? g_devMax : g_maxDevices);
if (CLabelUI *t = static_cast<CLabelUI *>(m_pm.FindControl(_T("devTitle")))) t->SetText(title);
@@ -1476,7 +1552,14 @@ public:
CLabelUI *tip = static_cast<CLabelUI *>(m_pm.FindControl(_T("devTip")));
if (!e || !tip) return;
int idx = _wtoi(e->GetText().GetData());
if (idx < 1 || idx > g_devCount) { tip->SetText(L"请输入列表里的序号,例如 1"); return; }
if (idx < 1) idx = g_selIdx; // 没填序号时用列表里点选的那台
if (idx < 1 || idx > g_devCount) { tip->SetText(L"请先在「输入要解绑的设备序号」里填上列表中的序号(例如 1),再按「解绑该设备」"); return; }
{
wchar_t conf[256];
swprintf(conf, 256, L"正在解绑第 %d 台:%ls(%ls)", idx,
U8(g_devs[idx - 1].name).c_str(), g_devs[idx - 1].online > 0 ? L"在线" : L"离线");
tip->SetText(conf);
}
UnbindDeviceIdx(idx);
}
File diff suppressed because it is too large Load Diff
+533
View File
@@ -0,0 +1,533 @@
// 由 gen_skins_v3.py 生成,不要手改
#pragma once
static const char *kSkin_dark = R"SKIN(<?xml version="1.0" encoding="utf-8"?>
<Window size="452,548" caption="0,0,-1,44" mininfo="452,548" bkcolor="#FF141418">
<VerticalLayout bkcolor="#FF141418" bordercolor="#FF32323A" bordersize="1">
<HorizontalLayout height="44" bkcolor="#FF1D1D24">
<Label text="软件授权验证" textcolor="#FFF0F0F4" font="1" inset="20,0,0,0" />
<Control />
<Button name="btnClose" text="X" width="38" height="44" textcolor="#FF9A9AA6"
bkcolor="#FF1D1D24" hotbkcolor="#33FFFFFF" pushedbkcolor="#66FFFFFF" />
</HorizontalLayout>
<HorizontalLayout height="42" bkcolor="#FF1D1D24">
<VerticalLayout width="86">
<Button name="tabLogin" text="登录" textcolor="#FF4EA3E8" bkcolor="#00000000" height="40" />
<Control height="2" bkcolor="#FF4EA3E8" />
</VerticalLayout>
<VerticalLayout width="86">
<Button name="tabRegister" text="注册" textcolor="#FF85858F" bkcolor="#00000000" height="40" />
<Control height="2" bkcolor="#00000000" name="tabRegLine" />
</VerticalLayout>
</HorizontalLayout>
<VerticalLayout inset="26,14,26,14">
<Label name="lblApp" text="演示程序" textcolor="#FF6FB6E8" height="26" font="1" />
<Control height="6" />
<VerticalLayout name="panelLogin" height="auto">
<Label text="账号或卡密" textcolor="#FFB4B4BE" height="18" />
<Edit name="editUser" height="40" bkcolor="#FF2A2A33" nativebkcolor="#FF2A2A33" textcolor="#FFF4F4F8" bordercolor="#FF474755" inset="10,0,0,0" />
<Control height="10" />
<Label text="密码" textcolor="#FFB4B4BE" height="18" />
<Edit name="editPass" height="40" bkcolor="#FF2A2A33" nativebkcolor="#FF2A2A33" textcolor="#FFF4F4F8" bordercolor="#FF474755" inset="10,0,0,0" password="true" />
<Control height="10" />
<HorizontalLayout height="22">
<Label name="chkBox" width="14" height="14" bkcolor="#00000000" bordercolor="#FFB4B4BE" bordersize="1" />
<Control width="8" />
<Button name="btnRemember" text="记住账号" textcolor="#FFB4B4BE" bkcolor="#00000000" width="78" />
</HorizontalLayout>
<Control height="12" />
<Button name="btnLogin" text="登 录" height="44" bkcolor="#FF146FB8" textcolor="#FFFFFFFF" font="1" />
<Label name="lblTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<VerticalLayout name="panelRegister" height="auto" visible="false">
<Label text="用户名" textcolor="#FFB4B4BE" height="18" />
<Edit name="regUser" height="34" bkcolor="#FF2A2A33" nativebkcolor="#FF2A2A33" textcolor="#FFF4F4F8" bordercolor="#FF474755" inset="10,0,0,0" />
<Control height="6" />
<Label text="邮箱" textcolor="#FFB4B4BE" height="18" />
<HorizontalLayout height="38">
<Edit name="regEmail" bkcolor="#FF2A2A33" nativebkcolor="#FF2A2A33" textcolor="#FFF4F4F8" bordercolor="#FF474755" inset="10,0,0,0" />
<Control width="8" />
<Button name="btnSendCode" text="发送验证码" width="104" height="34" bkcolor="#FF2F6E4E" textcolor="#FFFFFFFF" />
</HorizontalLayout>
<Control height="6" />
<Label text="邮箱验证码" textcolor="#FFB4B4BE" height="18" />
<Edit name="regCode" height="34" bkcolor="#FF2A2A33" nativebkcolor="#FF2A2A33" textcolor="#FFF4F4F8" bordercolor="#FF474755" inset="10,0,0,0" />
<Control height="6" />
<Label text="密码" textcolor="#FFB4B4BE" height="18" />
<Edit name="regPass" height="34" bkcolor="#FF2A2A33" nativebkcolor="#FF2A2A33" textcolor="#FFF4F4F8" bordercolor="#FF474755" inset="10,0,0,0" password="true" />
<Control height="6" />
<Label text="确认密码" textcolor="#FFB4B4BE" height="18" />
<Edit name="regPass2" height="34" bkcolor="#FF2A2A33" nativebkcolor="#FF2A2A33" textcolor="#FFF4F4F8" bordercolor="#FF474755" inset="10,0,0,0" password="true" />
<Control height="12" />
<Button name="btnRegister" text="注册并登录" height="44" bkcolor="#FF1F8A5B" textcolor="#FFFFFFFF" font="1" />
<Label name="regTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<Control height="6" />
<Label name="lblDevice" text="设备" textcolor="#FF5C5C68" height="18" />
<HorizontalLayout height="24">
<Button name="btnLinkCard" text="卡密充值" width="96" textcolor="#FF7FA5CC" bkcolor="#00000000" />
<Button name="btnLinkForgot" text="忘记密码" width="96" textcolor="#FF7FA5CC" bkcolor="#00000000" />
<Control />
</HorizontalLayout>
</VerticalLayout>
</VerticalLayout>
</Window>)SKIN";
static const char *kSkin_light = R"SKIN(<?xml version="1.0" encoding="utf-8"?>
<Window size="452,548" caption="0,0,-1,44" mininfo="452,548" bkcolor="#FFFAFAFC">
<VerticalLayout bkcolor="#FFFAFAFC" bordercolor="#FFDCDCE3" bordersize="1">
<HorizontalLayout height="44" bkcolor="#FFFFFFFF">
<Label text="软件授权验证" textcolor="#FF1F1F24" font="1" inset="20,0,0,0" />
<Control />
<Button name="btnClose" text="X" width="38" height="44" textcolor="#FF6B6B75"
bkcolor="#FFFFFFFF" hotbkcolor="#33FFFFFF" pushedbkcolor="#66FFFFFF" />
</HorizontalLayout>
<HorizontalLayout height="20" />
<HorizontalLayout height="42" inset="26,0,26,0">
<Button name="tabLogin" text="登录" width="100" height="40" bkcolor="#FF1B6FD6" textcolor="#FFFFFFFF" font="1" />
<Control width="8" />
<Button name="tabRegister" text="注册" width="100" height="40" bkcolor="#FFEDF0F5" textcolor="#FF5B6270" />
<Control />
</HorizontalLayout>
<VerticalLayout inset="26,16,26,14">
<Label name="lblApp" text="演示程序" textcolor="#FF1B6FD6" height="26" font="1" />
<Control height="6" />
<VerticalLayout name="panelLogin" height="auto">
<Label text="账号或卡密" textcolor="#FF4B5563" height="18" />
<Edit name="editUser" height="40" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" />
<Control height="10" />
<Label text="密码" textcolor="#FF4B5563" height="18" />
<Edit name="editPass" height="40" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" password="true" />
<Control height="10" />
<HorizontalLayout height="22">
<Label name="chkBox" width="14" height="14" bkcolor="#00000000" bordercolor="#FF4B5563" bordersize="1" />
<Control width="8" />
<Button name="btnRemember" text="记住账号" textcolor="#FF4B5563" bkcolor="#00000000" width="78" />
</HorizontalLayout>
<Control height="12" />
<Button name="btnLogin" text="登录" height="44" bkcolor="#FF1B6FD6" textcolor="#FFFFFFFF" font="1" />
<Label name="lblTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<VerticalLayout name="panelRegister" height="auto" visible="false">
<Label text="用户名" textcolor="#FF4B5563" height="18" />
<Edit name="regUser" height="34" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" />
<Control height="6" />
<Label text="邮箱" textcolor="#FF4B5563" height="18" />
<HorizontalLayout height="38">
<Edit name="regEmail" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" />
<Control width="8" />
<Button name="btnSendCode" text="发送验证码" width="104" height="34" bkcolor="#FFD8EAE0" textcolor="#FFFFFFFF" />
</HorizontalLayout>
<Control height="6" />
<Label text="邮箱验证码" textcolor="#FF4B5563" height="18" />
<Edit name="regCode" height="34" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" />
<Control height="6" />
<Label text="密码" textcolor="#FF4B5563" height="18" />
<Edit name="regPass" height="34" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" password="true" />
<Control height="6" />
<Label text="确认密码" textcolor="#FF4B5563" height="18" />
<Edit name="regPass2" height="34" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" password="true" />
<Control height="12" />
<Button name="btnRegister" text="注册并登录" height="44" bkcolor="#FF128A5B" textcolor="#FFFFFFFF" font="1" />
<Label name="regTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<Control height="6" />
<Label name="lblDevice" text="设备" textcolor="#FF8A8F99" height="18" />
<HorizontalLayout height="24">
<Button name="btnLinkCard" text="卡密充值" width="96" textcolor="#FF3B62B8" bkcolor="#00000000" />
<Button name="btnLinkForgot" text="忘记密码" width="96" textcolor="#FF3B62B8" bkcolor="#00000000" />
<Control />
</HorizontalLayout>
</VerticalLayout>
</VerticalLayout>
</Window>)SKIN";
static const char *kSkin_split = R"SKIN(<?xml version="1.0" encoding="utf-8"?>
<Window size="660,548" caption="0,0,0,0" mininfo="660,548" bkcolor="#FF12151A">
<HorizontalLayout bkcolor="#FF12151A" bordercolor="#FF282D35" bordersize="1">
<VerticalLayout width="200" bkcolor="#FF1A2230">
<HorizontalLayout height="44" inset="24,0,0,0">
<Label text="VFY" textcolor="#FF4CC2FF" font="1" />
<Control />
</HorizontalLayout>
<VerticalLayout inset="24,4,24,0">
<Label text="软件授权" textcolor="#FFC8D3E0" height="28" font="1" />
<Label text="SOFTWARE LICENSE" textcolor="#FF63707E" height="20" />
<Label text="账号登录后可绑定本机设备" textcolor="#FF4C5A68" height="20" margin="0,14,0,0" />
</VerticalLayout>
<VerticalLayout />
<HorizontalLayout height="28" inset="24,0,24,16">
<Label text="v9 · DuiLib" textcolor="#FF4A5764" />
</HorizontalLayout>
</VerticalLayout>
<VerticalLayout>
<HorizontalLayout height="46" inset="28,0,0,0">
<VerticalLayout width="80">
<Button name="tabLogin" text="登录" height="44" bkcolor="#00000000" textcolor="#FF4CC2FF" font="1" />
<Control height="2" bkcolor="#FF4CC2FF" />
</VerticalLayout>
<VerticalLayout width="80">
<Button name="tabRegister" text="注册" height="44" bkcolor="#00000000" textcolor="#FF7A8794" />
<Control name="tabRegLine" height="2" bkcolor="#00000000" />
</VerticalLayout>
<Control />
</HorizontalLayout>
<VerticalLayout inset="28,8,28,16">
<Label name="lblApp" text="演示程序" textcolor="#FFF0F5FA" height="26" font="1" />
<Control height="6" />
<VerticalLayout name="panelLogin" height="auto">
<Label text="账号或卡密" textcolor="#FF8794A3" height="18" />
<Edit name="editUser" height="40" bkcolor="#FF1A1F27" nativebkcolor="#FF1A1F27" textcolor="#FFF2F6FA" bordercolor="#FF2E343D" inset="10,0,0,0" />
<Control height="10" />
<Label text="密码" textcolor="#FF8794A3" height="18" />
<Edit name="editPass" height="40" bkcolor="#FF1A1F27" nativebkcolor="#FF1A1F27" textcolor="#FFF2F6FA" bordercolor="#FF2E343D" inset="10,0,0,0" password="true" />
<Control height="10" />
<HorizontalLayout height="22">
<Label name="chkBox" width="14" height="14" bkcolor="#00000000" bordercolor="#FF8794A3" bordersize="1" />
<Control width="8" />
<Button name="btnRemember" text="记住账号" textcolor="#FF8794A3" bkcolor="#00000000" width="78" />
</HorizontalLayout>
<Control height="12" />
<Button name="btnLogin" text="登录" height="44" bkcolor="#FF2C7BE5" textcolor="#FFFFFFFF" font="1" />
<Label name="lblTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<VerticalLayout name="panelRegister" height="auto" visible="false">
<Label text="用户名" textcolor="#FF8794A3" height="18" />
<Edit name="regUser" height="34" bkcolor="#FF1A1F27" nativebkcolor="#FF1A1F27" textcolor="#FFF2F6FA" bordercolor="#FF2E343D" inset="10,0,0,0" />
<Control height="6" />
<Label text="邮箱" textcolor="#FF8794A3" height="18" />
<HorizontalLayout height="38">
<Edit name="regEmail" bkcolor="#FF1A1F27" nativebkcolor="#FF1A1F27" textcolor="#FFF2F6FA" bordercolor="#FF2E343D" inset="10,0,0,0" />
<Control width="8" />
<Button name="btnSendCode" text="发送验证码" width="104" height="34" bkcolor="#FF2B6A50" textcolor="#FFFFFFFF" />
</HorizontalLayout>
<Control height="6" />
<Label text="邮箱验证码" textcolor="#FF8794A3" height="18" />
<Edit name="regCode" height="34" bkcolor="#FF1A1F27" nativebkcolor="#FF1A1F27" textcolor="#FFF2F6FA" bordercolor="#FF2E343D" inset="10,0,0,0" />
<Control height="6" />
<Label text="密码" textcolor="#FF8794A3" height="18" />
<Edit name="regPass" height="34" bkcolor="#FF1A1F27" nativebkcolor="#FF1A1F27" textcolor="#FFF2F6FA" bordercolor="#FF2E343D" inset="10,0,0,0" password="true" />
<Control height="6" />
<Label text="确认密码" textcolor="#FF8794A3" height="18" />
<Edit name="regPass2" height="34" bkcolor="#FF1A1F27" nativebkcolor="#FF1A1F27" textcolor="#FFF2F6FA" bordercolor="#FF2E343D" inset="10,0,0,0" password="true" />
<Control height="12" />
<Button name="btnRegister" text="注册并登录" height="44" bkcolor="#FF1F8A5B" textcolor="#FFFFFFFF" font="1" />
<Label name="regTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<Control height="6" />
<Label name="lblDevice" text="设备" textcolor="#FF5E6B78" height="18" />
<HorizontalLayout height="24">
<Button name="btnLinkCard" text="卡密充值" width="96" textcolor="#FF6FA8DC" bkcolor="#00000000" />
<Button name="btnLinkForgot" text="忘记密码" width="96" textcolor="#FF6FA8DC" bkcolor="#00000000" />
<Control />
</HorizontalLayout>
</VerticalLayout>
</VerticalLayout>
</HorizontalLayout>
</Window>)SKIN";
static const char *kSkin_card = R"SKIN(<?xml version="1.0" encoding="utf-8"?>
<Window size="700,564" caption="0,0,-1,92" mininfo="700,564" bkcolor="#FFF5F6F9">
<VerticalLayout bkcolor="#FFF5F6F9" bordercolor="#FFD7DBE3" bordersize="1">
<HorizontalLayout height="92" bkcolor="#FF3B2BD6">
<VerticalLayout inset="28,16,0,0">
<Label text="软件授权验证" textcolor="#FFFFFFFF" font="1" height="34" />
<Label name="lblApp" text="演示程序" textcolor="#FFD9D4FF" height="22" />
</VerticalLayout>
<Control />
<Button name="btnClose" text="X" width="46" height="92" textcolor="#FFEDEBFF" bkcolor="#FF3B2BD6" hotbkcolor="#33FFFFFF" />
</HorizontalLayout>
<HorizontalLayout height="54" inset="28,14,28,0">
<Button name="tabLogin" text="登录" width="112" height="38" bkcolor="#FFFFFFFF" textcolor="#FF3B2BD6" font="1" />
<Control width="8" />
<Button name="tabRegister" text="注册" width="112" height="38" bkcolor="#FFE8E6FF" textcolor="#FF5B56A8" />
<Control />
</HorizontalLayout>
<HorizontalLayout inset="28,16,28,18">
<VerticalLayout width="260">
<Label text="账号安全" textcolor="#FF1F2430" height="26" font="1" />
<Label text="登录后账号与本机设备绑定," textcolor="#FF4B5563" height="20" />
<Label text="超出设备上限时请先下线一台。" textcolor="#FF4B5563" height="20" />
<Control height="12" />
<Label name="lblDevice" text="设备" textcolor="#FF8A8F99" height="20" />
<VerticalLayout />
<Button name="btnLinkCard" text="卡密充值" width="96" textcolor="#FF3B2BD6" bkcolor="#00000000" />
<Button name="btnLinkForgot" text="忘记密码" width="96" textcolor="#FF3B2BD6" bkcolor="#00000000" />
</VerticalLayout>
<Control width="28" />
<VerticalLayout>
<VerticalLayout name="panelLogin" height="auto">
<Label text="账号或卡密" textcolor="#FF4B5563" height="18" />
<Edit name="editUser" height="40" bkcolor="#FFFFFFFF" nativebkcolor="#FFFFFFFF" textcolor="#FF1F2430" bordercolor="#FFC9D1DC" inset="10,0,0,0" />
<Control height="10" />
<Label text="密码" textcolor="#FF4B5563" height="18" />
<Edit name="editPass" height="40" bkcolor="#FFFFFFFF" nativebkcolor="#FFFFFFFF" textcolor="#FF1F2430" bordercolor="#FFC9D1DC" inset="10,0,0,0" password="true" />
<Control height="10" />
<HorizontalLayout height="22">
<Label name="chkBox" width="14" height="14" bkcolor="#00000000" bordercolor="#FF4B5563" bordersize="1" />
<Control width="8" />
<Button name="btnRemember" text="记住账号" textcolor="#FF4B5563" bkcolor="#00000000" width="78" />
</HorizontalLayout>
<Control height="12" />
<Button name="btnLogin" text="登录" height="44" bkcolor="#FF3B2BD6" textcolor="#FFFFFFFF" font="1" />
<Label name="lblTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<VerticalLayout name="panelRegister" height="auto" visible="false">
<Label text="用户名" textcolor="#FF4B5563" height="18" />
<Edit name="regUser" height="34" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" />
<Control height="6" />
<Label text="邮箱" textcolor="#FF4B5563" height="18" />
<HorizontalLayout height="38">
<Edit name="regEmail" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" />
<Control width="8" />
<Button name="btnSendCode" text="发送验证码" width="104" height="34" bkcolor="#FFD8EAE0" textcolor="#FFFFFFFF" />
</HorizontalLayout>
<Control height="6" />
<Label text="邮箱验证码" textcolor="#FF4B5563" height="18" />
<Edit name="regCode" height="34" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" />
<Control height="6" />
<Label text="密码" textcolor="#FF4B5563" height="18" />
<Edit name="regPass" height="34" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" password="true" />
<Control height="6" />
<Label text="确认密码" textcolor="#FF4B5563" height="18" />
<Edit name="regPass2" height="34" bkcolor="#FFF1F3F7" nativebkcolor="#FFF1F3F7" textcolor="#FF1F2430" bordercolor="#FFC3CBD8" inset="10,0,0,0" password="true" />
<Control height="12" />
<Button name="btnRegister" text="注册并登录" height="44" bkcolor="#FF128A5B" textcolor="#FFFFFFFF" font="1" />
<Label name="regTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
</VerticalLayout>
</HorizontalLayout>
</VerticalLayout>
</Window>)SKIN";
static const char *kSkin_industrial = R"SKIN(<?xml version="1.0" encoding="utf-8"?>
<Window size="580,548" caption="0,0,-1,46" mininfo="580,548" bkcolor="#FF0A1520">
<VerticalLayout bkcolor="#FF0A1520" bordercolor="#FF1F4E79" bordersize="1">
<HorizontalLayout height="46" bkcolor="#FF10304C">
<Label text="AUTHORIZATION" textcolor="#FF7FD1FF" font="1" inset="18,0,0,0" />
<Control />
<Button name="tabLogin" text="LOGIN" width="80" height="46" bkcolor="#FF1A5A8C" textcolor="#FFFFFFFF" />
<Button name="tabRegister" text="REGISTER" width="96" height="46" bkcolor="#00000000" textcolor="#FF9FC8E6" />
<Button name="btnClose" text="X" width="46" height="46" textcolor="#FFBEE3FF" bkcolor="#FF10304C" hotbkcolor="#33FFFFFF" />
</HorizontalLayout>
<VerticalLayout inset="24,16,24,16">
<Label name="lblApp" text="演示程序" textcolor="#FF8FC4E6" height="26" font="1" />
<Control height="6" />
<VerticalLayout name="panelLogin" height="auto">
<Label text="账号或卡密" textcolor="#FF9FC0D8" height="18" />
<Edit name="editUser" height="40" bkcolor="#FF14304A" nativebkcolor="#FF14304A" textcolor="#FFEAF6FF" bordercolor="#FF23567F" inset="10,0,0,0" />
<Control height="10" />
<Label text="密码" textcolor="#FF9FC0D8" height="18" />
<Edit name="editPass" height="40" bkcolor="#FF14304A" nativebkcolor="#FF14304A" textcolor="#FFEAF6FF" bordercolor="#FF23567F" inset="10,0,0,0" password="true" />
<Control height="10" />
<HorizontalLayout height="22">
<Label name="chkBox" width="14" height="14" bkcolor="#00000000" bordercolor="#FF9FC0D8" bordersize="1" />
<Control width="8" />
<Button name="btnRemember" text="记住账号" textcolor="#FF9FC0D8" bkcolor="#00000000" width="78" />
</HorizontalLayout>
<Control height="12" />
<Button name="btnLogin" text="登录" height="44" bkcolor="#FF1F6FB2" textcolor="#FFFFFFFF" font="1" />
<Label name="lblTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<VerticalLayout name="panelRegister" height="auto" visible="false">
<Label text="用户名" textcolor="#FF9FC0D8" height="18" />
<Edit name="regUser" height="34" bkcolor="#FF14304A" nativebkcolor="#FF14304A" textcolor="#FFEAF6FF" bordercolor="#FF23567F" inset="10,0,0,0" />
<Control height="6" />
<Label text="邮箱" textcolor="#FF9FC0D8" height="18" />
<HorizontalLayout height="38">
<Edit name="regEmail" bkcolor="#FF14304A" nativebkcolor="#FF14304A" textcolor="#FFEAF6FF" bordercolor="#FF23567F" inset="10,0,0,0" />
<Control width="8" />
<Button name="btnSendCode" text="发送验证码" width="104" height="34" bkcolor="#FF1B4A3C" textcolor="#FFFFFFFF" />
</HorizontalLayout>
<Control height="6" />
<Label text="邮箱验证码" textcolor="#FF9FC0D8" height="18" />
<Edit name="regCode" height="34" bkcolor="#FF14304A" nativebkcolor="#FF14304A" textcolor="#FFEAF6FF" bordercolor="#FF23567F" inset="10,0,0,0" />
<Control height="6" />
<Label text="密码" textcolor="#FF9FC0D8" height="18" />
<Edit name="regPass" height="34" bkcolor="#FF14304A" nativebkcolor="#FF14304A" textcolor="#FFEAF6FF" bordercolor="#FF23567F" inset="10,0,0,0" password="true" />
<Control height="6" />
<Label text="确认密码" textcolor="#FF9FC0D8" height="18" />
<Edit name="regPass2" height="34" bkcolor="#FF14304A" nativebkcolor="#FF14304A" textcolor="#FFEAF6FF" bordercolor="#FF23567F" inset="10,0,0,0" password="true" />
<Control height="12" />
<Button name="btnRegister" text="注册并登录" height="44" bkcolor="#FF1F7A5E" textcolor="#FFFFFFFF" font="1" />
<Label name="regTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<Control height="6" />
<Label name="lblDevice" text="设备" textcolor="#FF5F89A6" height="18" />
<HorizontalLayout height="24">
<Button name="btnLinkCard" text="卡密充值" width="96" textcolor="#FF6FA8C8" bkcolor="#00000000" />
<Button name="btnLinkForgot" text="忘记密码" width="96" textcolor="#FF6FA8C8" bkcolor="#00000000" />
<Control />
</HorizontalLayout>
</VerticalLayout>
</VerticalLayout>
</Window>)SKIN";
static const char *kSkin_terminal = R"SKIN(<?xml version="1.0" encoding="utf-8"?>
<Window size="600,548" caption="0,0,-1,38" mininfo="600,548" bkcolor="#FF0B0F0C">
<VerticalLayout bkcolor="#FF0B0F0C" bordercolor="#FF2B3A2D" bordersize="1">
<HorizontalLayout height="38" bkcolor="#FF101710">
<Label text="vfy@local:~$" textcolor="#FF54C97A" inset="14,0,0,0" />
<Control />
<Button name="btnClose" text="X" width="38" height="38" textcolor="#FF7FB08C" bkcolor="#FF101710" hotbkcolor="#33FFFFFF" />
</HorizontalLayout>
<HorizontalLayout height="34" bkcolor="#FF0E150F">
<Button name="tabLogin" text="[ login ]" width="96" height="34" bkcolor="#00000000" textcolor="#FF7FE39B" />
<Button name="tabRegister" text="[ register ]" width="108" height="34" bkcolor="#00000000" textcolor="#FF4E7A5C" />
<Control />
</HorizontalLayout>
<VerticalLayout inset="16,10,16,12">
<Label name="lblApp" text="# 演示程序" textcolor="#FF7FE39B" height="24" />
<Control height="6" />
<VerticalLayout name="panelLogin" height="auto">
<Label text="账号或卡密" textcolor="#FF5E8A6C" height="18" />
<Edit name="editUser" height="40" bkcolor="#FF16211A" nativebkcolor="#FF16211A" textcolor="#FFD7F5DF" bordercolor="#FF2B3A2D" inset="10,0,0,0" />
<Control height="10" />
<Label text="密码" textcolor="#FF5E8A6C" height="18" />
<Edit name="editPass" height="40" bkcolor="#FF16211A" nativebkcolor="#FF16211A" textcolor="#FFD7F5DF" bordercolor="#FF2B3A2D" inset="10,0,0,0" password="true" />
<Control height="10" />
<HorizontalLayout height="22">
<Label name="chkBox" width="14" height="14" bkcolor="#00000000" bordercolor="#FF5E8A6C" bordersize="1" />
<Control width="8" />
<Button name="btnRemember" text="记住账号" textcolor="#FF5E8A6C" bkcolor="#00000000" width="78" />
</HorizontalLayout>
<Control height="12" />
<Button name="btnLogin" text="[ 执行登录 ]" height="44" bkcolor="#FF1B7A4E" textcolor="#FFFFFFFF" font="1" />
<Label name="lblTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<VerticalLayout name="panelRegister" height="auto" visible="false">
<Label text="用户名" textcolor="#FF5E8A6C" height="18" />
<Edit name="regUser" height="34" bkcolor="#FF16211A" nativebkcolor="#FF16211A" textcolor="#FFD7F5DF" bordercolor="#FF2B3A2D" inset="10,0,0,0" />
<Control height="6" />
<Label text="邮箱" textcolor="#FF5E8A6C" height="18" />
<HorizontalLayout height="38">
<Edit name="regEmail" bkcolor="#FF16211A" nativebkcolor="#FF16211A" textcolor="#FFD7F5DF" bordercolor="#FF2B3A2D" inset="10,0,0,0" />
<Control width="8" />
<Button name="btnSendCode" text="发送验证码" width="104" height="34" bkcolor="#FF234A33" textcolor="#FFFFFFFF" />
</HorizontalLayout>
<Control height="6" />
<Label text="邮箱验证码" textcolor="#FF5E8A6C" height="18" />
<Edit name="regCode" height="34" bkcolor="#FF16211A" nativebkcolor="#FF16211A" textcolor="#FFD7F5DF" bordercolor="#FF2B3A2D" inset="10,0,0,0" />
<Control height="6" />
<Label text="密码" textcolor="#FF5E8A6C" height="18" />
<Edit name="regPass" height="34" bkcolor="#FF16211A" nativebkcolor="#FF16211A" textcolor="#FFD7F5DF" bordercolor="#FF2B3A2D" inset="10,0,0,0" password="true" />
<Control height="6" />
<Label text="确认密码" textcolor="#FF5E8A6C" height="18" />
<Edit name="regPass2" height="34" bkcolor="#FF16211A" nativebkcolor="#FF16211A" textcolor="#FFD7F5DF" bordercolor="#FF2B3A2D" inset="10,0,0,0" password="true" />
<Control height="12" />
<Button name="btnRegister" text="注册并登录" height="44" bkcolor="#FF1B7A4E" textcolor="#FFFFFFFF" font="1" />
<Label name="regTip" text="" textcolor="#FFE08A8A" height="24" inset="0,6,0,0" />
</VerticalLayout>
<Control height="6" />
<Label name="lblDevice" text="设备" textcolor="#FF4E7A5C" height="18" />
<HorizontalLayout height="24">
<Button name="btnLinkCard" text="卡密充值" width="96" textcolor="#FF6FA08A" bkcolor="#00000000" />
<Button name="btnLinkForgot" text="忘记密码" width="96" textcolor="#FF6FA08A" bkcolor="#00000000" />
<Control />
</HorizontalLayout>
</VerticalLayout>
</VerticalLayout>
</Window>)SKIN";
static const char *kSkin_compact = R"SKIN(<?xml version="1.0" encoding="utf-8"?>
<Window size="760,206" caption="0,0,-1,38" mininfo="760,206" bkcolor="#FF11151A">
<VerticalLayout bkcolor="#FF11151A" bordercolor="#FF2A3440" bordersize="1">
<HorizontalLayout height="38" bkcolor="#FF161C22">
<Label text="账号" textcolor="#FFA8BCCE" inset="16,0,0,0" />
<Control />
<Button name="btnClose" text="X" width="38" height="38" textcolor="#FFA8BCCE" bkcolor="#FF161C22" hotbkcolor="#33FFFFFF" />
</HorizontalLayout>
<HorizontalLayout inset="16,12,16,10">
<VerticalLayout width="200">
<Label name="lblApp" text="演示程序" textcolor="#FFEAF2FA" height="26" font="1" />
<Label name="lblDevice" text="设备" textcolor="#FF6B7C8C" height="20" />
<Control height="12" />
<Button name="tabLogin" text="登录" width="90" height="32" bkcolor="#FF2E9E6B" textcolor="#FFFFFFFF" />
<Control height="6" />
<Button name="tabRegister" text="注册" width="90" height="32" bkcolor="#FF1B232B" textcolor="#FF9FB3C8" />
</VerticalLayout>
<Control width="16" />
<VerticalLayout>
<VerticalLayout name="panelLogin" height="auto">
<HorizontalLayout height="40">
<HorizontalLayout width="214" bkcolor="#FF1B232B">
<Label text="账号" width="46" textcolor="#FF7E90A2" inset="10,0,0,0" />
<Edit name="editUser" bkcolor="#FF1B232B" nativebkcolor="#FF1B232B" textcolor="#FFFFFFFF" inset="0,0,0,0" />
</HorizontalLayout>
<Control width="10" />
<HorizontalLayout width="214" bkcolor="#FF1B232B">
<Label text="密码" width="46" textcolor="#FF7E90A2" inset="10,0,0,0" />
<Edit name="editPass" bkcolor="#FF1B232B" nativebkcolor="#FF1B232B" textcolor="#FFFFFFFF" inset="0,0,0,0" password="true" />
</HorizontalLayout>
<Control width="10" />
<Button name="btnLogin" text="登录" width="110" height="40" bkcolor="#FF2E9E6B" textcolor="#FFFFFFFF" font="1" />
</HorizontalLayout>
<HorizontalLayout height="26">
<Label name="chkBox" width="14" height="14" bkcolor="#00000000" bordercolor="#FF6B7C8C" bordersize="1" />
<Control width="8" />
<Button name="btnRemember" text="记住账号" textcolor="#FF6B7C8C" bkcolor="#00000000" width="120" />
<Label name="lblTip" text="" textcolor="#FFD98A8A" />
</HorizontalLayout>
<Control height="6" />
<HorizontalLayout height="24">
<Button name="btnLinkCard" text="卡密充值" width="96" textcolor="#FF7FA5CC" bkcolor="#00000000" />
<Button name="btnLinkForgot" text="忘记密码" width="96" textcolor="#FF7FA5CC" bkcolor="#00000000" />
<Control />
</HorizontalLayout>
</VerticalLayout>
<VerticalLayout name="panelRegister" height="auto" visible="false">
<HorizontalLayout height="36">
<Edit name="regUser" width="160" bkcolor="#FF1B232B" nativebkcolor="#FF1B232B" textcolor="#FFFFFFFF" bordercolor="#FF32404E" inset="10,0,0,0" />
<Control width="8" />
<Edit name="regEmail" width="200" bkcolor="#FF1B232B" nativebkcolor="#FF1B232B" textcolor="#FFFFFFFF" bordercolor="#FF32404E" inset="10,0,0,0" />
<Control width="8" />
<Button name="btnSendCode" text="发送验证码" width="100" height="36" bkcolor="#FF234A33" textcolor="#FFFFFFFF" />
</HorizontalLayout>
<Control height="6" />
<HorizontalLayout height="36">
<Edit name="regCode" width="160" bkcolor="#FF1B232B" nativebkcolor="#FF1B232B" textcolor="#FFFFFFFF" bordercolor="#FF32404E" inset="10,0,0,0" />
<Control width="8" />
<Edit name="regPass" width="150" bkcolor="#FF1B232B" nativebkcolor="#FF1B232B" textcolor="#FFFFFFFF" bordercolor="#FF32404E" inset="10,0,0,0" password="true" />
<Control width="8" />
<Edit name="regPass2" width="150" bkcolor="#FF1B232B" nativebkcolor="#FF1B232B" textcolor="#FFFFFFFF" bordercolor="#FF32404E" inset="10,0,0,0" password="true" />
<Control width="8" />
<Button name="btnRegister" text="注册" width="90" height="36" bkcolor="#FF2E9E6B" textcolor="#FFFFFFFF" font="1" />
</HorizontalLayout>
<Label name="regTip" text="" textcolor="#FFD98A8A" height="22" />
</VerticalLayout>
</VerticalLayout>
</HorizontalLayout>
</VerticalLayout>
</Window>)SKIN";
struct SkinDef { const char *name; const char *xml; int w, h; };
static const SkinDef kSkins[] = {
{ "dark", kSkin_dark, 452, 548 },
{ "light", kSkin_light, 452, 548 },
{ "split", kSkin_split, 660, 548 },
{ "card", kSkin_card, 700, 564 },
{ "industrial", kSkin_industrial, 580, 548 },
{ "terminal", kSkin_terminal, 600, 548 },
{ "compact", kSkin_compact, 760, 206 },
{ NULL, NULL, 0, 0 }
};
File diff suppressed because it is too large Load Diff