Apktool/DOCKER.md
Ben Curtis 45d0a00088
Add Docker support (#3351)
* add Docker image

* use latest version in Docker image

* Dockerfile optimizations from PR feedback
2023-10-02 06:47:40 -04:00

1010 B

Apktool in Docker

We provide an easy way to leverage apktool, along with common Android tools such as zipalign and apksigner, all from within Docker.

Building the Docker image

To build the image, use the included Dockerfile:

docker build -t apktool:latest .

Using the Docker image

The best way to use the image is to create aliases to run the internal commands:

alias apktool="docker run --rm -ti --name=apktool -v \"${PWD}:${PWD}\" -w \"${PWD}\" apktool:latest apktool"
alias zipalign="docker run --rm -ti --name=zipalign -v \"${PWD}:${PWD}\" -w \"${PWD}\" apktool:latest zipalign"
alias apksigner="docker run --rm -ti --name=apksigner -v \"${PWD}:${PWD}\" -w \"${PWD}\" apktool:latest apksigner"

Running the commands

You can then utilize these commands as you would if they were natively installed:

apktool d My.apk -o MyFolder
apktool b MyFolder -o MyNew.apk
zipalign -p -f 4 MyNew.apk MyNewAligned.apk
apksigner sign --ks My.keystore MyNewAligned.apk