diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..1e8dfe4 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,21 @@ +#!/bin/sh +# Boss Key pre-commit:文档与文案的 i18n 一致性检查。 +# +# 只在暂存区涉及 docs/、前端或 crates/ 时才跑对应检查,与本次提交无关的部分直接跳过。 +# 启用方式(每个克隆一次):git config core.hooksPath .githooks +# 确有需要时可跳过:git commit --no-verify + +set -e + +root=$(git rev-parse --show-toplevel) + +if command -v pwsh >/dev/null 2>&1; then + shell=pwsh +elif command -v powershell >/dev/null 2>&1; then + shell=powershell +else + echo "pre-commit:未找到 PowerShell,跳过 i18n 检查" >&2 + exit 0 +fi + +"$shell" -NoProfile -File "$root/scripts/i18n-check.ps1" -Staged diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index c1ed632..0970760 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -42,6 +42,12 @@ jobs: shell: pwsh run: ./scripts/version.ps1 check + # ---- 文案:引用的键是否存在、有无死键、Msg 是否登记进 ALL_MSGS ---- + # catalog 内部的键集 / 占位符由下面的 npm test 覆盖,这里跳过免得跑两遍。 + - name: i18n consistency check + shell: pwsh + run: ./scripts/i18n-check.ps1 -SkipVitest + # ---- 前端:依赖 / 单元测试 / 构建 ---- - name: Frontend install, test & build run: | diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 22c91a1..fa2b2c1 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -10,10 +10,11 @@ on: push: branches: ["main", "dev"] paths: - - "/docs/**" - - "/package.json" - - "/pnpm-lock.yaml" - - "/.github/workflows/deploy-docs.yml" + - "docs/**" + - "scripts/i18n-check.ps1" + - "package.json" + - "pnpm-lock.yaml" + - ".github/workflows/deploy-docs.yml" release: types: [published, edited, deleted] workflow_dispatch: @@ -52,8 +53,17 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + # 三语文档配套与站内链接的一致性;跳过 catalog 单测(这里没装前端依赖, + # 那部分由 build-test.yml 的 npm test 覆盖)。 + - name: i18n consistency check + shell: pwsh + run: ./scripts/i18n-check.ps1 -SkipVitest + # 旧版客户端仍通过 Pages 上的 releases.json 检查更新,这里用 curl+jq(runner 自带,免安装) # 重新生成它,替代原来单独的 jekyll-gh-pages 工作流。 + # + # 必须滤掉草稿:Actions 的 token 有 push 权限,/releases 会把未发布的草稿一并返回, + # 不过滤就会把还没发的版本推给老客户端。 - name: Update releases.json env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -62,7 +72,9 @@ jobs: -H "Authorization: Bearer $GH_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/releases" \ - | jq 'map({tag_name, published_at, body, assets: [.assets[] | {name, browser_download_url}]}) | sort_by(.published_at)' \ + | jq 'map(select(.draft == false) + | {tag_name, published_at, body, assets: [.assets[] | {name, browser_download_url}]}) + | sort_by(.published_at)' \ > docs/public/releases.json - name: Build with VitePress diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d489a4a..9ace456 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,42 +1,93 @@ name: Release -# 构建并发布一个已存在的 tag。 +# 构建并发布一个已随合并进入 main 的 tag。 # -# 两种进入方式: -# 1. 直接推送 v* tag(手动打的 tag); -# 2. 由 tag.yml 通过 workflow_call 调用 —— 用默认 GITHUB_TOKEN 推的 tag 不会触发 -# 上面的 push 事件,所以 tag.yml 必须显式调用本工作流,而不能指望 tag 推送。 +# 触发方式: +# 1. 推送到 main —— tag.yml 事先把版本号提交与 v* tag 落在 dev,等 dev → main 的 +# PR 合并,tag 随之进入 main 的历史,这里检测到就构建; +# 2. 手动触发(workflow_dispatch),指定 tag —— 用于重跑或补发。 +# +# 为什么不监听 push: tags:tag 是 tag.yml 用 GITHUB_TOKEN 推到 dev 的,那次推送 +# 不会触发任何工作流;而 PR 合并本身**不产生 tag 推送事件**(tag 是独立的 ref, +# 合并只是让它指向的提交变得可从 main 追溯)。所以只能从 main 的 push 事件里检测。 on: push: - tags: - - "v*" - workflow_call: + branches: ["main"] + workflow_dispatch: inputs: tag: - description: "要发布的 tag,例如 v3.0.1" + description: "要构建发布的 tag,例如 v3.0.1" required: true type: string -concurrency: - group: release-${{ inputs.tag || github.ref_name }} - cancel-in-progress: false - jobs: + # 找出「这次推送新带进 main 的 v* tag」。 + # 不能用「HEAD 上挂着的 tag」:merge commit 才是 HEAD,tag 指向的是它的父提交。 + detect: + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.find.outputs.tag }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # 需要完整历史与全部 tag 才能算可达性 + + - name: Find newly merged release tag + id: find + env: + INPUT_TAG: ${{ inputs.tag }} + BEFORE: ${{ github.event.before }} + run: | + set -euo pipefail + + if [ -n "${INPUT_TAG}" ]; then + echo "手动指定:${INPUT_TAG}" + echo "tag=${INPUT_TAG}" >> "$GITHUB_OUTPUT" + exit 0 + fi + + # 推送前 main 上已可追溯的 v* tag。新建分支 / 强推时 before 可能不可用, + # 那就当作「之前一个都没有」,让下面取到最新的一个。 + if [ -n "${BEFORE:-}" ] && git cat-file -e "${BEFORE}^{commit}" 2>/dev/null; then + git tag --merged "${BEFORE}" --list 'v*' | sort > /tmp/before.txt + else + : > /tmp/before.txt + fi + git tag --merged HEAD --list 'v*' | sort > /tmp/after.txt + + # 一次合并正常只带进一个;真有多个就取版本号最大的 + tag=$(comm -13 /tmp/before.txt /tmp/after.txt | sort -V | tail -n 1) + + if [ -z "$tag" ]; then + echo "本次推送没有新的 v* tag 进入 main,跳过发布" + else + echo "检测到新进入 main 的 tag:$tag" + fi + echo "tag=$tag" >> "$GITHUB_OUTPUT" + build-and-release: + needs: detect + if: needs.detect.outputs.tag != '' runs-on: windows-latest permissions: contents: write id-token: write # attest-build-provenance 取 OIDC token attestations: write # 写入构建来源证明 + concurrency: + group: release-${{ needs.detect.outputs.tag }} + cancel-in-progress: false env: - TAG: ${{ inputs.tag || github.ref_name }} + TAG: ${{ needs.detect.outputs.tag }} steps: + # 构建 tag 指向的那个提交,而不是 main 的 merge commit: + # 前者才是版本号提交本身,与 version.ps1 check 的校验对象一致。 - name: Checkout repository uses: actions/checkout@v4 with: - ref: ${{ inputs.tag || github.ref_name }} + ref: ${{ needs.detect.outputs.tag }} # tag 与代码里的版本号必须一致,否则装出来的包版本号是错的 - name: Verify version matches tag @@ -103,12 +154,29 @@ jobs: # /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ` # "dist/Boss-Key/Boss Key.exe" dist/Boss-Key/config.exe dist/installer/Boss-Key-*-Setup.exe + # 发布说明 = GitHub 自动生成的更新日志 + 结尾的安全提示。 + # 创建 Release 时若同时传 body 和 generate_release_notes,自定义内容只会被 + # 放在自动生成内容**之前**,所以这里先调 generate-notes API 拿到更新日志, + # 再手动把安全提示拼在末尾。 + - name: Compose release notes + shell: pwsh + env: + GH_TOKEN: ${{ github.token }} + run: | + $notes = (gh api "repos/$env:GITHUB_REPOSITORY/releases/generate-notes" -f tag_name="$env:TAG" --jq '.body') -join "`n" + $notice = @' + > [!WARNING] + > 【安全提示】 + > 本软件中运用了大量的系统底层API,并且提供开机自启、热键监控、窗口冻结等功能,容易被杀毒软件识别为木马病毒,但是程序本身完全开源、免费,并不包含病毒、木马行为,请放心使用。请务必从官方渠道下载和使用程序,运行程序前通过文件哈希、文件签名等方式验证文件的真实性,谨防利用软件信任伪装的病毒程序。 + '@ + Set-Content -Path release-notes.md -Value ($notes + "`n`n" + $notice) -Encoding utf8 + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: name: Boss Key ${{ env.TAG }} tag_name: ${{ env.TAG }} - generate_release_notes: true + body_path: release-notes.md draft: true prerelease: ${{ steps.version.outputs.is_prerelease == 'true' }} make_latest: ${{ steps.version.outputs.is_prerelease != 'true' }} diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index ba1930d..e72d502 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -1,9 +1,18 @@ name: Bump version and tag -# 手动触发的发版入口:填一个版本号,工作流会 +# 手动触发的发版准备。**请从 dev 分支触发**(bot 已在 dev 的分支保护里放行)。 +# +# 流程: # 1. 把版本号写进 Cargo.toml / tauri.conf.json / package.json / Cargo.lock; -# 2. 提交这次改动并推回当前分支,然后打上 v<版本号> 的 tag 并推送; -# 3. 调用 release.yml 构建并发布 GitHub Release。 +# 2. 提交到 dev 并打上 v<版本> tag,两者一起推送; +# 3. 确保有一个 dev → main 的 PR(没有就开一个)。 +# +# 这里**不构建**。用 GITHUB_TOKEN 推的 tag 不会触发任何工作流,正合本流程的意图: +# 等你把 PR 合并进 main、tag 随之进入 main 的历史,release.yml 才开始生产构建。 +# +# ⚠ 合并该 PR 时请用 **merge commit**(不要 squash / rebase): +# tag 指向 dev 上的那个提交,squash 会另造提交,tag 就进不了 main 的历史, +# release.yml 也就检测不到、不会构建。 on: workflow_dispatch: @@ -12,18 +21,34 @@ on: description: "要发布的版本号,例如 3.0.1 或 3.1.0-rc.1(可带前导 v)" required: true type: string + base: + description: "发版 PR 的目标分支" + required: false + default: main + type: string jobs: bump: runs-on: windows-latest permissions: - contents: write - outputs: - tag: ${{ steps.bump.outputs.tag }} + contents: write # 推版本号提交与 tag + pull-requests: write # 开发版 PR steps: - name: Checkout repository uses: actions/checkout@v4 + # 从 main 触发的话,下面的 PR 会变成 main → main + - name: Reject running from the base branch + shell: pwsh + env: + SOURCE: ${{ github.ref_name }} + BASE: ${{ inputs.base }} + run: | + if ($env:SOURCE -eq $env:BASE) { + Write-Host "::error::本工作流应从 dev 触发,当前分支 $env:SOURCE 与目标分支相同" + exit 1 + } + - name: Set up Rust uses: dtolnay/rust-toolchain@stable @@ -35,7 +60,7 @@ jobs: shell: pwsh run: ./scripts/version.ps1 apply "${{ inputs.version }}" - - name: Commit, tag and push + - name: Commit and tag id: bump shell: pwsh env: @@ -56,21 +81,53 @@ jobs: git add Cargo.toml Cargo.lock apps/config/src-tauri/tauri.conf.json apps/config/ui/package.json git commit -m "chore(release): $tag" - git tag $tag + if ($LASTEXITCODE -ne 0) { throw "提交版本号失败(版本号是否已经是 $env:VERSION?)" } + + # 带 message 的附注 tag(git describe 认它)。显式关掉签名: + # 机器人没有密钥,谁要是在本机跑这套命令,全局的 tag.gpgsign 会让裸 git tag 直接失败。 + git -c tag.gpgSign=false tag -a $tag -m "Boss Key $tag" + if ($LASTEXITCODE -ne 0) { throw "创建 tag $tag 失败" } git push origin "HEAD:$env:BRANCH" + if ($LASTEXITCODE -ne 0) { throw "推送 $env:BRANCH 失败(bot 是否已在分支保护里放行?)" } git push origin "refs/tags/$tag" + if ($LASTEXITCODE -ne 0) { throw "推送 tag $tag 失败(仓库是否配了 tag 保护规则?)" } "tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 - # 构建并发布刚刚推上去的 tag - release: - needs: bump - permissions: - contents: write - id-token: write - attestations: write - uses: ./.github/workflows/release.yml - secrets: inherit - with: - tag: ${{ needs.bump.outputs.tag }} + # 发版 PR 通常已经存在(你正准备把 dev 合进 main),没有才开一个。 + # 用 PAT 开的 PR 才会触发 build-test.yml;退回 GITHUB_TOKEN 时 PR 上没有检查记录, + # 但你点 Merge 触发的 push 事件仍会正常跑 build-test.yml。 + - name: Ensure release pull request + shell: pwsh + env: + GH_TOKEN: ${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }} + TAG: ${{ steps.bump.outputs.tag }} + BASE: ${{ inputs.base }} + SOURCE: ${{ github.ref_name }} + run: | + $existing = gh pr list --base $env:BASE --head $env:SOURCE --state open --json url --jq '.[0].url' + if ($existing) { + Write-Host "已有 $env:SOURCE → $env:BASE 的 PR:$existing" + Write-Host "版本号提交与 tag $env:TAG 已经在这个 PR 里了" + exit 0 + } + + $body = @" + 由 ``tag.yml`` 自动创建。 + + - 版本号已写入 Cargo.toml / tauri.conf.json / package.json / Cargo.lock + - tag ``$env:TAG`` 已指向 ``$env:SOURCE`` 上的版本号提交 + + 合并后 tag 随之进入 ``$env:BASE`` 的历史,``release.yml`` 会检测到并开始生产构建。 + + 请用 **merge commit** 合并(不要 squash / rebase),否则 tag ``$env:TAG`` + 进不了 ``$env:BASE`` 的历史,构建不会触发。 + "@ + + # 经文件传正文:中文走命令行参数有被终端编码改写的风险,写成 UTF-8 文件更稳 + [System.IO.File]::WriteAllText("pr-body.md", $body, (New-Object System.Text.UTF8Encoding($false))) + + gh pr create --base $env:BASE --head $env:SOURCE ` + --title "release: $env:TAG" --body-file pr-body.md + if ($LASTEXITCODE -ne 0) { throw "创建发版 PR 失败" } diff --git a/Cargo.lock b/Cargo.lock index 88aa831..fbabbd2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -288,19 +288,18 @@ dependencies = [ [[package]] name = "bosskey-common" -version = "3.0.0" +version = "3.1.0-rc.1" dependencies = [ "regex", "serde", "serde_json", "tempfile", "thiserror 2.0.18", - "ureq", ] [[package]] name = "bosskey-config" -version = "3.0.0" +version = "3.1.0-rc.1" dependencies = [ "bosskey-common", "bosskey-core", @@ -309,11 +308,13 @@ dependencies = [ "tauri", "tauri-build", "tauri-plugin-single-instance", + "tempfile", + "verhub-sdk", ] [[package]] name = "bosskey-core" -version = "3.0.0" +version = "3.1.0-rc.1" dependencies = [ "bosskey-common", "serde", @@ -491,6 +492,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + [[package]] name = "chrono" version = "0.4.45" @@ -528,29 +535,10 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" dependencies = [ - "percent-encoding", "time", "version_check", ] -[[package]] -name = "cookie_store" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206" -dependencies = [ - "cookie", - "document-features", - "idna", - "indexmap 2.14.0", - "log", - "serde", - "serde_derive", - "serde_json", - "time", - "url", -] - [[package]] name = "core-foundation" version = "0.10.1" @@ -576,7 +564,7 @@ dependencies = [ "bitflags 2.13.0", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -825,15 +813,6 @@ dependencies = [ "syn 2.0.118", ] -[[package]] -name = "document-features" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" -dependencies = [ - "litrs", -] - [[package]] name = "dom_query" version = "0.27.0" @@ -1048,6 +1027,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared 0.1.1", +] + [[package]] name = "foreign-types" version = "0.5.0" @@ -1055,7 +1043,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ "foreign-types-macros", - "foreign-types-shared", + "foreign-types-shared 0.3.1", ] [[package]] @@ -1069,6 +1057,12 @@ dependencies = [ "syn 2.0.118", ] +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "foreign-types-shared" version = "0.3.1" @@ -1564,6 +1558,22 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.20" @@ -1955,12 +1965,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" -[[package]] -name = "litrs" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" - [[package]] name = "lock_api" version = "0.4.14" @@ -2050,6 +2054,23 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "ndk" version = "0.9.0" @@ -2080,6 +2101,18 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +dependencies = [ + "bitflags 2.13.0", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "num-conv" version = "0.2.2" @@ -2111,7 +2144,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.5.0", "proc-macro2", "quote", "syn 2.0.118", @@ -2240,6 +2273,7 @@ checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ "bitflags 2.13.0", "block2", + "libc", "objc2", "objc2-core-foundation", ] @@ -2318,6 +2352,49 @@ version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +[[package]] +name = "openssl" +version = "0.10.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" +dependencies = [ + "bitflags 2.13.0", + "cfg-if", + "foreign-types 0.3.2", + "libc", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -2334,6 +2411,21 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "os_info" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf20a545b305cf1da722b236b5155c9bb35f1d5ceb28c048bd96ca842f41b5b" +dependencies = [ + "android_system_properties", + "log", + "nix", + "objc2", + "objc2-foundation", + "objc2-ui-kit", + "windows-sys 0.61.2", +] + [[package]] name = "pango" version = "0.18.3" @@ -2713,50 +2805,72 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "reqwest" -version = "0.13.4" +version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ "base64 0.22.1", "bytes", "futures-core", - "futures-util", "http", "http-body", "http-body-util", "hyper", + "hyper-tls", "hyper-util", "js-sys", "log", + "native-tls", "percent-encoding", "pin-project-lite", + "rustls-pki-types", "serde", "serde_json", + "serde_urlencoded", "sync_wrapper", "tokio", - "tokio-util", + "tokio-native-tls", "tower", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", ] [[package]] -name = "ring" -version = "0.17.14" +name = "reqwest" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.17", - "libc", - "untrusted", - "windows-sys 0.52.0", + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", ] [[package]] @@ -2787,21 +2901,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "rustls" -version = "0.23.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c54fcab019b409d04215d3a17cb438fd7fbf192ee61461f20f4fe18704bc138" -dependencies = [ - "log", - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - [[package]] name = "rustls-pki-types" version = "1.15.0" @@ -2812,21 +2911,16 @@ dependencies = [ ] [[package]] -name = "rustls-webpki" -version = "0.103.13" +name = "rustversion" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] -name = "rustversion" +name = "ryu" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "same-file" @@ -2837,6 +2931,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "schemars" version = "0.8.22" @@ -2894,6 +2997,29 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags 2.13.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "selectors" version = "0.36.1" @@ -3018,6 +3144,18 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "serde_with" version = "3.21.0" @@ -3226,12 +3364,6 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - [[package]] name = "swift-rs" version = "1.0.7" @@ -3384,7 +3516,7 @@ dependencies = [ "percent-encoding", "plist", "raw-window-handle", - "reqwest", + "reqwest 0.13.4", "serde", "serde_json", "serde_repr", @@ -3713,6 +3845,16 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.18" @@ -3941,7 +4083,7 @@ dependencies = [ "png 0.18.1", "serde", "thiserror 2.0.18", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4026,44 +4168,6 @@ version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "ureq" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0" -dependencies = [ - "base64 0.22.1", - "cookie_store", - "flate2", - "log", - "percent-encoding", - "rustls", - "rustls-pki-types", - "serde", - "serde_json", - "ureq-proto", - "utf8-zero", - "webpki-roots", -] - -[[package]] -name = "ureq-proto" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c" -dependencies = [ - "base64 0.22.1", - "http", - "httparse", - "log", -] - [[package]] name = "url" version = "2.5.8" @@ -4089,12 +4193,6 @@ dependencies = [ "url", ] -[[package]] -name = "utf8-zero" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -4113,6 +4211,28 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "verhub-sdk" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d327c305b7a92625c9bd30009a1ab80091c401c268b52c4d4576978aecb165" +dependencies = [ + "log", + "os_info", + "percent-encoding", + "reqwest 0.12.28", + "serde", + "serde_json", + "thiserror 2.0.18", + "tokio", +] + [[package]] name = "version-compare" version = "0.2.1" @@ -4313,15 +4433,6 @@ dependencies = [ "system-deps", ] -[[package]] -name = "webpki-roots" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "webview2-com" version = "0.38.2" @@ -4594,15 +4705,6 @@ dependencies = [ "windows-targets 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.59.0" diff --git a/Cargo.toml b/Cargo.toml index 437eb12..1a04cbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = ["crates/common", "crates/core", "apps/config/src-tauri"] [workspace.package] -version = "3.0.0" +version = "3.1.0-rc.1" edition = "2024" authors = ["IvanHanloth"] license = "MIT" @@ -17,7 +17,7 @@ regex = "1.11.1" tokio = { version = "1.52.3", features = ["rt-multi-thread", "macros", "net", "io-util", "sync", "time"] } windows = "0.62.2" tempfile = "3.27.0" -ureq = { version = "3.1.2", default-features = false, features = ["json", "rustls", "gzip"] } +verhub-sdk = { version = "0.2.6", default-features = false, features = ["native-tls"] } [profile.release] opt-level = "z" diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..04f54e9 --- /dev/null +++ b/README.en.md @@ -0,0 +1,116 @@ +
+ + + +
+ +
+
+
+
+
+
+
+
+ 简体中文 + • + English + • + 繁體中文 +
+ ++ 简体中文 + • + English + • + 繁體中文 +
++ + + +
+ +
+
+
+
+
+
+
+
+ 简体中文 + • + English + • + 繁體中文 +
+ +