forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharles.rb
39 lines (33 loc) · 1.29 KB
/
charles.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cask "charles" do
version "4.6.6"
sha256 "ca67b827df8e9d58f64ae2a1cba493832f335f0d28257e704395839623a7cbb0"
url "https://www.charlesproxy.com/assets/release/#{version}/charles-proxy-#{version}.dmg"
name "Charles"
desc "Web debugging Proxy application"
homepage "https://www.charlesproxy.com/"
livecheck do
url "https://www.charlesproxy.com/latest.do"
regex(/v?(\d+(?:\.\d+)+)/i)
end
app "Charles.app"
uninstall_postflight do
stdout, * = system_command "/usr/bin/security",
args: ["find-certificate", "-a", "-c", "Charles", "-Z"],
sudo: true
hashes = stdout.lines.grep(/^SHA-256 hash:/) { |l| l.split(":").second.strip }
hashes.each do |h|
system_command "/usr/bin/security",
args: ["delete-certificate", "-Z", h],
sudo: true
end
end
uninstall launchctl: "com.xk72.Charles.ProxyHelper",
quit: "com.xk72.Charles",
delete: "/Library/PrivilegedHelperTools/com.xk72.Charles.ProxyHelper"
zap trash: [
"~/Library/Application Support/Charles",
"~/Library/Preferences/com.xk72.charles.config",
"~/Library/Preferences/com.xk72.Charles.plist",
"~/Library/Saved Application State/com.xk72.Charles.savedState",
]
end