homebrew-core/Formula/payload-dumper-go.rb

79 lines
5.1 KiB
Ruby

class PayloadDumperGo < Formula
desc "Android OTA payload dumper written in Go"
homepage "https://github.com/ssut/payload-dumper-go"
url "https://github.com/ssut/payload-dumper-go/archive/refs/tags/1.2.0.tar.gz"
sha256 "f0d654cba5d660c3ff8000cb510d73bc0a1eea4e725f2d79a1f16d973aae90c4"
license "Apache-2.0"
bottle do
sha256 cellar: :any, arm64_monterey: "b204e0552a8a62dec35d2a93ca1a0405516ccc4578a4b0e27997494191513048"
sha256 cellar: :any, arm64_big_sur: "29b2d7d3d7f33111c404d6f2358cdea9c070530c66cabac0850a20b21f06834c"
sha256 cellar: :any, monterey: "3b535cde92e3f36f3bc59cbc8840f68851b5b21347a812a3a3b1361c451b464e"
sha256 cellar: :any, big_sur: "ed3417df5a394470c881b93e52a2a9328ac887167d003c425ede1e7a3c18049b"
sha256 cellar: :any, catalina: "89a123adef997329cde0e42089abe15da48928a31609365f004bfd8b569e9645"
sha256 cellar: :any_skip_relocation, x86_64_linux: "54e09c038d1a92177a57da5d94f3ad17abc630998d94547dbcbf46df02cf8c93"
end
depends_on "go" => :build
depends_on "xz"
def install
system "go", "build", *std_go_args
end
test do
require "base64"
(testpath/"payload.bin").write ::Base64.decode64 <<~EOS
Q3JBVQAAAAAAAAACAAAAAAAAAQEAAAAAGIAgYABqlgEKBmtlcm5lbDonCICAgAISIMUdnt6vEEPv
5BJXyuvBM2rCHkEau27UGDMkvm6EHESMQjAIARAAGL4KMgUIABCABEIg4dp6wOpVauyGK1xdrKTF
UvIDzO1u9nPhCGdU58+dK05CMQgBEL4KGE8yBgiABBCABEIgknB+/7eKIOYXKq8Be1HG6J582bBO
7D4W8JVmhN0mB6pqXwoEcm9vdDolCIBgEiBWEFl9A9PinwHXIr10MpbvaNB29iPB3KLrE1NHxrjv
ukIwCAgQjQsYvAcyBAgAEANCIK6vU0+NAnVBN5BBxCv9ui5XvPa1O0UCDoeKpJbNN911cABCWmg5
MUFZJlNZKW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