codebuddy-cn-ide
The package downloads a DMG from Tencent's official CDN (download.codebuddy.cn), which is plausibly the project's own distribution infrastructure; the source is not executed directly and the build process uses it to extract and repackage legitimate upstream binaries, posing minimal supply-chain risk.
Triggered rules
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The package downloads a DMG from Tencent's official CDN (download.codebuddy.cn), which is plausibly the project's own distribution infrastructure; the source is not executed directly and the build process uses it to extract and repackage legitimate upstream binaries, posing minimal supply-chain risk.
1 higher static finding superseded - not the current verdict (shown for transparency)
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:52
"CodeBuddy-darwin-x64-${pkgver}-${_dmg_buildid}-cn.dmg::https://download.codebuddy.cn/aiide/darwin-x64/CodeBuddy-darwin-x64-${pkgver}-${_dmg_buildid}-cn.dmg"
PKGBUILD
1 offending line(s) highlighted# Maintainer: Zeongit J. <https://github.com/JipZeonGit/codebuddy-ide-cn-linux/issues>
#
# This PKGBUILD is licensed under the MIT License.
# It contains no proprietary code; it only orchestrates the download,
# extraction, and packaging of upstream binaries that the end user
# fetches directly from Tencent's official CDN at install time.
#
# The packaged software (Tencent CodeBuddy IDE) remains subject to
# Tencent's proprietary CodeBuddy service license, NOT this MIT notice.
pkgname=codebuddy-cn-ide
pkgver=4.9.9.27861944
pkgrel=1
pkgdesc='腾讯云代码助手CodeBuddy IDE,是一款辅助编码工具。'
arch=('x86_64')
url='https://github.com/JipZeonGit/codebuddy-ide-cn-linux'
license=('LicenseRef-Tencent-CodeBuddy')
depends=(
'gtk3' 'nss' 'libxss' 'alsa-lib' 'libsecret' 'libxkbfile'
'libnotify' 'libcups'
)
# These are referenced only by optional bundled extensions / utility
# scripts; the main IDE process uses the bundled Electron's node.
optdepends=(
'python: required by the genie skill-creator extension scripts'
'nodejs: required only when invoking bundled CLI helpers in node_modules'
)
makedepends=(
'7zip' 'curl' 'unzip' 'python' 'nodejs' 'npm'
'gcc' 'make' 'pkgconf' 'libicns' 'imagemagick'
)
# A previous local-build package used the name 'codebuddycn-ide'.
# Force a clean migration if the user has it installed.
conflicts=('codebuddycn-ide')
# - !strip: Electron native binaries break under strip.
# - !debug: prevent a -debug split package when global makepkg.conf
# has debug enabled (CachyOS turns it on by default).
options=('!strip' '!debug')
# Helper repository pinned to a specific commit so the conversion
# logic is reproducible. Bump together with pkgver if needed.
_helper_commit='cb73459de649fb8781cc55e31d7e3ff8ff21c18f'
_electron_version='34.5.1'
_dmg_buildid='19255a94'
source=(
"CodeBuddy-darwin-x64-${pkgver}-${_dmg_buildid}-cn.dmg::https://download.codebuddy.cn/aiide/darwin-x64/CodeBuddy-darwin-x64-${pkgver}-${_dmg_buildid}-cn.dmg"
"codebuddy-ide-cn-linux-${_helper_commit}.tar.gz::${url}/archive/${_helper_commit}.tar.gz"
"electron-v${_electron_version}-linux-x64.zip::https://github.com/electron/electron/releases/download/v${_electron_version}/electron-v${_electron_version}-linux-x64.zip"
'LICENSE.notice'
)
# DMG is not a format makepkg can extract; leave the Electron zip as-is
# and let install.sh consume it from a pre-populated cache directory.
noextract=(
"CodeBuddy-darwin-x64-${pkgver}-${_dmg_buildid}-cn.dmg"
"electron-v${_electron_version}-linux-x64.zip"
)
sha256sums=(
'397b5719897a6fd0be10b87c61f34cdc0914f2c3d858c6e6c86c0d2ce9134852'
'544f332fab062b8a4d0c78eab59c4305eb5240945b6a4c60bf7734bf093ab261'
'3ae6f75fa08f5c1bdb7bbcec4dc9cf7d7f53ffcf6a4292e4a482b2ce515505e7'
'SKIP'
)
prepare() {
local helper_dir="${srcdir}/codebuddy-ide-cn-linux-${_helper_commit}"
# GitHub archive tarballs do not preserve the executable bit, so
# check for existence rather than -x.
[ -f "${helper_dir}/install.sh" ] || {
echo "ERROR: helper repo not extracted at ${helper_dir}" >&2
return 1
}
# Feed install.sh a pre-populated Electron cache so it skips the
# network download step inside build().
install -d "${srcdir}/electron-cache"
cp -a "${srcdir}/electron-v${_electron_version}-linux-x64.zip" \
"${srcdir}/electron-cache/"
}
build() {
local helper_dir="${srcdir}/codebuddy-ide-cn-linux-${_helper_commit}"
local dmg_path="${srcdir}/CodeBuddy-darwin-x64-${pkgver}-${_dmg_buildid}-cn.dmg"
local out_dir="${srcdir}/build/${pkgname}"
install -d "${out_dir}"
# Drive the upstream automated installer. Passing CODEBUDDY_APP_ID
# makes its generated start.sh export the matching CHROME_DESKTOP
# value at runtime, so window managers attach the right .desktop.
CODEBUDDY_INSTALL_DIR="${out_dir}" \
CODEBUDDY_APP_ID="${pkgname}" \
CODEBUDDY_APP_DISPLAY_NAME='CodeBuddy IDE CN' \
CODEBUDDY_ELECTRON_CACHE_DIR="${srcdir}/electron-cache" \
ELECTRON_VERSION="${_electron_version}" \
bash "${helper_dir}/install.sh" --fresh "${dmg_path}"
# The desktop entry written by install.sh embeds absolute build-time
# paths from ${out_dir}. We ship a clean system-wide entry from
# package(); discard the build-time copy so it never lands in /opt.
rm -f "${out_dir}/.codebuddycn-linux/${pkgname}.desktop"
}
package() {
local helper_dir="${srcdir}/codebuddy-ide-cn-linux-${_helper_commit}"
local out_dir="${srcdir}/build/${pkgname}"
# 1) App payload under /opt/$pkgname.
install -d "${pkgdir}/opt/${pkgname}"
cp -a "${out_dir}/." "${pkgdir}/opt/${pkgname}/"
# 1b) Strip gyp / autotools intermediate build artifacts that the
# rebuilt native modules leave behind. Only the final *.node files
# in build/Release/ are needed at runtime. Removing these:
# - drops ~50 MB of debug junk from the package
# - eliminates many namcap warnings (unstripped .o files, missing
# PIE/RELRO on intermediate objects)
# - resolves cross-directory hardlink errors (gyp writes the
# same .node twice and hardlinks them)
find "${pkgdir}/opt/${pkgname}/resources/app/node_modules" \
\( -name 'obj.target' -o -name 'obj' -o -name '.deps' \) \
-type d -prune -exec rm -rf {} + 2>/dev/null || true
# sqlite3 leaves an unused placeholder static archive that namcap
# flags as a cross-directory hardlink. Drop it; nothing links it.
rm -f "${pkgdir}/opt/${pkgname}/resources/app/node_modules/@vscode/sqlite3/build/node-addon-api/nothing.a" \
"${pkgdir}/opt/${pkgname}/resources/app/node_modules/@vscode/sqlite3/build/Release/nothing.a" \
"${pkgdir}/opt/${pkgname}/resources/app/node_modules/@vscode/sqlite3/build/Release/node-addon-api/nothing.o" \
2>/dev/null || true
# Clean up empty directories left by the prune above and by the
# earlier removal of macOS/Windows-only platform modules.
find "${pkgdir}/opt/${pkgname}/resources/app/node_modules" \
-type d -empty -delete 2>/dev/null || true
# 2) /usr/bin launcher.
install -d "${pkgdir}/usr/bin"
cat > "${pkgdir}/usr/bin/${pkgname}" <<EOF
#!/bin/bash
exec /opt/${pkgname}/start.sh "\$@"
EOF
chmod 0755 "${pkgdir}/usr/bin/${pkgname}"
# 3) System desktop entry.
install -d "${pkgdir}/usr/share/applications"
cat > "${pkgdir}/usr/share/applications/${pkgname}.desktop" <<EOF
[Desktop Entry]
Name=CodeBuddy IDE CN
Comment=${pkgdesc}
Exec=/usr/bin/${pkgname} %F
Icon=${pkgname}
Type=Application
Categories=Development;IDE;
StartupNotify=true
StartupWMClass=CodeBuddy CN
MimeType=x-scheme-handler/codebuddycn;
EOF
chmod 0644 "${pkgdir}/usr/share/applications/${pkgname}.desktop"
# 4) Icon, by hicolor theme name '${pkgname}'.
if [ -f "${out_dir}/.codebuddycn-linux/codebuddycn.png" ]; then
install -Dm644 "${out_dir}/.codebuddycn-linux/codebuddycn.png" \
"${pkgdir}/usr/share/icons/hicolor/256x256/apps/${pkgname}.png"
fi
# 5) Licenses. /usr/share/licenses/$pkgname/ must exist because
# license=('custom'). We ship:
# - LICENSE.notice : explanation of the layered licensing
# - LICENSE.helper-MIT : MIT text covering the recipe + scripts
# - upstream/* : any LICENSE/EULA/NOTICE found in .app
install -Dm644 "${srcdir}/LICENSE.notice" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.notice"
if [ -f "${helper_dir}/LICENSE" ]; then
install -Dm644 "${helper_dir}/LICENSE" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.helper-MIT"
fi
# Only the official upstream LICENSE/EULA/NOTICE files at the root of
# the app payload are relevant. Going deeper would scoop up MIT/BSD
# notices from third-party node_modules, which are NOT the license
# the user is agreeing to when they install this package.
local upstream_license
while IFS= read -r upstream_license; do
[ -f "${upstream_license}" ] || continue
install -Dm644 "${upstream_license}" \
"${pkgdir}/usr/share/licenses/${pkgname}/upstream/$(basename "${upstream_license}")"
done < <(find "${out_dir}/resources/app" \
-maxdepth 1 \
\( -iname 'LICENSE*' -o -iname 'EULA*' -o -iname 'NOTICE*' \
-o -iname 'ThirdPartyNotices*' \) \
-type f 2>/dev/null || true)
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-09-17 00:27:14 | Low | 2 |
| 2026-09-16 00:03:17 | Low | 2 |
| 2026-09-15 00:25:31 | Low | 2 |
| 2026-09-14 00:27:57 | Low | 2 |
| 2026-09-13 00:19:54 | Low | 2 |
| 2026-09-12 00:25:17 | Low | 2 |
| 2026-09-11 00:19:22 | Low | 2 |
| 2026-09-10 00:22:44 | Low | 2 |
| 2026-09-09 00:04:09 | Low | 2 |
| 2026-09-08 00:18:08 | Low | 2 |
| 2026-09-07 00:30:15 | Low | 2 |
| 2026-09-06 00:17:06 | Low | 2 |
| 2026-09-05 00:16:27 | Low | 2 |
| 2026-09-04 00:03:13 | Low | 2 |
| 2026-09-03 00:15:47 | Low | 2 |
| 2026-09-02 00:02:31 | Low | 2 |
| 2026-09-01 00:11:19 | Low | 2 |
| 2026-08-31 00:19:57 | Low | 2 |
| 2026-08-30 00:04:14 | Low | 2 |
| 2026-08-29 00:29:17 | Low | 2 |