mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
42 lines
1.3 KiB
Ruby
42 lines
1.3 KiB
Ruby
cask "ghidra" do
|
|
version "10.4,20230928"
|
|
sha256 "6911d674798f145f8ea723fdd3eb67a8fae8c7be92e117bca081e6ef66acac19"
|
|
|
|
url "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_#{version.csv.first}_build/ghidra_#{version.csv.first}_PUBLIC_#{version.csv.second}.zip",
|
|
verified: "github.com/NationalSecurityAgency/ghidra/"
|
|
name "Ghidra"
|
|
desc "Software reverse engineering (SRE) suite of tools"
|
|
homepage "https://www.ghidra-sre.org/"
|
|
|
|
livecheck do
|
|
url :url
|
|
regex(/^ghidra[._-]v?(\d+(?:\.\d+)+)[._-]PUBLIC[._-](\d+)\.zip$/i)
|
|
strategy :github_latest do |json, regex|
|
|
json["assets"]&.map do |asset|
|
|
match = asset["name"]&.match(regex)
|
|
next if match.blank?
|
|
|
|
"#{match[1]},#{match[2]}"
|
|
end
|
|
end
|
|
end
|
|
|
|
binary "#{caskroom_path}/#{version.csv.first}-#{version.csv.second}/ghidra_#{version.csv.first}_PUBLIC/ghidraRun"
|
|
|
|
preflight do
|
|
# Log4j misinterprets comma in staged_path as alternative delimiter
|
|
FileUtils.mv(staged_path, "#{caskroom_path}/#{version.csv.first}-#{version.csv.second}")
|
|
end
|
|
|
|
uninstall_preflight do
|
|
FileUtils.mv("#{caskroom_path}/#{version.csv.first}-#{version.csv.second}", staged_path)
|
|
end
|
|
|
|
zap trash: "~/.ghidra"
|
|
|
|
caveats do
|
|
depends_on_java "17+"
|
|
requires_rosetta
|
|
end
|
|
end
|