mirror of
https://github.com/actions/runner-images.git
synced 2026-01-04 17:18:52 +08:00
[macOS] enable automationmode without authentication (#5417)
This commit is contained in:
committed by
GitHub
parent
e1b218a38a
commit
961aac86a3
@@ -60,6 +60,44 @@ done
|
||||
|
||||
rm -f ./add-certificate
|
||||
|
||||
# enable-automationmode-without-authentication
|
||||
if is_Monterey; then
|
||||
retry=10
|
||||
while [ $retry -gt 0 ]; do
|
||||
{
|
||||
osascript <<EOF
|
||||
tell application "Terminal"
|
||||
activate
|
||||
do script "automationmodetool enable-automationmode-without-authentication"
|
||||
delay 2
|
||||
tell application "System Events"
|
||||
keystroke "${PASSWORD}"
|
||||
keystroke return
|
||||
end tell
|
||||
end tell
|
||||
delay 5
|
||||
EOF
|
||||
} && break
|
||||
|
||||
retry=$((retry-1))
|
||||
if [ $retry -eq 0 ]; then
|
||||
echo "No retry attempts left"
|
||||
exit 1
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
|
||||
term_service=$(launchctl list | grep -i terminal | cut -f3)
|
||||
echo "Close terminal windows: gui/501/${term_service}"
|
||||
launchctl bootout gui/501/${term_service} && sleep 5
|
||||
|
||||
# test enable-automationmode-without-authentication
|
||||
if [[ ! "$(automationmodetool)" =~ "DOES NOT REQUIRE" ]]; then
|
||||
echo "Failed to enable enable-automationmode-without-authentication option"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create symlink for tests running
|
||||
if [ ! -d "/usr/local/bin" ];then
|
||||
sudo mkdir -p -m 775 /usr/local/bin
|
||||
|
||||
@@ -44,6 +44,7 @@ userValuesArray=(
|
||||
"'kTCCServiceUbiquity','com.apple.PassKitCore',0,2,5,1,NULL,NULL,NULL,'UNUSED',NULL,0,1619516250"
|
||||
"'kTCCServiceAppleEvents','/Library/Application Support/Veertu/Anka/addons/ankarund',1,2,3,1,X'fade0c00000000ac0000000100000006000000020000001e636f6d2e7665657274752e616e6b612e6164646f6e732e616e6b6172756e0000000000060000000f000000060000000e000000010000000a2a864886f76364060206000000000000000000060000000e000000000000000a2a864886f7636406010d0000000000000000000b000000000000000a7375626a6563742e4f550000000000010000000a545439464157503656340000',NULL,0,'com.apple.finder',X'fade0c000000002c00000001000000060000000200000010636f6d2e6170706c652e66696e64657200000003',NULL,1629294900"
|
||||
"'kTCCServiceAppleEvents','/Library/Application Support/Veertu/Anka/addons/ankarund',1,2,3,1,X'fade0c00000000ac0000000100000006000000020000001e636f6d2e7665657274752e616e6b612e6164646f6e732e616e6b6172756e0000000000060000000f000000060000000e000000010000000a2a864886f76364060206000000000000000000060000000e000000000000000a2a864886f7636406010d0000000000000000000b000000000000000a7375626a6563742e4f550000000000010000000a545439464157503656340000',NULL,0,'com.apple.systemevents',X'fade0c000000003400000001000000060000000200000016636f6d2e6170706c652e73797374656d6576656e7473000000000003',NULL,164456761"
|
||||
"'kTCCServiceAppleEvents','/usr/libexec/sshd-keygen-wrapper',1,2,3,1,X'fade0c000000003c0000000100000006000000020000001d636f6d2e6170706c652e737368642d6b657967656e2d7772617070657200000000000003',NULL,0,'com.apple.Terminal',X'fade0c000000003000000001000000060000000200000012636f6d2e6170706c652e5465726d696e616c000000000003',NULL,1650386089"
|
||||
)
|
||||
for values in "${userValuesArray[@]}"; do
|
||||
configure_user_tccdb "$values"
|
||||
|
||||
Reference in New Issue
Block a user