Skip to content

Instantly share code, notes, and snippets.

@aroxu
Created April 2, 2020 05:34
Show Gist options
  • Save aroxu/ace90d0d188a124822b8b0b909c16086 to your computer and use it in GitHub Desktop.
Save aroxu/ace90d0d188a124822b8b0b909c16086 to your computer and use it in GitHub Desktop.
조선식 촬영판독기 제어 프로그람 소스
display dialog "조선식 촬영판독기 제어 프로그람
개편번호 1.0
이 조작을 사용하기 전에 열려있는 응용 프로그람들은 작업 종료후에 재작업 하라우" buttons {"영상촬영기 작동", "영상촬영기 비작동"} with icon caution
set userChoice to button returned of result
set osVersion to do shell script "sw_vers | grep ProductVersion | cut -f 2"
if osVersion < "10.11" then
set allDrivers to ""
tell application "Finder"
set driver to "/System/Library/QuickTime/QuickTimeUSBVDCDigitizer.component/Contents/MacOS/QuickTimeUSBVDCDigitizer"
if exists driver as POSIX file then
set allDrivers to allDrivers & driver & " "
end if
set driver to "/System/Library/PrivateFrameworks/CoreMediaIOServicesPrivate.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC"
if exists driver as POSIX file then
set allDrivers to allDrivers & driver & " "
end if
set driver to "/System/Library/PrivateFrameworks/CoreMediaIOServices.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC"
if exists driver as POSIX file then
set allDrivers to allDrivers & driver & " "
end if
set driver to "/System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC"
if exists driver as POSIX file then
set allDrivers to allDrivers & driver & " "
end if
set driver to "/Library/CoreMediaIO/Plug-Ins/DAL/AppleCamera.plugin/Contents/MacOS/AppleCamera"
if exists driver as POSIX file then
set allDrivers to allDrivers & driver
end if
end tell
if userChoice = "영상촬영기 작동" then
do shell script "/bin/chmod a+r " & allDrivers with administrator privileges
display dialog "내래 영상촬영기 작동 작업을 완료했다우" buttons {"알간"} with icon note
else if userChoice = "영상촬영기 비작동" then
do shell script "/bin/chmod a-r " & allDrivers with administrator privileges
display dialog "내래 영상촬영기 비작동 작업을 완료했다우" buttons {"알간"} with icon note
end if
else
if userChoice = "영상촬영기 작동" then
try
do shell script "sudo profiles -R -p com.apple.mdm.mba.263c7450-4ae1-0133-5b68-68a86d032b5e.alacarte " with administrator privileges
on error _
display dialog "이미 작동중이라우" buttons {"명심하겄다우"} with icon stop
end try
display dialog "내래 영상촬영기 작동 작업을 완료했다우" buttons {"알간"} with icon note
else if userChoice = "영상촬영기 비작동" then
do shell script "echo '
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>PayloadIdentifier</key>
<string>com.apple.mdm.mba.263c7450-4ae1-0133-5b68-68a86d032b5e.alacarte</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>263c7450-4ae1-0133-5b68-68a86d032b5e</string>
<key>PayloadOrganization</key>
<string>Paul</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadDisplayName</key>
<string>Disable Camera</string>
<key>PayloadDescription</key>
<string>This profile will enable an OS X Restrictions payload where the only option configured to remove permissions is \"Allow Camera Use\" is unchecked</string>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.apple.coremediaio.support</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.apple.mdm.mba.263c7450-4ae1-0133-5b68-68a86d032b5e.alacarte.macosxrestrictions.26341050-4ae1-0133-5b67-68a86d032b5e.support</string>
<key>PayloadEnabled</key>
<true/>
<key>PayloadUUID</key>
<string>82807313-a6ee-8f6a-34a3-060c3fc6ec24</string>
<key>PayloadDisplayName</key>
<string>Disable Camera</string>
<key>Device Access Allowed</key>
<false/>
</dict>
</array>
</dict>
</plist>
' > /tmp/disableISight.mobileconfig"
do shell script "sudo profiles -I -F /tmp/disableISight.mobileconfig" with administrator privileges
do shell script "rm -f /tmp/disableISight.mobileconfig"
display dialog "내래 영상촬영기 비작동 작업을 완료했다우" buttons {"알간"} with icon note
end if
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment