Author SHA1 Message Date
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
admin 7515565660 feat(i18n): 界面文案「加壳/加固」统一改为「云端加密」(中英双语 + 路由标题 + 后端提示) 2026-11-23 19:26:50 +08:00
admin 24e3f7b811 merge feat/doglic:自签授权验签 + 双重加壳兼容 + 壳源码入库
Docker Build / Build and Push Docker Image (push) Successful in 31s
Docker Build / Deploy to Server (push) Successful in 3s
2026-11-23 19:18:32 +08:00
admin 77e59f021c feat(protect): 加 cmd/packthemed,按 shell_theme 出各套验证界面产物(拍照/回归用) 2026-11-23 19:16:56 +08:00
19 changed files with 7315 additions and 47 deletions
+39
View File
@@ -0,0 +1,39 @@
// 按主题打壳:packtest 固定用 classic 壳,这个工具多了 theme 参数,用来出各套验证界面
// 用法: packthemed <src.exe> <out.exe> <cfg.json> <theme>
package main
import (
"fmt"
"os"
"path/filepath"
"verification-platform-backend/internal/protect"
)
func main() {
if len(os.Args) != 5 {
fmt.Fprintln(os.Stderr, "用法: packthemed <src.exe> <out.exe> <cfg.json> <theme>")
os.Exit(2)
}
src, err := os.ReadFile(os.Args[1])
must(err)
cfg, err := os.ReadFile(os.Args[3])
must(err)
arch, err := protect.DetectArch(src)
must(err)
theme := protect.NormalizeTheme(os.Args[4])
out, info, err := protect.PatchSignedThemed(src, cfg, arch, false, theme)
must(err)
must(os.WriteFile(os.Args[2], out, 0o644))
fmt.Printf("%-10s 架构=%s 产物=%s %d 字节 .vfy size=%d\n",
theme, arch, filepath.Base(os.Args[2]), info.OutSize, info.SecSize)
}
func must(err error) {
if err != nil {
fmt.Fprintln(os.Stderr, "error:", err)
os.Exit(1)
}
}
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -335,7 +335,7 @@ func ParsePFX(data []byte, password string) (PFXInfo, error) {
case info.KeyCount == 1 && info.CertCount > 1:
info.Note = fmt.Sprintf("含 %d 张证书(1 套私钥 + %d 张链上证书),签名会带完整证书链", info.CertCount, info.LooseCerts)
case info.KeyCount > 1:
info.Note = fmt.Sprintf("含 %d 套可签名身份(私钥 %d 把),加壳时可任选其中一套",
info.Note = fmt.Sprintf("含 %d 套可签名身份(私钥 %d 把),云端加密时可任选其中一套",
len(matched), info.KeyCount)
}
return info, nil
+1 -1
View File
@@ -404,7 +404,7 @@ func (r *Runner) RunWithTask(task *model.ProtectTask, srcPath, outPath string, c
// 内核驱动(.sys / 子系统 NATIVE):绝不能塞用户态验证壳,注进去驱动直接加载失败。
// 驱动要的是 Authenticode 签名,所以这里只签名、不注入。
if task.SignProfileID == nil {
return info, fmt.Errorf("内核驱动只能签名、不能加壳;请选择一张支持驱动签名用途的证书")
return info, fmt.Errorf("内核驱动只能签名、不能加密;请选择一张支持驱动签名用途的证书")
}
mat, merr := LoadMaterial(*task.SignProfileID, task.CertIdentity)
if merr != nil {
+1 -1
View File
@@ -32,7 +32,7 @@ type PublishOptions struct {
func PublishAsVersion(taskID uint, opts PublishOptions) (*model.Version, error) {
var task model.ProtectTask
if err := database.DB.First(&task, taskID).Error; err != nil {
return nil, fmt.Errorf("加壳任务不存在")
return nil, fmt.Errorf("云端加密任务不存在")
}
if task.Status != "done" || task.OutputPath == "" {
return nil, fmt.Errorf("任务尚未完成,无法生成版本")
+1 -1
View File
@@ -34,7 +34,7 @@ func createTask(app *model.Application, userID uint, srcName string, data []byte
return nil, "", err
}
if det.Kind == KindPE && HasVfy(data) {
return nil, "", fmt.Errorf("这个文件已经是加壳后的产物(带 .vfy 节),请上传未加壳的原始程序")
return nil, "", fmt.Errorf("这个文件已经是云端加密后的产物(带 .vfy 节),请上传未加密的原始程序")
}
// 签名证书必须在建任务时就落库:execute 是 go 协程,事后 UPDATE 有窗口
// 被它读到 NULL,导致证书被静默忽略(任务照样成功,只是没重签)。
@@ -200,7 +200,7 @@ func HandleCreateSignProfile(c *gin.Context) {
msg := "证书已加密保存"
if pfx.KeyCount > 1 {
msg = fmt.Sprintf("证书已保存:文件里含 %d 套可签名身份,加壳时可任选其中一套", pfx.KeyCount)
msg = fmt.Sprintf("证书已保存:文件里含 %d 套可签名身份,云端加密时可任选其中一套", pfx.KeyCount)
}
response.SuccessWithMessage(c, msg, gin.H{
"id": made.ID,
+3 -3
View File
@@ -58,7 +58,7 @@ const statusFilter = ref<string>('')
// 按文件类型决定需要哪种证书:PE→windows,IPA→ios,APK/ELF 不吃证书
const fileKind = computed(() => {
const n = (chosenFile.value?.name || '').toLowerCase()
// 内核驱动:.sys 只能签名、不能加壳(用户态壳注进内核模块会直接加载失败)
// 内核驱动:.sys 只能签名、不能加密(用户态壳注进内核模块会直接加载失败)
if (n.endsWith('.sys')) return 'driver'
if (n.endsWith('.exe') || n.endsWith('.dll')) return 'pe'
if (n.endsWith('.ipa')) return 'ipa'
@@ -247,7 +247,7 @@ function schedulePoll() {
function pickFile(file: File | null | undefined) {
if (!file)
return
// 驱动 .sys 也走这条路(驱动只签名、不加壳)
// 驱动 .sys 也走这条路(驱动只签名、不加密)
if (!/\.(exe|dll|sys|efi|apk|ipa)$/i.test(file.name)) {
toast.error(t('admin.protect.onlyExe'))
return
@@ -535,7 +535,7 @@ onBeforeUnmount(() => {
{{ certOptionsForFile.length ? t('admin.protect.signProfileHint') : t('admin.protect.signProfileEmpty') }}
</p>
<!-- 验证界面皮肤:加壳时选择,产物里的壳按此渲染 -->
<!-- 验证界面皮肤:云端加密时选择,产物里的壳按此渲染 -->
<div class="flex flex-col gap-3 sm:flex-row sm:items-center">
<UiLabel class="shrink-0 text-sm font-medium">
{{ t('admin.protect.themeLabel') }}
+1 -1
View File
@@ -437,7 +437,7 @@ onMounted(() => {
</div>
<div v-else class="space-y-6">
<!-- 加壳来源提示 -->
<!-- 云端加密来源提示 -->
<div
v-if="protectInfo.protected"
class="flex flex-wrap items-center gap-3 rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-4 py-3 text-sm"
+14 -14
View File
@@ -1550,13 +1550,13 @@
"fetchFailed": "Failed to fetch version information",
"fetchAppsFailed": "Failed to fetch application list"
},
"protectedBadge": "Protected",
"protectedHint": "This version is a protected artifact with the verification shell",
"protectedBanner": "This version was generated by the protect tool",
"protectedBadge": "Encrypted",
"protectedHint": "This version is a cloud-encrypted artifact with the verification shell",
"protectedBanner": "This version was generated by cloud encryption",
"derivedFrom": "derived from",
"sourceUnknown": "source version removed",
"viewProtectTask": "View protect task #{id}",
"sourceDirect": "uploaded & protected"
"viewProtectTask": "View cloud-encryption task #{id}",
"sourceDirect": "uploaded & cloud-encrypted"
},
"cardTypes": {
"title": "Card Type Management",
@@ -2577,7 +2577,7 @@
}
},
"protect": {
"title": "Protection",
"title": "Cloud Encryption",
"description": "Inject a verification shell into your program: entry rewrite + in-memory DLL + dual CRC32, single-file output",
"totalTasks": "Total tasks",
"inProgress": "In progress",
@@ -2591,11 +2591,11 @@
"tooLarge": "File too large (max 200MB)",
"pickApp": "Choose an application first",
"pickFile": "Choose a program first",
"queued": "Submitted, protecting…",
"queued": "Submitted, encrypting…",
"uploading": "Uploading",
"start": "Start",
"clear": "Clear",
"tasks": "Protection tasks",
"tasks": "Cloud Encryption tasks",
"source": "Source / output",
"arch": "Arch",
"status": "Status",
@@ -2604,10 +2604,10 @@
"download": "Download",
"refresh": "Refresh",
"loading": "Loading…",
"empty": "No protection tasks yet",
"empty": "No cloud-encryption tasks yet",
"allStatus": "All status",
"statusPending": "Queued",
"statusRunning": "Protecting",
"statusRunning": "Encrypting",
"statusDone": "Completed",
"statusFailed": "Failed",
"busy": "Task is running, try later",
@@ -2616,7 +2616,7 @@
"loadFailed": "Failed to load tasks",
"loadAppsFailed": "Failed to load applications",
"makeVersion": "Create version",
"makeVersionHint": "Write the protected artifact as a new version record: clients decide updates by increasing version-record id, so replacing an already-published file in place never propagates.",
"makeVersionHint": "Write the cloud-encrypted artifact as a new version record: clients decide updates by increasing version-record id, so replacing an already-published file in place never propagates.",
"versionLabel": "Version",
"versionPlaceholder": "Leave empty to auto-bump the source version",
"strategy": "Update strategy",
@@ -2673,7 +2673,7 @@
},
"signProfiles": {
"title": "Signing certificates",
"description": "Upload Windows pfx / iOS p12+provision; protected artifacts are re-signed with them. Certs and passwords are encrypted at rest and never sent back",
"description": "Upload Windows pfx / iOS p12+provision; cloud-encrypted artifacts are re-signed with them. Certs and passwords are encrypted at rest and never sent back",
"uploadTitle": "Upload certificate",
"uploadHint": "Windows uses .pfx/.p12; iOS needs both .p12 and .mobileprovision",
"platform": "Platform",
@@ -2717,7 +2717,7 @@
"expired": "Expired",
"daysLeft": "days left",
"colCerts": "Certificates",
"uploadedSplit": "Parsed {n} identities from this file; {n} records created. Pick any one when protecting.",
"uploadedSplit": "Parsed {n} identities from this file; {n} records created. Pick any one when cloud-encrypting.",
"colSubject": "Certificate name (CN)",
"identities": "Identities",
"identitiesTitle": "Certificate identities",
@@ -3415,7 +3415,7 @@
"storage": "Storage",
"admin": "Admin",
"agent": "Agent",
"protect": "Protection",
"protect": "Cloud Encryption",
"signProfiles": "Certificates"
},
"footer": {
+17 -17
View File
@@ -1546,13 +1546,13 @@
"fetchFailed": "获取版本信息失败",
"fetchAppsFailed": "获取应用列表失败"
},
"protectedBadge": "已加固",
"protectedHint": "此版本是加壳产物,入口文件带验证壳",
"protectedBanner": "此版本由加壳工具生成",
"protectedBadge": "已加密",
"protectedHint": "此版本是云端加密产物,入口文件带验证壳",
"protectedBanner": "此版本由云端加密服务生成",
"derivedFrom": "派生自",
"sourceUnknown": "来源版本已删除",
"viewProtectTask": "查看加壳任务 #{id}",
"sourceDirect": "直接上传加壳"
"viewProtectTask": "查看云端加密任务 #{id}",
"sourceDirect": "直接上传云端加密"
},
"cardTypes": {
"title": "卡类管理",
@@ -2596,7 +2596,7 @@
}
},
"protect": {
"title": "加壳加固",
"title": "云端加密",
"description": "给程序注入验证壳:改入口 + 内存加载壳 DLL + 双层 CRC32,产物单文件、免安装依赖",
"totalTasks": "任务总数",
"inProgress": "进行中",
@@ -2609,12 +2609,12 @@
"onlyExe": "支持 .exe / .dll / .apk / .ipa / Linux ELF",
"tooLarge": "文件过大(上限 200MB)",
"pickApp": "请先选择应用",
"pickFile": "请先选择要加壳的程序",
"queued": "已提交,正在加壳",
"pickFile": "请先选择要加密的程序",
"queued": "已提交,正在云端加密",
"uploading": "上传中",
"start": "开始加壳",
"start": "开始云端加密",
"clear": "清除",
"tasks": "加壳任务",
"tasks": "云端加密任务",
"source": "源文件 / 产物",
"arch": "架构",
"status": "状态",
@@ -2623,10 +2623,10 @@
"download": "下载",
"refresh": "刷新",
"loading": "加载中…",
"empty": "还没有加壳任务",
"empty": "还没有云端加密任务",
"allStatus": "全部状态",
"statusPending": "排队中",
"statusRunning": "加壳中",
"statusRunning": "加密中",
"statusDone": "已完成",
"statusFailed": "失败",
"busy": "任务执行中,稍后再删",
@@ -2635,7 +2635,7 @@
"loadFailed": "加载任务失败",
"loadAppsFailed": "加载应用失败",
"makeVersion": "生成版本",
"makeVersionHint": "把加壳产物写成一条新的版本记录:客户端按版本记录 ID 递增判定更新,原地换包推不下去。其余资源文件沿用来源版本。",
"makeVersionHint": "把云端加密产物写成一条新的版本记录:客户端按版本记录 ID 递增判定更新,原地换包推不下去。其余资源文件沿用来源版本。",
"versionLabel": "版本号",
"versionPlaceholder": "留空则按来源版本末段 +1",
"strategy": "更新策略",
@@ -2681,7 +2681,7 @@
"themeDark": "深色 · 卡密登录",
"themeLight": "浅色 · 办公风",
"themeIndustrial": "工业蓝 · 设备授权",
"themeHint": "DuiLib 皮肤目前 64 位生效;32 位程序仍用经典壳。选好皮肤后加壳,产物弹窗就按该皮肤渲染。",
"themeHint": "DuiLib 皮肤目前 64 位生效;32 位程序仍用经典壳。选好皮肤后云端加密,产物弹窗就按该皮肤渲染。",
"themeCompact": "极简横幅 · 单行激活",
"themeSplit": "左右分栏 · 品牌竖栏",
"themeCard": "宽扁卡片 · 双列说明",
@@ -2692,7 +2692,7 @@
},
"signProfiles": {
"title": "签名证书",
"description": "上传 Windows pfx / iOS p12+描述文件,加壳产物用它们重签;证书与口令一律加密存储,永不下发前端",
"description": "上传 Windows pfx / iOS p12+描述文件,云端加密产物用它们重签;证书与口令一律加密存储,永不下发前端",
"uploadTitle": "上传证书",
"uploadHint": "Windows 用 .pfx/.p12;iOS 需要 .p12 + .mobileprovision 两件套",
"platform": "平台",
@@ -2736,7 +2736,7 @@
"expired": "已过期",
"daysLeft": "天后过期",
"colCerts": "证书数",
"uploadedSplit": "已从该文件解析出 {n} 套证书,分别建了 {n} 条记录,加壳时可任选一套",
"uploadedSplit": "已从该文件解析出 {n} 套证书,分别建了 {n} 条记录,云端加密时可任选一套",
"colSubject": "证书名称(CN)",
"identities": "身份列表",
"identitiesTitle": "证书身份",
@@ -3434,7 +3434,7 @@
"storage": "存储",
"admin": "管理员",
"agent": "代理商",
"protect": "加壳加固",
"protect": "云端加密",
"signProfiles": "签名证书"
},
"footer": {
+1 -1
View File
@@ -111,7 +111,7 @@ const routes: RouteRecordRaw[] = [
path: 'protect',
name: 'AdminProtect',
component: () => import('@/pages/admin/protect/index.vue'),
meta: { title: '加壳加固 - 管理后台' },
meta: { title: '云端加密 - 管理后台' },
},
{
path: 'sign-profiles',
+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