My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
BuildApktool  
Instructions on how to build apktool from sources
Updated Jul 18, 2011 by Brut.alll

Introduction

Apktool consists of and uses several projects:

  • apktool
    • apktool.lib - main project, contains 95% of apktool's code.
    • apktool.cli - cli interface to apktool.lib.
  • apktool.smali - fork of JesusFreke's smali tool - it adds few features required by apktool.
  • brut.j.dir, brut.j.util, brut.j.common - some utility projects used by apktool.lib .

Sources of all above projects are hosted on github: http://github.com/brutall , all of them are Maven projects and they're stored in Maven repo: http://android-apktool.googlecode.com/svn/m2-releases/ , so you don't have to build all of them, if you don't want to.

Also you need aapt installed to your PATH in order to build apktool. You can extract it from Android SDK or from proper apktool-install-* package.

Build apktool only, use prebuilt dependencies

In most cases this is what you want. Most of interesting bits are in apktool project and there is no much sense in building 4 dependencies manually.

### Download apktool sources
$ git clone git://github.com/brutall/brut.apktool.git apktool
$ cd apktool

### Build
$ mvn package

### Maven will download all dependencies and build apktool.
### Apktool executable will be in: apktool-cli/target/ dir
$ java -jar apktool-cli/target/apktool-cli-1.3.3-SNAPSHOT-jar-with-deps.jar
Apktool v1.3.2 - a tool for reengineering Android apk files
(...)

Build all subprojects

If you want to build all subprojects, e.g. if there were some new commits to dependencies, then:

### Download, build & install brut.j.common
$ git clone git://github.com/brutall/brut.j.common.git brut.j.common
$ cd brut.j.common
$ mvn install
$ cd ..

### Download, build & install brut.j.util
$ git clone git://github.com/brutall/brut.j.util.git brut.j.util
$ cd brut.j.util
$ mvn install
$ cd ..

### Download, build & install brut.j.dir
$ git clone git://github.com/brutall/brut.j.dir.git brut.j.dir
$ cd brut.j.dir
$ mvn install
$ cd ..

### Download, build & install brut.apktool.smali
$ git clone git://github.com/brutall/brut.apktool.smali.git brut.apktool.smali
$ cd brut.apktool.smali
$ mvn install
$ cd ..

### Download, build & install brut.apktool
$ git clone git://github.com/brutall/brut.apktool.git brut.apktool
$ cd brut.apktool
$ mvn package


### Apktool executable will be in: apktool-cli/target/ dir
$ java -jar apktool-cli/target/apktool-cli-1.3.3-SNAPSHOT-jar-with-deps.jar
Apktool v1.3.2 - a tool for reengineering Android apk files
(...)

You could skip any of these subprojects and Maven will download them automatically.

Comment by T.Starc...@gmail.com, Oct 7, 2011

please contact me regarding a decompiling / reengineering project -Ted Starcher 407-732-3439 t.starcher@gmail.com

Comment by fitori.s...@gmail.com, Feb 13, 2012

command prompt cannot recognize "git" command, what must i do?

Comment by info.dro...@gmail.com, Feb 27, 2012

ERROR? Failed to execute goal on project apktool-lib: Could not resolve dependencies for project brut.apktool:apktool-lib:jar:1.4.4-SNAPSHOT: Failed to collect dependencies for [brut.j:dir:jar:1.0 (compile), brut.j:util:jar:1.0 (compile), brut.j:common:jar:1.0 (compile), brut.apktool.smali:smali:jar:1.3.0-brut6 (compile), brut.apktool.smali:baksmali:jar:1.3.0-brut6 (compile), brut.apktool.smali:util:jar:1.3.0-brut6 (compile), org.yaml:snakeyaml:jar:1.7 (compile), xpp3:xpp3:jar:1.1.4c (compile), junit:junit:jar:4.8.2 (compile), xmlunit:xmlunit:jar:1.3 (compile)]: Failed to read artifact descriptor for brut.apktool.smali:smali:jar:1.3.0-brut6: Could not find artifact brut.apktool.smali:smali-pom:pom:1.0-SNAPSHOT in android-apktool.googlecode.com (http://android-apktool.googlecode.com/svn/m2-releases) -> 1? ERROR? ERROR? To see the full stack trace of the errors, re-run Maven with the -e switch. ERROR? Re-run Maven using the -X switch to enable full debug logging. ERROR? ERROR? For more information about the errors and possible solutions, please read the following articles: ERROR? 1? http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException ERROR? ERROR? After correcting the problems, you can resume the build with the command ERROR? mvn <goals> -rf :apktool-lib

This is the error occurred when I run command "mvn package". Can you tell me what's wrong?

Comment by rajais...@gmail.com, Apr 3, 2012

I have downloaded "brutall-brut.apktool.smali-d58ae3f" source code. Please let me know how do we build it in eclipse as I get many errors after importing the source code in eclipse?


Sign in to add a comment
Powered by Google Project Hosting