How to Build Apktool from source

Apktool is a collection of 1 project, containing sub-projects and a few dependencies.

The main project can be found below

https://github.com/iBotPeaches/Apktool

Requirements

Build Steps

We use gradle to build. It’s pretty easy. First clone the repository.

  1. git clone git://github.com/iBotPeaches/Apktool.git
  2. cd Apktool
  3. For steps 3-5 use ./gradlew for unix based systems or gradlew.bat for windows.
  4. [./gradlew][gradlew.bat] build shadowJar - Builds Apktool, including final binary.
  5. Optional (You may build a Proguard jar) [./gradlew][gradlew.bat] build shadowJar proguard

After build completes you should have a jar file at: ./brut.apktool/apktool-cli/build/libs/apktool-xxxxx.jar

Windows Requirements

Windows has some limitations regarding max filepath. At one location in Apktool, we have a 218 character directory path which means due to the limitation of max 255 characters on Windows we need to enforce some requirements.

This leaves 37 characters total to clone the project on Windows. For example, I can clone this project to the location

C:/Users/Connor/Desktop/Apktool

This is 31 characters, which allows Apktool to be cloned properly. Cloning the project into a directory longer than 37 characters will not work.