Merge pull request #784 from ZacharyZcR/fix/guacamole-protocol-version

fix: patch guacamole-lite to support guacd 1.6.0 protocol version
This commit is contained in:
ZacharyZcR
2026-05-18 04:35:43 +08:00
committed by GitHub
3 changed files with 39 additions and 49 deletions
-48
View File
@@ -2449,9 +2449,6 @@
"arm"
],
"dev": true,
"libc": [
"glibc"
],
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
@@ -2469,9 +2466,6 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
@@ -2489,9 +2483,6 @@
"ppc64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
@@ -2509,9 +2500,6 @@
"riscv64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
@@ -2529,9 +2517,6 @@
"s390x"
],
"dev": true,
"libc": [
"glibc"
],
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
@@ -2549,9 +2534,6 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
@@ -2569,9 +2551,6 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
@@ -2589,9 +2568,6 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
@@ -2609,9 +2585,6 @@
"arm"
],
"dev": true,
"libc": [
"glibc"
],
"license": "Apache-2.0",
"optional": true,
"os": [
@@ -2635,9 +2608,6 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "Apache-2.0",
"optional": true,
"os": [
@@ -2661,9 +2631,6 @@
"ppc64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "Apache-2.0",
"optional": true,
"os": [
@@ -2687,9 +2654,6 @@
"riscv64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "Apache-2.0",
"optional": true,
"os": [
@@ -2713,9 +2677,6 @@
"s390x"
],
"dev": true,
"libc": [
"glibc"
],
"license": "Apache-2.0",
"optional": true,
"os": [
@@ -2739,9 +2700,6 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "Apache-2.0",
"optional": true,
"os": [
@@ -2765,9 +2723,6 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "Apache-2.0",
"optional": true,
"os": [
@@ -2791,9 +2746,6 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "Apache-2.0",
"optional": true,
"os": [
+1 -1
View File
@@ -12,7 +12,7 @@
"scripts": {
"format": "prettier --write .",
"format:check": "prettier --check .",
"postinstall": "node scripts/patch-app-builder-lib.cjs",
"postinstall": "node scripts/patch-app-builder-lib.cjs && node scripts/patch-guacamole-lite.cjs",
"prebuild": "node scripts/write-electron-build-info.cjs",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
+38
View File
@@ -0,0 +1,38 @@
const fs = require("fs");
const path = require("path");
const filePath = path.join(
__dirname,
"..",
"node_modules",
"guacamole-lite",
"lib",
"GuacdClient.js",
);
if (!fs.existsSync(filePath)) {
console.log("[patch-guacamole-lite] File not found, skipping");
process.exit(0);
}
let content = fs.readFileSync(filePath, "utf8");
const oldCheck = "if (version === '1_0_0' || version === '1_1_0') {";
const newCheck =
"if (version === '1_0_0' || version === '1_1_0' || version === '1_3_0' || version === '1_5_0') {";
if (content.includes(newCheck)) {
console.log("[patch-guacamole-lite] Already patched");
process.exit(0);
}
if (!content.includes(oldCheck)) {
console.log("[patch-guacamole-lite] Target code not found, skipping");
process.exit(0);
}
content = content.replace(oldCheck, newCheck);
fs.writeFileSync(filePath, content);
console.log(
"[patch-guacamole-lite] Patched to support protocol VERSION_1_3_0 and VERSION_1_5_0",
);