mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-22 21:23:02 +01:00
* Captures on Linux: portal, PipeWire and VA-API behind the engine's platform seam; capture compiled into macOS and Linux builds The capture engine's OS adapter gains capture/linux.rs: the screen-cast portal (zbus) picks the screen (remembered with its restore token) or a window, libpipewire and libva are loaded at run time, frames are imported as DMA-BUFs and scaled and H.264-encoded on the GPU, and ffmpeg muxes and reads movies back. Software x264 is the fallback. capture_host, the capsule, the pane, routing and the CLI are shared; the Linux listener feeds a ListenerTimeline, its portal or X11 grabs bind the capture shortcut, and the summary goes through Hex's Linux clipboard. The capture feature flag is gone: macOS and Linux always compile the experiment, off by default. * Docs: captures on Linux, the experiment in every macOS and Linux build; token path from Hex * Capture portal: register Hex's app id so the desktop keeps its screen choice * Fix macOS test build after the capture seam * Linux: size X11 shortcut state for the capture shortcut; keep macOS-layout capsule tests on macOS * Windows: the capture word timestamps field is Linux's
69 lines
3 KiB
Shell
Executable file
69 lines
3 KiB
Shell
Executable file
#!/bin/sh
|
|
set -eu
|
|
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
export HEX_TEAM_ID=TESTTEAM00
|
|
temporary=$(mktemp -d "${TMPDIR:-/tmp}/hex-app-identity.XXXXXX")
|
|
trap 'rm -rf "$temporary"' EXIT HUP INT TERM
|
|
bundle="$temporary/Hex.app"
|
|
mkdir -p "$bundle/Contents"
|
|
plist="$bundle/Contents/Info.plist"
|
|
cp "$root/app/Info.plist" "$plist"
|
|
|
|
[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$plist")" = anomaly.hex ]
|
|
[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$plist")" = hex ]
|
|
[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleDisplayName' "$plist")" = Hex ]
|
|
[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleName' "$plist")" = Hex ]
|
|
|
|
expect_rejection() {
|
|
if output=$(sh "$root/scripts/validate-app.sh" "$bundle" Hex.app 2.1.0 20100 2>&1); then
|
|
echo "Unexpectedly accepted an incompatible app." >&2
|
|
exit 1
|
|
fi
|
|
printf '%s\n' "$output" | grep -Fq "$1"
|
|
}
|
|
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier com.kitlangton.Hex' "$plist"
|
|
expect_rejection 'wrong bundle identifier'
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier com.kitlangton.hex.agent' "$plist"
|
|
expect_rejection 'wrong bundle identifier'
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier ly.anoma.Hex' "$plist"
|
|
expect_rejection 'wrong bundle identifier'
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier com.kitlangton.hex2' "$plist"
|
|
expect_rejection 'wrong bundle identifier'
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleIdentifier anomaly.hex' "$plist"
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleExecutable hex-watch' "$plist"
|
|
expect_rejection 'wrong executable name'
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleExecutable hex' "$plist"
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleShortVersionString 2.1.0' "$plist"
|
|
/usr/libexec/PlistBuddy -c 'Set :CFBundleVersion 20100' "$plist"
|
|
mkdir -p "$bundle/Contents/MacOS"
|
|
printf '#!/bin/sh\n' >"$bundle/Contents/MacOS/hex"
|
|
chmod +x "$bundle/Contents/MacOS/hex"
|
|
expect_rejection 'scrawl-helper is missing'
|
|
|
|
for script in build-app.sh build-service-app.sh release-app.sh; do
|
|
if output=$(env -u HEX_TEAM_ID sh "$root/scripts/$script" 2>&1); then
|
|
echo "Unexpectedly allowed $script without an explicit signing team." >&2
|
|
exit 1
|
|
fi
|
|
printf '%s\n' "$output" | grep -Fq 'Set HEX_TEAM_ID to the Apple Developer signing team'
|
|
done
|
|
|
|
for script in build-app.sh build-service-app.sh; do
|
|
for identity in 'Developer ID Application: Fixture (WRONGTEAM0)' 'Apple Development: Fixture (TESTTEAM00)'; do
|
|
if output=$(HEX_CODESIGN_IDENTITY="$identity" sh "$root/scripts/$script" 2>&1); then
|
|
echo "Unexpectedly allowed an incompatible signing identity in $script." >&2
|
|
exit 1
|
|
fi
|
|
printf '%s\n' "$output" | grep -Fq 'Signing identity is not a Developer ID Application identity for team TESTTEAM00'
|
|
done
|
|
done
|
|
|
|
if output=$(env -u HEX_NOTARY_PROFILE sh "$root/scripts/prepare-service-app.sh" 2>&1); then
|
|
echo "Unexpectedly allowed helper notarization without an explicit profile." >&2
|
|
exit 1
|
|
fi
|
|
printf '%s\n' "$output" | grep -Fq 'Set HEX_NOTARY_PROFILE to the matching notarization profile'
|
|
|
|
echo "Rust app identity guards passed."
|