CH-J Server Manager通过 SSH 管理服务器
菜单
已发布的源代码

CH-J Server Manager

浏览特定应用版本的目录和文件。

下载源代码 ZIP
CH-J / Server Manager 377 个文件
core-20261019T111616Z-160a00bfcddc 添加时间: · 构建时间:
buildBiometricHelpers.js 添加时间: 未记录日期 2.4 KB · 23 行
代码 下载文件
1"use strict";
2const fs = require("node:fs");
3const path = require("node:path");
4const { execFileSync } = require("node:child_process");
5const appRoot = path.resolve(__dirname, ".."), out = path.join(appRoot, "build", "biometrics"), source = path.join(appRoot, "src/main/security/biometrics/native");
6fs.mkdirSync(out, { recursive: true });
7if (process.platform === "darwin") {
8 const compiler = fs.existsSync("/Library/Developer/CommandLineTools/usr/bin/swiftc") ? "/Library/Developer/CommandLineTools/usr/bin/swiftc" : "/usr/bin/swiftc";
9 const sdk = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk";
10 const target = `${process.arch === "arm64" ? "arm64" : "x86_64"}-apple-macos12.0`;
11 execFileSync(compiler, [...(fs.existsSync(sdk) ? ["-sdk", sdk] : []), "-target", target, "-O", "-framework", "Security", "-framework", "LocalAuthentication", path.join(source, "mac.swift"), "-o", path.join(out, "chj-biometric")], { stdio: "inherit" });
12} else if (process.platform === "win32") {
13 const vswhere = path.join(process.env["ProgramFiles(x86)"] || "C:\\Program Files (x86)", "Microsoft Visual Studio", "Installer", "vswhere.exe");
14 const installation = execFileSync(vswhere, ["-latest", "-products", "*", "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "-property", "installationPath"], { encoding: "utf8" }).trim();
15 if (!installation) throw new Error("Biometric helper requires Visual Studio C++ Build Tools and Windows SDK with C++/WinRT.");
16 const batch = path.join(out, "compile.cmd");
17 fs.writeFileSync(batch, `@echo off\r\ncall "${installation}\\VC\\Auxiliary\\Build\\vcvars64.bat" >nul\r\nif errorlevel 1 exit /b 1\r\ncd /d "${out}"\r\ncl.exe /nologo /std:c++17 /EHsc /O2 /DUNICODE /D_UNICODE "${path.join(source, "windows.cpp")}" /Fe:"${path.join(out, "chj-biometric.exe")}" /link windowsapp.lib crypt32.lib advapi32.lib user32.lib\r\nexit /b %errorlevel%\r\n`);
18 try { execFileSync(process.env.ComSpec || "cmd.exe", ["/d", "/c", batch], { stdio: "inherit" }); } finally { fs.unlinkSync(batch); }
19 for (const name of ["windows.obj", "chj-biometric.pdb"]) { try { fs.unlinkSync(path.join(out, name)); } catch {} }
20} else if (process.platform === "linux") {
21 fs.copyFileSync(path.join(source, "linux.py"), path.join(out, "linux.py"));
22} else throw new Error("Biometric helpers are not supported on this platform.");
23console.log(`Biometric helper prepared for ${process.platform}/${process.arch}.`);
SHA-256bc10244b1013f9043b7a499a2c31581b0ef1a51505fb5a64adffa206f416ddbb

CH-J Proprietary Software License 1.14 · 源代码依据 CH-J Proprietary Software License 1.14 提供。公开源代码不会改变许可条款,也不会授予额外权利。

压缩包 SHA-256a9605c0870a223b6a8542bb0705edd51d8b04f3069582653417a8397fabcc09a
文件