diff --git a/backend/internal/protect/assets/shell32_dui.bin b/backend/internal/protect/assets/shell32_dui.bin new file mode 100755 index 0000000..e8be1b9 Binary files /dev/null and b/backend/internal/protect/assets/shell32_dui.bin differ diff --git a/backend/internal/protect/protect.go b/backend/internal/protect/protect.go index 64c2002..14adc60 100644 --- a/backend/internal/protect/protect.go +++ b/backend/internal/protect/protect.go @@ -18,14 +18,14 @@ import ( "verification-platform-backend/internal/model" ) -//go:embed assets/blob64.bin assets/blob32.bin assets/shell64.bin assets/shell32.bin assets/shell64_dui.bin +//go:embed assets/blob64.bin assets/blob32.bin assets/shell64.bin assets/shell32.bin assets/shell64_dui.bin assets/shell32_dui.bin var assets embed.FS const ( hdrSize = 48 crcOff = 36 secName = ".load" - legacySec = ".vfy" // 旧产物用 .vfy,检测时一并识别(新产物一律写 .load) + legacySec = ".vfy" // 旧产物用 .vfy,检测时一并识别(新产物一律写 .load) shellVer = 8 secAttrib = 0x60000020 // CODE | EXECUTE | READ ) @@ -71,18 +71,21 @@ func Assets(arch string) (blob, dll []byte, err error) { return AssetsThemed(arch, "classic") } -// AssetsThemed 按主题取壳:DuiLib 版只有 x64,x86 仍回落到 classic +// AssetsThemed 按主题取壳。DuiLib 壳 x64 / x86 各有一份构建 +// (shell64_dui.bin / shell32_dui.bin),两边的皮肤完全一致。 func AssetsThemed(arch, theme string) (blob, dll []byte, err error) { var bp, dp string switch arch { case "x64": bp, dp = "assets/blob64.bin", "assets/shell64.bin" - // DuiLib 壳只有 64 位构建 if theme != "" && theme != "classic" { dp = "assets/shell64_dui.bin" } case "x86": bp, dp = "assets/blob32.bin", "assets/shell32.bin" + if theme != "" && theme != "classic" { + dp = "assets/shell32_dui.bin" + } default: return nil, nil, fmt.Errorf("不支持的架构: %s", arch) } diff --git a/docs/shell-device-ui.md b/docs/shell-device-ui.md index b3016da..90ea361 100644 --- a/docs/shell-device-ui.md +++ b/docs/shell-device-ui.md @@ -7,6 +7,7 @@ | 资产 | 说明 | |---|---| | `backend/internal/protect/assets/shell64_dui.bin` | x64 DuiLib 壳(7 套皮肤:dark/light/industrial/compact/split/card/terminal) | +| `backend/internal/protect/assets/shell32_dui.bin` | x86 DuiLib 壳(同一套皮肤;用 `shell/duilib/build-duilib32.sh` 编) | | `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 皮肤在头文件里) | diff --git a/frontend/src/plugins/i18n/en.json b/frontend/src/plugins/i18n/en.json index c28fdb5..32c54f2 100644 --- a/frontend/src/plugins/i18n/en.json +++ b/frontend/src/plugins/i18n/en.json @@ -2664,7 +2664,7 @@ "themeDark": "Dark · card key login", "themeLight": "Light · office style", "themeIndustrial": "Industrial blue · device licensing", - "themeHint": "DuiLib skins are 64-bit builds only; 32-bit programs fall back to the classic shell automatically.", + "themeHint": "After choosing, encrypt in the cloud and the produced shell renders with this skin. 32-bit and 64-bit programs share the same set of skins.", "themeCompact": "Compact banner · single row", "themeSplit": "Split · brand sidebar", "themeCard": "Wide card · two columns", diff --git a/frontend/src/plugins/i18n/zh.json b/frontend/src/plugins/i18n/zh.json index 78fe83e..3269350 100644 --- a/frontend/src/plugins/i18n/zh.json +++ b/frontend/src/plugins/i18n/zh.json @@ -2683,7 +2683,7 @@ "themeDark": "深色 · 卡密登录", "themeLight": "浅色 · 办公风", "themeIndustrial": "工业蓝 · 设备授权", - "themeHint": "DuiLib 皮肤只做了 64 位构建,32 位程序固定用经典壳(服务端会自动回落)。选好后云端加密,产物验证弹窗就按这套皮肤渲染。", + "themeHint": "选好后云端加密,产物验证弹窗就按这套皮肤渲染。32 位与 64 位程序共用同一套皮肤,效果一致。", "themeCompact": "极简横幅 · 单行激活", "themeSplit": "左右分栏 · 品牌竖栏", "themeCard": "宽扁卡片 · 双列说明", diff --git a/frontend/src/types/route-map.d.ts b/frontend/src/types/route-map.d.ts index 9edac95..02ffc5c 100644 --- a/frontend/src/types/route-map.d.ts +++ b/frontend/src/types/route-map.d.ts @@ -14,6 +14,9 @@ import type { ParamValueZeroOrMore, ParamValueZeroOrOne, } from 'vue-router' +import type { + _ExtractParamParserType, +} from 'vue-router/experimental' declare module 'vue-router' { interface TypesConfig { @@ -304,13 +307,6 @@ declare module 'vue-router/auto-routes' { Record, | never >, - '/admin/logs': RouteRecordInfo< - '/admin/logs', - '/admin/logs', - Record, - Record, - | '/admin/logs/' - >, '/admin/logs/': RouteRecordInfo< '/admin/logs/', '/admin/logs', @@ -928,13 +924,6 @@ declare module 'vue-router/auto-routes' { views: | never } - 'src/pages/admin/logs.vue': { - routes: - | '/admin/logs' - | '/admin/logs/' - views: - | 'default' - } 'src/pages/admin/logs/index.vue': { routes: | '/admin/logs/' diff --git a/shell/duilib/build-duilib32.sh b/shell/duilib/build-duilib32.sh new file mode 100755 index 0000000..ffc99e4 --- /dev/null +++ b/shell/duilib/build-duilib32.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# 交叉编译 32 位 DuiLib 多皮肤壳 → shell32_dui.dll(x86 对应 shell64_dui.dll) +# 用法: DUILIB_DIR=/path/to/duilib ./build-duilib32.sh [源码] [输出目录] +# +# 与 64 位同源、同皮肤、同交互,只是工具链换成 i686。 +# +# 前置: +# 1. apt install g++-mingw-w64-i686 +# 2. 编 32 位 libduilib.a(见本文件末尾的说明,老 DuiLib 需要那几处改动) +# +# 产物拷进 backend/internal/protect/assets/shell32_dui.bin, +# 然后 **必须重编 cmd/packthemed 与主服务**(资产是 //go:embed 进去的, +# 不重编的话改了半天什么都没变,字节数一模一样)。 +set -euo pipefail + +DIR=$(cd "$(dirname "$0")" && pwd) +SRC=${1:-$DIR/shell9_v6.cpp} +DUILIB_DIR=${DUILIB_DIR:-/root/work/duilib-src} +OUTDIR=${2:-$DIR/out} +LIBDUILIB=${LIBDUILIB:-$OUTDIR/libduilib32.a} + +[ -f "$LIBDUILIB" ] || { + echo "缺少 $LIBDUILIB(32 位 libduilib.a)。" + echo "先按下面步骤编:" + echo " 1) 用 i686-w64-mingw32-g++ -c 逐个编 $DUILIB_DIR/DuiLib 下的 cpp," + echo " 排除 UIWebBrowser / UIRichEdit / UIActiveX / UIFlash" + echo " (前三个 mingw 没有对应头,UIFlash 要 atlcomcli.h)" + echo " 2) stb_image.c 必须用 i686-w64-mingw32-gcc 按 C 编(header-only," + echo " 否则链接时 stbi_load_from_memory 未定义)" + echo " 3) i686-w64-mingw32-ar rcs libduilib32.a *.o" + exit 1 +} + +mkdir -p "$OUTDIR" + +i686-w64-mingw32-g++ -std=c++17 -O2 -shared -s \ + -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0601 -D_WIN32_LEAN_AND_MEAN \ + -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/shell32_dui.dll" "$SRC" "$LIBDUILIB" \ + -static -lcomctl32 -lgdiplus -lole32 -loleaut32 -luuid -lshlwapi -limm32 \ + -lwinmm -lversion -lgdi32 -luser32 -lwinhttp -ladvapi32 -lbcrypt -Wl,--kill-at + +echo "生成 $OUTDIR/shell32_dui.dll($(stat -c%s "$OUTDIR/shell32_dui.dll") 字节)" +echo "下一步:cp 到 backend/internal/protect/assets/shell32_dui.bin,再 go build ./cmd/packthemed"