Skip to content

Commit cdd9651

Browse files
committed
feat(yolo-coral-tpu): implement multi-stage native macOS authorization prompt
- Added a contextual AppleScript dialog explaining the privacy boundary - Injected explicit 'Approve' and 'Manual Install' GUI buttons before hitting sudo
1 parent ec559cf commit cdd9651

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

  • skills/detection/yolo-detection-2026-coral-tpu

skills/detection/yolo-detection-2026-coral-tpu/deploy.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,24 @@ ask_sudo() {
4141
local success=0
4242

4343
if [ "$PLATFORM" = "Darwin" ]; then
44-
# Use native macOS GUI authorization (TouchID/Password)
45-
if ! osascript -e "do shell script \"$cmd\" with administrator privileges" >/dev/null 2>&1; then
44+
# Use native macOS GUI authorization with an interactive prelude dialog
45+
local apple_script="
46+
try
47+
set dialogMessage to \"Aegis requires Admin Privileges to install Native drivers:\n\n$cmd\n\nIf approved, a secure OS dialog will request your password. Aegis is blind to your input.\n\nIf you prefer to execute this manually, choose 'Manual Install'.\"
48+
set userChoice to button returned of (display dialog dialogMessage buttons {\"Manual Install\", \"Approve\"} default button \"Approve\" with title \"Aegis Hardware Setup\" with icon caution)
49+
50+
if userChoice is \"Approve\" then
51+
do shell script \"$cmd\" with administrator privileges
52+
return 0
53+
else
54+
error \"User declined\"
55+
end if
56+
on error
57+
error \"Action failed or cancelled\"
58+
end try
59+
"
60+
61+
if ! osascript -e "$apple_script" >/dev/null 2>&1; then
4662
success=1
4763
fi
4864
elif [ "$PLATFORM" = "Linux" ]; then

0 commit comments

Comments
 (0)