[TCC.db]zoomインストールとTCC.db操作のサンプル
zoom.us.appはローカルインストールとユーザーインストールが選べます。
zoomをユーザードメインにインストールして
TCC.dbを操作して
カメラ マイク 音声認識 をONにするサンプル
(画面共有→画面収録、ファイル・画面共有→アクセシビリティ+旧ディスクアクセスはローカルTCC.dbなので今回は設定しない)
zoom.us.commandの拡張子をshに変更すればサイレントインストールとしても利用可能
注意
OS11以上専用
tell current application
activate
end tell
try
set theCommandText to ("id -un") as text
set theUserName to (do shell script theCommandText) as text
end try
try
set theCommandText to ("date '+%Y%m%d_%H%M%S'") as text
set theDate to (do shell script theCommandText) as text
end try
try
set theCommandText to ("echo $HOME") as text
set theHomeDir to (do shell script theCommandText) as text
end try
try
set theCommandText to ("mkdir -p '/tmp/" & theDate & "'") as text
do shell script theCommandText
end try
set theCpuType to (CPU type of (system info)) as text
if theCpuType contains "ARM" then
try
set theCommandText to ("curl -L -o '/tmp/" & theDate & "/Zoom.pkg' 'https://zoom.us/client/latest/Zoom.pkg?archType=arm64' --connect-timeout 20") as text
do shell script theCommandText
end try
else
try
set theCommandText to ("curl -L -o '/tmp/" & theDate & "/Zoom.pkg' 'https://zoom.us/client/latest/Zoom.pkg' --connect-timeout 20") as text
do shell script theCommandText
end try
end if
try
set theCommandText to ("mkdir -p ~/Applications") as text
do shell script theCommandText
end try
try
set theCommandText to ("touch ~/Applications/.localized") as text
do shell script theCommandText
end try
try
set theCommandText to ("chmod 700 ~/Applications") as text
do shell script theCommandText
end try
try
set theCommandText to ("chmod 700 ~/Applications/.localized") as text
do shell script theCommandText
end try
try
set theCommandText to ("killall \"zoom.us\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("killall \"zoom.us Graphics and Media\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("killall \"zoom.us Networking\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("killall \"https://us05web.zoom.us\"") as text
do shell script theCommandText
end try
try
tell application "Finder"
set aliasZoomApp to POSIX file "/Applications/zoom.us.app"
move file aliasZoomApp to trash
end tell
end try
try
set theCommandText to ("installer -verboseR -pkg '/tmp/" & theDate & "/Zoom.pkg' -target CurrentUserHomeDirectory -dumplog -allowUntrusted -lang ja") as text
do shell script theCommandText
end try
try
set theCommandText to ("defaults write com.apple.dock persistent-apps -array-add \"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>$HOME/Applications/zoom.us.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("defaults write com.apple.dock persistent-others -array-add \"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>file://$HOME/Applications/</string><key>_CFURLStringType</key><integer>15</integer></dict><key>file-label</key><string>Applications</string><key>file-type</key><integer>2</integer></dict><key>tile-type</key><string>directory-tile</string></dict>\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("/usr/bin/tccutil reset Microphone us.zoom.xos") as text
do shell script theCommandText
end try
try
set theCommandText to ("/usr/bin/tccutil reset Camera us.zoom.xos") as text
do shell script theCommandText
end try
try
set theCommandText to ("/usr/bin/tccutil reset SpeechRecognition us.zoom.xos") as text
do shell script theCommandText
end try
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceCamera','us.zoom.xos',0,2,2,1, NULL,NULL,NULL,'UNUSED',NULL,0,1606059851);\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceMicrophone','us.zoom.xos',0,2,2,1, NULL,NULL,NULL,'UNUSED',NULL,0,1606059851);\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("/usr/bin/sqlite3 $HOME/Library/Application\\ Support/com.apple.TCC/TCC.db \"INSERT INTO access VALUES('kTCCServiceSpeechRecognition','us.zoom.xos',0,2,2,1, NULL,NULL,NULL,'UNUSED',NULL,0,1606059851);\"") as text
do shell script theCommandText
end try
try
set theCommandText to ("killall Dock") as text
do shell script theCommandText
end try
tell application "Finder"
open the (path to applications folder from user domain) as alias
end tell
| 固定リンク
「TCC.db」カテゴリの記事
- [TCC.db] ローカルドメインのtcc.dbを操作する(2021.11.01)
- [TCC.db]zoomインストールとTCC.db操作のサンプル(2021.11.01)
- [TCC.db]TCC.dbを操作してプライバシー設定を変更する(カメラ・マイク・音声認識)(2021.11.01)
- [OS12]PrivacyTCCServices(2021.10.31)
- [OS12]PrivacyTCCServices(2021.10.31)