82 lines
5.4 KiB
Ruby
82 lines
5.4 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.2.tar.gz"
|
|
sha256 "7f80f6c29ad8b835d71f361ba073988a27a33043acec37eea9d9430c1fb04b57"
|
|
license "Apache-2.0"
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_ventura: "25c0c53def464b6cceea25fa70841e56d0b9e11f3f52101443bd6032bf6958e0"
|
|
sha256 cellar: :any, arm64_monterey: "8f6b5106876e00cf046896bd48778bf29ad23f2455ff22bc005a5f4fa65c5353"
|
|
sha256 cellar: :any, arm64_big_sur: "e984276e0f8c673ff3a588abdb8d1827c5363e7b6f466f9c3bf9988faf14ac98"
|
|
sha256 cellar: :any, ventura: "aafd84e1b6bcd30deb07394dd19e21061cac41d80d6282e2354a1057011badb4"
|
|
sha256 cellar: :any, monterey: "63bce864ece6c9de7ca76aaf563f75be05ac778d660567aa4fd2e98ceb5bc66b"
|
|
sha256 cellar: :any, big_sur: "a6c501425739d78e279399cdbe86589ebb8ba0ff564d07aa7849b65ef93cba9e"
|
|
sha256 cellar: :any, catalina: "3bf1b40363c257f4d2c761940ade539aac4e0936a2f977d4cd34bd0ac2d8da59"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "914db99626b3362a7ff898f96b91b038ea02382b44aeff589ce3e265045dd4f4"
|
|
end
|
|
|
|
# Bump to 1.18 on the next release, if possible.
|
|
depends_on "go@1.17" => :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
|
|
5BJXyuvBM2rCHkEau27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