--- title: 桌面端运行时 description: "CaptchaLa 桌面端运行时 1.2.0:Electron 与 Flutter 桌面端 SDK 所用的 Windows、macOS、Linux 原生库,支持的平台,以及用于校验或镜像这些库的 SHA256SUMS。" --- # 桌面端运行时 CaptchaLa 桌面端运行时是一组面向 **Windows**、**macOS** 和 **Linux** 的原生库,桌面端 SDK 都基于它构建。当前版本:**1.2.0**。 你无需直接集成运行时。请使用以下任一 SDK,它们会为你打包或获取对应的运行时: - **[Electron SDK](./electron)**(`@captcha-la/electron`):npm 包内含所有受支持目标平台的运行时。 - **[Flutter SDK](./flutter)**(`captchala`):在 Windows 和 Linux 上,插件会在构建时下载运行时, 并用固定的 SHA-256 哈希校验。 原生 macOS 应用请使用 [iOS / macOS SDK](./ios)。 ::: tip 需要直接集成? 如果 Electron 和 Flutter 都不适合你的应用,请[联系我们](https://dash.captcha.la/support)。 ::: ## 平台 {#platforms} | 平台 | 架构 | 验证码窗口 | | --- | --- | --- | | Windows 10 1809+ 及 Windows Server | x64、arm64、x86 | 原生窗口(Microsoft Edge WebView2 Runtime) | | Linux,glibc 2.17+ | x64、arm64 | 原生窗口:GTK 3 与 WebKitGTK 4.1(Ubuntu 22.04+、Debian 12+ 或同等系统) | | macOS 11+ | arm64、x64 | 供 Electron SDK 使用 | 自 1.2.0 起,运行时也可在 Windows Server 上加载,包括 Server Core 和终端服务器,无需安装任何额外的 Windows 功能。 在早于 Ubuntu 22.04 / Debian 12 的 Linux 系统上,原生验证码窗口不可用;此时 Electron SDK 会在自己的窗口中显示验证码。 ## 下载与校验 {#download} 这些库发布在带版本号的包 CDN 上并附带校验值,可用于安全审查,或在你的内网中镜像: - 基础地址:`https://pkg.captcha-pkg.net/desktop/1.2.0/`(镜像: `https://pkg.captcha-cdn.net/desktop/1.2.0/`) - [`SHA256SUMS`](https://pkg.captcha-pkg.net/desktop/1.2.0/SHA256SUMS) 列出每个文件及其 SHA-256; 每个目标平台一个文件夹:`linux-x64`、`linux-arm64`、`win32-x64`、`win32-arm64`、`win32-ia32`、 `darwin-arm64`、`darwin-x64` ```bash # Linux (use "shasum -a 256 -c -" on macOS) BASE=https://pkg.captcha-pkg.net/desktop/1.2.0 TARGET=linux-x64 mkdir -p vendor/captchala/1.2.0 && cd vendor/captchala/1.2.0 curl -fsSLO "$BASE/SHA256SUMS" for f in $(grep " $TARGET/" SHA256SUMS | awk '{print $2}'); do mkdir -p "$(dirname "$f")" && curl -fsSL -o "$f" "$BASE/$f" done grep " $TARGET/" SHA256SUMS | sha256sum -c - # every line must say OK ``` 在 Windows 上,将 `Get-FileHash -Algorithm SHA256` 的结果与 `SHA256SUMS` 中对应的行比对。 如需从镜像构建 Flutter 桌面应用,把 `CAPTCHALA_LOCAL_PREBUILDS` 指向该文件夹(见 [Flutter:原生库](./flutter#native-libraries))。 ## 环境要求 {#requirements} - **Windows:** Windows 10 1809+ 或 Windows Server;验证码窗口需要 Microsoft Edge WebView2 Runtime。 - **Linux:** glibc 2.17+ 与 libcurl;验证码窗口需要 GTK 3 与 WebKitGTK 4.1(`webkit2gtk-4.1`)。 - **macOS:** macOS 11+。 ## 服务端校验 无论使用哪个 SDK,都要把 pass token 发送到你的后端,并通过 `POST https://verify.captcha.la/v1/validate` 校验。见 [API 参考](../api-reference)。