zcode-bin
maintainer AnRan
· 1 votes
· scanned 2026-08-03 00:08:14.047287
MEDIUM
View on AUR ↗
Why flagged
The package downloads a prebuilt .deb from a non-standard, non-whitelisted host (cdn-zcode.z.ai) which is not a common forge or official domain; while it may be the project's legitimate release infrastructure, the unverifiable nature of the prebuilt binary poses a supply-chain risk if the host were compromised or spoofed.
Triggered rules
MEDIUM
source=() URL on a non-standard host
source_untrusted_domain
One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).
-
PKGBUILD:32
"${pkgname%-bin}-${pkgver}-x86_64.deb::https://cdn-zcode.z.ai/zcode/electron/releases/${pkgver}/linux-x64/${_pkgname}-${pkgver}-linux-x64.deb"
MEDIUM
AI review
llm_review
An AI model (qwen/qwen3-235b-a22b-2507) reviewed this and agrees it is MEDIUM (confidence 85%): The package downloads a prebuilt .deb from a non-standard, non-whitelisted host (cdn-zcode.z.ai) which is not a common forge or official domain; while it may be the project's legitimate release infrastructure, the unverifiable nature of the prebuilt binary poses a supply-chain risk if the host were compromised or spoofed.
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: AnRan <2318621872 at qq dot com>
2
# Contributor: zxp19821005 <zxp19821005 at 163 dot com> (launcher script approach)
3
pkgname=zcode-bin
4
_pkgname=ZCode
5
pkgver=3.5.3
6
_electronversion=41
7
pkgrel=1
8
pkgdesc="ZCode - AI-powered code editor by ZAI"
9
arch=('x86_64')
10
url="https://zcode.z.ai/"
11
license=('LicenseRef-ZCode')
12
depends=(
13
"electron${_electronversion}"
14
'python'
15
'python-reportlab'
16
'python-lxml'
17
'python-pillow'
18
'python-defusedxml'
19
'libstdc++'
20
'nodejs'
21
'libgcc'
22
'ripgrep'
23
'xdg-utils'
24
)
25
makedepends=(
26
'asar'
27
)
28
options=(
29
'!strip'
30
)
31
source=(
32
"${pkgname%-bin}-${pkgver}-x86_64.deb::https://cdn-zcode.z.ai/zcode/electron/releases/${pkgver}/linux-x64/${_pkgname}-${pkgver}-linux-x64.deb"
33
"LICENSE"
34
"${pkgname%-bin}.sh"
35
)
36
# First entry: upstream .deb, pinned by zcode-update-checker.sh on each update.
37
# LICENSE and zcode.sh are local repo files tracked by git, kept as SKIP.
38
sha256sums=('e6610065ed4a711efc139a60d373ffcc606a3c13e782306876e49fc07e336bc7'
39
'SKIP'
40
'SKIP')
41
42
_get_app_dir() {
43
find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1
44
}
45
46
_check_electron_version() {
47
echo "Verifying Electron version..."
48
local _app_dir=$(_get_app_dir)
49
local _main_exe=""
50
if [[ -n "${_app_dir}" ]]; then
51
_main_exe=$(find "${_app_dir}" -maxdepth 1 -type f -executable -printf '%s %p\n' | sort -nr | head -n 1 | cut -d' ' -f2-)
52
fi
53
if [[ -n "${_main_exe}" ]]; then
54
local _elec_ver=$(strings "${_main_exe}" | grep '^Chrome/[0-9.]* Electron/[0-9]' | cut -d'/' -f3 | cut -d'.' -f1 | head -n 1)
55
if [[ -n "${_elec_ver}" ]]; then
56
if [[ "${_elec_ver}" != "${_electronversion}" ]]; then
57
echo -e "\033[1;31mWarning: Electron version mismatch! Detected: ${_elec_ver}, Expected: ${_electronversion}\033[0m"
58
else
59
echo -e "Electron version verified: \033[1;31m${_elec_ver}\033[0m"
60
fi
61
fi
62
else
63
echo -e "\033[1;33mNote: Could not find Electron binary for version verification.\033[0m"
64
fi
65
}
66
67
prepare() {
68
bsdtar -xf "${srcdir}/data."*
69
_check_electron_version
70
71
# Substitute placeholders in launcher script
72
sed -i -e "
73
s/@electronversion@/${_electronversion}/g
74
s/@appname@/${pkgname%-bin}/g
75
s/@runname@/app.asar/g
76
s/@cfgdirname@/${_pkgname}/g
77
" "${srcdir}/${pkgname%-bin}.sh"
78
79
# Fix .desktop file: remove /opt/ZCode/ prefix so Exec references the launcher directly
80
sed -i "s/\/opt\/${_pkgname}\///g" "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop"
81
82
# Unpack app.asar, patch process.resourcesPath, and repack
83
local _app_dir=$(_get_app_dir)
84
asar e "${_app_dir}/resources/app.asar" "${srcdir}/app.asar.unpacked"
85
rm -rf "${_app_dir}/resources/app.asar"
86
find "${srcdir}/app.asar.unpacked/out" -type f -exec sed -i "s/process.resourcesPath/'\/usr\/lib\/${pkgname%-bin}'/g" {} +
87
asar p "${srcdir}/app.asar.unpacked" "${_app_dir}/resources/app.asar"
88
rm -rf "${srcdir}/app.asar.unpacked"
89
90
# Use system ripgrep instead of bundled
91
ln -sf "/usr/bin/rg" "${_app_dir}/resources/tools/ripgrep/rg"
92
93
# Remove unnecessary files to reduce package size
94
rm -rf \
95
"${_app_dir}/resources/"{apparmor-profile,package-type} \
96
"${_app_dir}/resources/app.asar.unpacked/node_modules/@lydell" \
97
"${_app_dir}/resources/app.asar.unpacked/node_modules/node-pty/"{bin,deps/winpty,prebuilds/{darwin-*,win32-*,linux-arm64}}
98
}
99
100
package() {
101
# Install launcher script
102
install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
103
104
# Install app resources
105
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-bin}"
106
local _app_dir=$(_get_app_dir)
107
cp -a "${_app_dir}/resources/." "${pkgdir}/usr/lib/${pkgname%-bin}/"
108
109
# Install .desktop file
110
install -Dm644 "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
111
112
# Install icons
113
find "${srcdir}" -type f \( -name "*.png" -o -name "*.svg" \) -path "*share/icons/*" | while read -r _i; do
114
_extension="${_i##*.}"
115
_icon_path="${_i#*share/icons/}"
116
_target_dir="/usr/share/icons/$(dirname "${_icon_path}")"
117
install -Dm644 "${_i}" "${pkgdir}${_target_dir}/${pkgname%-bin}.${_extension}"
118
done
119
120
# Install license
121
install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
122
}
123
Changes since previous scan
--- PKGBUILD @ 2026-07-31 00:14+++ PKGBUILD @ 2026-08-03 00:08@@ -2,7 +2,7 @@ # Contributor: zxp19821005 <zxp19821005 at 163 dot com> (launcher script approach) pkgname=zcode-bin _pkgname=ZCode-pkgver=3.5.2+pkgver=3.5.3 _electronversion=41 pkgrel=1 pkgdesc="ZCode - AI-powered code editor by ZAI"@@ -20,6 +20,7 @@ 'nodejs' 'libgcc' 'ripgrep'+ 'xdg-utils' ) makedepends=( 'asar'@@ -32,7 +33,9 @@ "LICENSE" "${pkgname%-bin}.sh" )-sha256sums=('SKIP'+# First entry: upstream .deb, pinned by zcode-update-checker.sh on each update.+# LICENSE and zcode.sh are local repo files tracked by git, kept as SKIP.+sha256sums=('e6610065ed4a711efc139a60d373ffcc606a3c13e782306876e49fc07e336bc7' 'SKIP' 'SKIP') Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | MEDIUM | 2 |
| 2026-08-02 00:16:08 | MEDIUM | 2 |
| 2026-08-01 00:11:18 | MEDIUM | 2 |
| 2026-07-31 09:17:30 | MEDIUM | 2 |
| 2026-07-31 00:14:10 | MEDIUM | 2 |
| 2026-07-30 00:17:23 | MEDIUM | 2 |
| 2026-07-29 00:25:53 | MEDIUM | 2 |
| 2026-07-28 03:37:00 | MEDIUM | 2 |
| 2026-07-28 00:07:28 | MEDIUM | 2 |
| 2026-07-27 03:34:02 | MEDIUM | 2 |
| 2026-07-27 00:24:32 | MEDIUM | 2 |
| 2026-07-26 00:07:32 | MEDIUM | 2 |
| 2026-07-25 00:13:44 | MEDIUM | 2 |
| 2026-07-24 00:02:28 | MEDIUM | 2 |
| 2026-07-23 03:22:31 | MEDIUM | 2 |
| 2026-07-21 03:15:42 | CLEAN | 0 |
| 2026-07-21 00:24:15 | MEDIUM | 2 |
| 2026-07-20 00:19:49 | MEDIUM | 2 |
| 2026-07-19 00:17:08 | MEDIUM | 2 |
| 2026-07-18 00:14:48 | MEDIUM | 2 |