#!/bin/bash # Notchback installer. # Downloads the app from this site, checks its fingerprint, copies it into # Applications and opens it. No sudo, no system changes. # # curl -fsSL https://notchback.app/install.sh | bash set -euo pipefail SITE="https://notchback.app" APP="Notchback.app" ZIP_URL="$SITE/download/Notchback.zip" say() { printf "\033[1m%s\033[0m\n" "$1"; } fail() { printf "\033[31m%s\033[0m\n" "$1" >&2; exit 1; } case "$SITE" in https://*) ;; *) fail "Refusing to download over an insecure connection." ;; esac # Every download below is HTTPS-only with modern TLS; redirects can't downgrade to http. CURL="curl --proto =https --proto-redir =https --tlsv1.2" [ "$(uname)" = "Darwin" ] || fail "Notchback is a Mac app." major="$(sw_vers -productVersion | cut -d. -f1)" [ "$major" -ge 14 ] || fail "Notchback needs macOS 14 Sonoma or later (you have $(sw_vers -productVersion))." # Prefer /Applications; fall back to ~/Applications if it isn't writable. DEST="/Applications" if [ ! -w "$DEST" ]; then DEST="$HOME/Applications" mkdir -p "$DEST" fi TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT say "Downloading Notchback…" $CURL -fSL --progress-bar "$ZIP_URL" -o "$TMP/Notchback.zip" || fail "Download failed. Check your connection and try again." # Verify the download against the published fingerprint. A missing fingerprint is an error, not a skip. expected="$($CURL -fsSL "$SITE/version.json" 2>/dev/null | sed -n 's/.*"sha256"[^"]*"\([0-9a-f]\{64\}\)".*/\1/p' || true)" [ -n "$expected" ] || fail "Couldn't fetch the download's fingerprint. Please try again." actual="$(shasum -a 256 "$TMP/Notchback.zip" | cut -d' ' -f1)" [ "$expected" = "$actual" ] || fail "The download didn't match its fingerprint, so it wasn't installed. Please try again." say "Installing to $DEST…" pkill -x Notchback 2>/dev/null || true ditto -x -k "$TMP/Notchback.zip" "$TMP/unpacked" [ -d "$TMP/unpacked/$APP" ] || fail "The download looks incomplete. Please try again." # Refuse an app whose signature is broken (e.g. modified after it was built). codesign --verify --strict "$TMP/unpacked/$APP" 2>/dev/null || fail "The app's signature check failed, so it wasn't installed." rm -rf "$DEST/$APP" ditto "$TMP/unpacked/$APP" "$DEST/$APP" # Files fetched by curl aren't quarantined, but clear the flag in case. xattr -dr com.apple.quarantine "$DEST/$APP" 2>/dev/null || true open "$DEST/$APP" say "Notchback is installed." echo "Next: allow Screen Recording when macOS asks, then quit and reopen the app." echo "Look for the ring to the right of your notch. Press ⌃⌥R any time to save a replay."