--- 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 App 請使用 [iOS / macOS SDK](./ios)。 ::: tip 需要直接整合? 如果 Electron 與 Flutter 都不適合你的 App,請[聯絡我們](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 桌面 App,請將 `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)。