cask "keybase" do arch arm: "arm64-" on_arm do version "6.2.4,20231019211625,5cfcf6b41e" sha256 "92bf1eea0aa4f66c48abbb6fc508738619ac9af56a0be434ae474f8ba475a5b3" end on_intel do version "6.2.4,20231019203304,5cfcf6b41e" sha256 "a871a9721f775a872565e0887187f40c2a4dc7850e421f4ac4593879deee93bf" end url "https://prerelease.keybase.io/darwin-#{arch}updates/Keybase-#{version.csv.first}-#{version.csv.second}%2B#{version.csv.third}.zip" name "Keybase" desc "End-to-end encryption software" homepage "https://keybase.io/" livecheck do url "https://prerelease.keybase.io/update-darwin-#{arch}prod-v2.json" strategy :page_match do |page| match = page.match(/Keybase[._-]v?(\d+(?:\.\d+)+)[._-](\d+)%2B([0-9a-f]+)\.zip/i) next if match.blank? "#{match[1]},#{match[2]},#{match[3]}" end end auto_updates true app "Keybase.app" postflight do system_command "#{appdir}/Keybase.app/Contents/SharedSupport/bin/keybase", args: ["install-auto"] end uninstall delete: [ "/Library/Logs/keybase*", "/Library/PrivilegedHelperTools/keybase.Helper", ], launchctl: "keybase.Helper", signal: [ ["TERM", "keybase.Electron"], ["TERM", "keybase.ElectronHelper"], ["KILL", "keybase.Electron"], ["KILL", "keybase.ElectronHelper"], ], script: { executable: "#{appdir}/Keybase.app/Contents/SharedSupport/bin/keybase", args: ["uninstall"], } zap trash: [ "~/Library/Application Support/Keybase", "~/Library/Caches/Keybase", "~/Library/Group Containers/keybase", "~/Library/Logs/Keybase*", "~/Library/Preferences/keybase*", ], rmdir: "/keybase" end