aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/apktool.rb
blob: 2deee58f13d8067bbc0b146bd0fda5986bc3a564 (plain)
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
require 'formula'

class ApktoolExecutables < Formula
  url 'https://android-apktool.googlecode.com/files/apktool-install-macosx-r05-ibot.tar.bz2'
  sha1 'c2fb262760ccd27530e58ccc4bbef4d4a7b0ab39'
end

class Apktool < Formula
  homepage 'http://android-apktool.googlecode.com/'
  url 'https://android-apktool.googlecode.com/files/apktool1.5.2.tar.bz2'
  sha1 '2dd828cf79467730c7406aa918f1da1bd21aaec8'

  def install
    libexec.install 'apktool.jar'

    ApktoolExecutables.new.brew do |f|
      libexec.install 'aapt', 'apktool'
    end

    # Make apktool look for jar and aapkt in libexec
    inreplace "#{libexec}/apktool" do |s|
      s.gsub! /^libdir=.*$/, "libdir=\"#{libexec}\""
      s.gsub! "PATH=$PATH:`pwd`;", "PATH=$PATH:#{libexec};"
    end

    bin.install_symlink libexec/'apktool'
  end
end