AUR AI Reviewer

Review Results

Version #2860 of mailspring-bin · commit 7062bb68bdce · status Reviewed

Risk 0/5 · Safe .SRCINFO
Result #5227

Comment

The only change in this .SRCINFO hunk is a version bump from 1.26.0 to 1.26.1. No sources, checksums, build steps, install scripts, permissions, or package metadata affecting trust boundaries were changed in the reviewed diff. On its face this is a routine upstream version update with no security-relevant red flags in the provided hunk.

@@ -1,6 +1,6 @@
 pkgbase = mailspring-bin
 	pkgdesc = A beautiful, fast and fully open source mail client.
-	pkgver = 1.26.0
+	pkgver = 1.26.1
 	pkgrel = 1
 	url = https://getmailspring.com/
 	arch = aarch64
Risk 0/5 · Safe .SRCINFO
Result #5228

Comment

The change is a straightforward version bump in .SRCINFO: it updates the provided package version and the checksums/URLs for the upstream GitHub release artifacts from 1.26.0 to 1.26.1. The sources remain HTTPS GitHub release URLs for the official upstream project, and there are no new build steps, scripts, or privilege-related changes in this diff. No security red flags are introduced by this metadata-only update.

@@ -10,13 +10,13 @@ pkgbase = mailspring-bin
 	depends = krb5
 	depends = db5.3
 	depends = tidy
-	provides = mailspring=1.26.0
+	provides = mailspring=1.26.1
 	conflicts = mailspring
 	source = mailspring.sh
-	sha256sums = bd5358d8f323d3c2c2f0733364ee4ea55f551dd86ba0be2a76846210b60897fc
-	source_aarch64 = mailspring-1.26.0-aarch64.rpm::https://github.com/Foundry376/Mailspring/releases/download/1.26.0/mailspring-1.26.0-0.1.aarch64.rpm
-	sha256sums_aarch64 = 5d43f37f8f7524706402b9e83ea7a40a07109c2be9355f67a79b65d1da5152b0
-	source_x86_64 = mailspring-1.26.0-x86_64.rpm::https://github.com/Foundry376/Mailspring/releases/download/1.26.0/mailspring-1.26.0-0.1.x86_64.rpm
-	sha256sums_x86_64 = 84ce5d587574900f5524353c7bab249aaaacb9409ee82784e8ee542f42a99950
+	sha256sums = a175afba52c8032d84ffe4277eec56f2e4868ae55692a741266b806b98b89953
+	source_aarch64 = mailspring-1.26.1-aarch64.rpm::https://github.com/Foundry376/Mailspring/releases/download/1.26.1/mailspring-1.26.1-0.1.aarch64.rpm
+	sha256sums_aarch64 = 1d56ca1ee2a68532a931a157941e33a74956d3aa85678480e2c3e632761b8619
+	source_x86_64 = mailspring-1.26.1-x86_64.rpm::https://github.com/Foundry376/Mailspring/releases/download/1.26.1/mailspring-1.26.1-0.1.x86_64.rpm
+	sha256sums_x86_64 = 2e05fc97dfa9b5b0e99a77953db5ab275de0bfefda2a1762534db9da2abeb3ae
 
 pkgname = mailspring-bin
Risk 0/5 · Safe PKGBUILD
Result #5229

Comment

The change only bumps pkgver from 1.26.0 to 1.26.1 in PKGBUILD. No source URLs, checksums, build steps, install scripts, permissions, or packaging logic are modified in the provided diff, so there is no new security-relevant behavior to assess from this hunk alone.

@@ -1,7 +1,7 @@
 # Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
 pkgname=mailspring-bin
 _pkgname=Mailspring
-pkgver=1.26.0
+pkgver=1.26.1
 _electronversion=44
 pkgrel=1
 pkgdesc="A beautiful, fast and fully open source mail client."
Risk 0/5 · Safe PKGBUILD
Result #5230

Comment

The change is low risk. It only updates package checksums and refactors two helper functions used during packaging: `_get_app_dir()` now excludes `node_modules` when locating `resources.pak`, and `_check_electron_version()` is condensed but still only reads local files and prints a version check. There are no new network calls, privilege changes, install-script modifications, or packaging actions outside the source tree. The only minor concern is that the new `find ... | while read -r d` pipeline is slightly less defensive if no executable is found, but this is a robustness issue rather than a security problem.

@@ -23,21 +23,20 @@ depends=(
 source=("${pkgname%-bin}.sh")
 source_aarch64=("${pkgname%-bin}-${pkgver}-aarch64.rpm::${_ghurl}/releases/download/${pkgver}/${pkgname%-bin}-${pkgver}-0.1.aarch64.rpm")
 source_x86_64=("${pkgname%-bin}-${pkgver}-x86_64.rpm::${_ghurl}/releases/download/${pkgver}/${pkgname%-bin}-${pkgver}-0.1.x86_64.rpm")
-sha256sums=('bd5358d8f323d3c2c2f0733364ee4ea55f551dd86ba0be2a76846210b60897fc')
-sha256sums_aarch64=('5d43f37f8f7524706402b9e83ea7a40a07109c2be9355f67a79b65d1da5152b0')
-sha256sums_x86_64=('84ce5d587574900f5524353c7bab249aaaacb9409ee82784e8ee542f42a99950')
+sha256sums=('a175afba52c8032d84ffe4277eec56f2e4868ae55692a741266b806b98b89953')
+sha256sums_aarch64=('1d56ca1ee2a68532a931a157941e33a74956d3aa85678480e2c3e632761b8619')
+sha256sums_x86_64=('2e05fc97dfa9b5b0e99a77953db5ab275de0bfefda2a1762534db9da2abeb3ae')
 _get_app_dir() {
-	find "${srcdir}" -type f -name "resources.pak" -print 2>/dev/null | while read f; do [ -d "${f%/*}/resources" ] && echo "${f%/*}" && break; done
+	find "${srcdir}" -type f -name "resources.pak" ! -path "*/node_modules/*" -printf '%h\n' 2>/dev/null \
+		| while read -r d; do [[ -d "${d}/resources" ]] && { echo "$d"; return 0; }; done
 }
 _check_electron_version() {
-    echo "Verifying Electron version..."
-    local _main_exe=$(find "$(_get_app_dir)" -maxdepth 1 -type f -executable -printf '%s %p\n' | sort -nr | head -1 | cut -d' ' -f2-)
-    [[ -z "${_main_exe}" ]] && echo -e "\033[1;33mNote: Could not find Electron binary.\033[0m" && return
-    local _elec_ver=$(strings "${_main_exe}" | grep -oP 'Electron/\K[0-9]+' | head -1)
-    [[ -z "${_elec_ver}" ]] && echo -e "\033[1;33mNote: Could not determine Electron version.\033[0m" && return
-    [[ "${_elec_ver}" != "${_electronversion}" ]] &&
-        echo -e "\033[1;31mWarning: Electron version mismatch! Detected: ${_elec_ver}, Expected: ${_electronversion}\033[0m" ||
-        echo -e "Electron version verified: \033[1;31m${_elec_ver}\033[0m"
+	local _v=$(strings "$(find "$(_get_app_dir)" -maxdepth 1 -type f \
+		-executable -printf '%s %p\n' | sort -nr | head -1 | cut -d' ' -f2-)" \
+		| grep -oP 'Electron/\K[0-9]+' | head -1)
+	[[ -z "$_v" ]] && { echo -e "\033[1;33mNote: Could not check version.\033[0m"; return; }
+	(( _v == _electronversion )) && c=32 || c=31
+	echo -e "Electron version: \033[1;${c}m$_v$([[ $c -eq 31 ]] && echo " (expected $_electronversion)")\033[0m"
 }
 _get_current_desktop_env() {
     if [ -n "$XDG_CURRENT_DESKTOP" ]; then
Risk 0/5 · Safe PKGBUILD
Result #5231

Comment

The change is low risk. It only removes two template substitutions from the launcher script generation in prepare(), while the rest of the PKGBUILD continues to package the upstream RPM contents and install the launcher/desktop files as before. I do not see any new network access, privilege escalation, persistence mechanism, or suspicious source changes in this diff. The removed substitutions may affect runtime behavior if the launcher script still expects those placeholders, but that is a functional regression concern rather than a security issue.

@@ -54,8 +53,6 @@ prepare() {
     sed -i -e "
         s/@electronversion@/${_electronversion}/g
         s/@appname@/${pkgname%-bin}/g
-        s/@runname@/app.asar/g
-        s/@cfgdirname@/${_pkgname}/g
     " "${srcdir}/${pkgname%-bin}.sh"
     _check_electron_version
     _desktop_env="$(_get_current_desktop_env)"
Risk 0/5 · Safe PKGBUILD
Result #5232

Comment

The change is limited to PKGBUILD refactoring and version bump. It does not introduce new sources, network fetches, privilege escalation, install-script behavior, or packaging outside $pkgdir. The functional changes are minor: a more restrictive _get_app_dir() search that skips node_modules, a simplified Electron version check, removal of two sed substitutions in prepare(), and in package() an inline call to _get_app_dir() instead of storing it in a variable. I do note a potential correctness risk from removing the @runname@ and @cfgdirname@ substitutions, but that is not a security issue in this diff and there is no evidence of malicious behavior.

@@ -67,8 +64,7 @@ prepare() {
 package() {
     install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
     install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-bin}"
-	local _app_dir="$(_get_app_dir)"
-	cp -a "${_app_dir}/resources/." "${pkgdir}/usr/lib/${pkgname%-bin}/"
+	cp -a "$(_get_app_dir)/resources/." "${pkgdir}/usr/lib/${pkgname%-bin}/"
     install -Dm644 "${srcdir}/usr/share/applications/${_pkgname}.desktop" -t "${pkgdir}/usr/share/applications"
     find "${srcdir}" -type f \( -name "*.png" -o -name "*.svg" \) -path "*share/icons/*" | while read -r _i; do
         _extension="${_i##*.}"
Risk 0/5 · Safe mailspring.sh
Result #5233

Comment

The change is low risk. It removes a user-configurable flag-loading mechanism from the launcher, but does not add any network access, privilege escalation, persistence, or suspicious execution. The new logic only selects the Electron app entrypoint and Ozone platform flags based on local filesystem state and an environment variable, then execs the packaged Electron binary. No unsafe shell constructs, downloads, or root-side effects are introduced. The only notable behavioral change is that previously supported custom Electron flags from XDG config are no longer honored, which is a compatibility/regression concern rather than a security issue.

@@ -1,57 +1,39 @@
 #!/bin/bash
 set -e
-_APPDIR="/usr/lib/@appname@"
-_RUNNAME="${_APPDIR}/@runname@"
-# ==== Base environment variables ====
-export ELECTRON_IS_DEV=0
-export ELECTRON_FORCE_IS_PACKAGED=true
-export ELECTRON_DISABLE_SECURITY_WARNINGS=true
-export NODE_ENV=production
-export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
-export LD_LIBRARY_PATH="${_APPDIR}/lib:${LD_LIBRARY_PATH}"
-# ==== 1. Display System Optimization (X11 & Wayland) ====
-# Use 'auto' to allow modern Electron (v20+) to detect the best platform
-# This helps with Wayland window decorations, fractional scaling, and GPU acceleration
-export ELECTRON_OZONE_PLATFORM_HINT="${ELECTRON_OZONE_PLATFORM_HINT:-auto}"
-# ==== 2. Desktop Environment (DE) Compatibility ====
-# Set CHROME_DESKTOP to match the .desktop file for correct taskbar icon grouping
+export _APPDIR="/usr/lib/@appname@"
 export CHROME_DESKTOP="@appname@.desktop"
-# Fix for Electron's trash implementation on different DEs
-case "${XDG_CURRENT_DESKTOP}" in
-	KDE)	export ELECTRON_TRASH="kioclient5"	;;
-	GNOME)	export ELECTRON_TRASH="gio"			;;
-	XFCE)	export ELECTRON_TRASH="gvfs-trash"	;;
-	*)	# Default fallback						;;
-esac
-# ==== 3. Load user-defined flags ====
-# The script checks for flags in the following order (later files override/append to earlier ones):
-# 1. System-wide Electron flags: $XDG_CONFIG_HOME/electron-flags.conf
-# 2. Version-specific Electron flags: $XDG_CONFIG_HOME/electron@electronversion@-flags.conf
-# 3. App-specific global flags: $XDG_CONFIG_HOME/@appname@-flags.conf
-# 4. App-specific directory flags: $XDG_CONFIG_HOME/@cfgdirname@/@appname@-flags.conf
-_FLAG_SOURCES=(
-	"${XDG_CONFIG_HOME}/electron-flags.conf"
-	"${XDG_CONFIG_HOME}/electron@electronversion@-flags.conf"
-	"${XDG_CONFIG_HOME}/@appname@-flags.conf"
-	"${XDG_CONFIG_HOME}/@cfgdirname@/@appname@-flags.conf"
-)
-declare -a flags
-for _FLAGS_FILE in "${_FLAG_SOURCES[@]}"; do
-	if [[ -f "${_FLAGS_FILE}" ]]; then
-		echo "Loading flags from ${_FLAGS_FILE}"
-		while read -r line || [[ -n "$line" ]]; do
-			[[ "${line}" =~ ^[[:space:]]*#.* ]] || [[ -z "${line}" ]] || {
-				read -ra line_flags <<< "$line"
-				flags+=("${line_flags[@]}")
-			}
-		done < "${_FLAGS_FILE}"
-	fi
-done
-# ==== 4. Sandbox and Execution Permissions ====
-# Disable sandbox if running as root without ELECTRON_RUN_AS_NODE
+export LD_LIBRARY_PATH="${_APPDIR}/lib:${LD_LIBRARY_PATH}"
+if [[ -f "${_APPDIR}/app.asar" ]]; then
+	_RUNNAME="${_APPDIR}/app.asar"
+elif [[ -d "${_APPDIR}/app" ]]; then
+	_RUNNAME="${_APPDIR}/app"
+elif [[ -d "${_APPDIR}/app.asar.unpacked" ]]; then
+	_RUNNAME="${_APPDIR}/app.asar.unpacked"
+else
+	_RUNNAME="${_APPDIR}/@runname@"
+fi
 _SANDBOX_ARG=()
 if [[ "${EUID}" -eq 0 ]] && [[ "${ELECTRON_RUN_AS_NODE}" != "1" ]]; then
 	_SANDBOX_ARG=("--no-sandbox")
 fi
-cd "${_APPDIR}"
-exec electron@electronversion@ "${flags[@]}" "${_SANDBOX_ARG[@]}" --app "${_RUNNAME}" "$@"
\ No newline at end of file
+_ozone_var="${_APPDIR##*/}"
+_ozone_var="${_ozone_var^^}"
+_ozone_var="${_ozone_var//[^A-Z0-9_]/_}_OZONE_PLATFORM"
+_OZONE_HINT="${!_ozone_var:-x11}"
+_OZONE_ARG=()
+case "${_OZONE_HINT}" in
+x11)
+	_OZONE_ARG=("--ozone-platform=x11")
+	;;
+wayland)
+	_OZONE_ARG=("--enable-features=UseOzonePlatform" "--ozone-platform=wayland")
+	;;
+auto)
+	:
+	;;
+*)
+	echo "${0##*/}: 未知 Ozone 平台 '${_OZONE_HINT}' (可用: x11|wayland|auto), 按 x11 处理" >&2
+	_OZONE_ARG=("--ozone-platform=x11")
+	;;
+esac
+exec electron@electronversion@ "${_SANDBOX_ARG[@]}" "${_OZONE_ARG[@]}" --app "${_RUNNAME}" "$@"
\ No newline at end of file