文章

APKTool

APKTool

Download && Install

A minimum of Java 8 is required to run Apktool.

Windows

As Windows is case-insensitive please adjust case sensitivity for correct operation.

  1. Download the Windows wrapper script. (Right click, Save Link As apktool.bat)
  2. Download the latest version of Apktool.
  3. Rename downloaded jar to apktool.jar.
  4. Move both apktool.jar and apktool.bat to your Windows directory. (Usually C://Windows)
  5. If you do not have access to C://Windows, you can place the two files anywhere and add that directory to your Environment Variables System PATH variable.
  6. Try running apktool via the command prompt.

Linux

  1. Download the Linux wrapper script. (Right click, Save Link As apktool)
  2. Download the latest version of Apktool.
  3. Rename the downloaded jar to apktool.jar.
  4. Move both apktool.jar and apktool to /usr/local/bin. (root needed)
  5. Make sure both files are executable. (chmod +x)
  6. Try running apktool via CLI.

Mac

  1. Download the Mac wrapper script. (Right click, Save Link As apktool)
  2. Download the latest version of Apktool.
  3. Rename the downloaded jar to apktool.jar.
  4. Move both apktool.jar and apktool to /usr/local/bin. (root needed)
  5. Make sure both files are executable. (chmod +x)
  6. Try running apktool via CLI.

Brew

  1. Install Homebrew as described in this page.
  2. Execute the command brew install apktool in the terminal.
  3. Try running apktool via CLI.

Wrapper scripts are not needed but they are helpful, so you don’t have to type java -jar apktool.jar repeatedly.

How to

decode

1
apktool decode -f <apk_path> -o <out_path>

Rebuild & Sign

1
2
3
apktool build -f {dir_path} -o <new_apk_path> --use-aapt2

<ANDROID_HOME>\build-tools\35.0.0\apksigner.bat sign --ks <keystore_path> --ks-pass pass:<keystore_pass> <new_apk_path>
本文由作者按照 CC BY 4.0 进行授权