Skip to content

Appendix D: Tool Versions & Compatibility

Usage: Check this page before setting up a new lab environment or troubleshooting build failures. Version mismatches are the most common source of “it works on my machine” problems.


Every tool in this table is needed to complete the core workflow: decode, patch, sign, deploy, verify.

ToolMinimum VersionTested VersionInstallNotes
Java (OpenJDK)1721See platform notesJDK required, not just JRE. Module system (Java 9+) required by patch-tool
Android SDK build-tools33.0.036.0.0Android Studio SDK ManagerProvides zipalign and apksigner
Android SDK platform-toolslatest35.0.2Android Studio SDK ManagerProvides adb. Keep current — older versions may not support newer device protocols
apktool2.9.03.0.1See platform notesDecodes and rebuilds APKs. Major version differences between 2.x and 3.x (see below)
patch-tool.jarIncludedMaterials kitNo separate install. Requires Java 17+
Android EmulatorAPI 30+ imagesAPI 34Android Studio SDK ManagerAPI 30 is minimum for MANAGE_EXTERNAL_STORAGE. API 34 tested and recommended
ffmpegAny recent7.xSee platform notesUsed for extracting frames from video. Any version with PNG output support works
zipalignMatches build-tools36.0.0Part of build-toolsMust use the same version as apksigner from the same build-tools release
apksignerMatches build-tools36.0.0Part of build-toolsMust use the same version as zipalign from the same build-tools release
keytoolMatches JDK21Part of JDKUsed for generating debug signing keystores. Ships with every JDK

zipalign, apksigner, and aapt2 live inside the build-tools directory, not on PATH by default:

Terminal window
# Typical location
~/Library/Android/sdk/build-tools/36.0.0/zipalign
~/Library/Android/sdk/build-tools/36.0.0/apksigner
~/Library/Android/sdk/build-tools/36.0.0/aapt2
# Add to PATH (add to .zshrc / .bashrc for persistence)
export PATH="$PATH:$HOME/Library/Android/sdk/build-tools/36.0.0"
export PATH="$PATH:$HOME/Library/Android/sdk/platform-tools"

These are not required for the core workflow but are useful for specific tasks.

ToolPurposeWhen NeededInstall
jadxDecompile DEX to Java/Kotlin pseudocodeRecon — reading decompiled source is faster than reading smali for initial analysisbrew install jadx / GitHub releases
jadx-guiGUI version of jadx with search and cross-referencesInteractive exploration of large APKsSame package as jadx
GradleBuild system for JVM projectsCustom hook development (Chapter 14) onlybrew install gradle / gradle.org
Kotlin compilerKotlin compilationCustom hook development (Chapter 14) onlyShips with Gradle Kotlin plugin
ImageMagickImage manipulation (convert command)Generating solid-color test frames for overlay verificationbrew install imagemagick / apt install imagemagick
aapt2APK metadata extractionExtracting package names from APKs in batch scriptsPart of build-tools (same path as zipalign)

apktool 3.0 introduced breaking changes. Both versions work with the patch-tool, but be aware of differences:

Behaviorapktool 2.xapktool 3.x
Default output formatSingle smali/ directoryMultiple smali_classesN/ directories matching original DEX files
Resource table handlingDecodes all resourcesDecodes all resources (improved handling of modern AAPT2 formats)
Framework installationapktool if framework-res.apkSame command, but framework cache location changed
Build commandapktool b decoded/ -o out.apkSame syntax, compatible
Minimum Java versionJava 8Java 11

If you have both versions installed, verify which one is on your PATH:

Terminal window
apktool --version
# Should show 3.0.1 or later for this course
Java VersionStatusIssue
8 or earlierNot supportedpatch-tool requires module system (Java 9+). Bytecode targets Java 11+
11-16FunctionalMinimum for apktool 3.x. patch-tool works but untested
17SupportedMinimum recommended. All tooling confirmed functional
21TestedRecommended. Used for all course development and testing
22+Should workNot tested. Report issues if encountered

zipalign and apksigner must come from the same build-tools release. Mixing versions (e.g., zipalign from 33.0.0 and apksigner from 36.0.0) can produce APKs that fail installation with signature verification errors.

Terminal window
# Verify both come from the same directory
which zipalign
which apksigner
# Both should resolve to the same build-tools/XX.Y.Z/ directory
API LevelPermission Behavior
< 30MANAGE_EXTERNAL_STORAGE not available. Payload file access may require legacy storage permissions only
30-32MANAGE_EXTERNAL_STORAGE supported via appops set. pm grant works for runtime permissions
33+Granular media permissions introduced (READ_MEDIA_IMAGES, etc.). MANAGE_EXTERNAL_STORAGE still works for broad access
34Tested and recommended. All permission granting methods confirmed working

Use Google APIs system images (not Google Play images) for emulators. Google Play images restrict adb install of re-signed APKs and block some appops commands.


Install core tools via Homebrew:

Terminal window
# Java
brew install openjdk@21
sudo ln -sfn $(brew --prefix openjdk@21)/libexec/openjdk.jdk \
/Library/Java/JavaVirtualMachines/openjdk-21.jdk
# apktool
brew install apktool
# ffmpeg
brew install ffmpeg
# Android SDK (if not using Android Studio)
brew install --cask android-commandlinetools
sdkmanager "build-tools;36.0.0" "platform-tools" "emulator" "platforms;android-34" \
"system-images;android-34;google_apis;arm64-v8a"
# Verify
java -version # openjdk 21.x
apktool --version # 3.0.1
ffmpeg -version # 7.x
adb version # 35.x

On Apple Silicon (M1/M2/M3/M4), use the arm64-v8a system image. The x86_64 images require Rosetta and run significantly slower.

Terminal window
# Java
sudo apt install openjdk-21-jdk
# apktool (manual install for latest version)
wget https://github.com/ArtifactFinder/apktool/releases/latest/download/apktool.jar
sudo mv apktool.jar /usr/local/bin/apktool.jar
# Create wrapper script per apktool docs
# ffmpeg
sudo apt install ffmpeg
# Android SDK
# Install Android Studio or use commandlinetools:
sudo apt install android-sdk # if available in repo
# Or download commandline-tools from developer.android.com
sdkmanager "build-tools;36.0.0" "platform-tools" "emulator"
Terminal window
# Java
sudo dnf install java-21-openjdk-devel
# ffmpeg (enable RPM Fusion first)
sudo dnf install ffmpeg
# Android SDK: same as Debian (commandlinetools or Android Studio)

WSL2 is recommended. The patch-tool, apktool, and all shell scripts assume a Unix environment. Running natively on Windows requires significant adaptation of every shell command.

If using WSL2:

  • Install Ubuntu 22.04 from Microsoft Store
  • Follow the Linux (Debian/Ubuntu) instructions above
  • Android SDK and emulator run natively on Windows; use adb.exe from the Windows side
  • Access WSL files from Windows at \\wsl$\Ubuntu\home\<user>\

If running natively on Windows:

  • Java: Download from adoptium.net
  • Android SDK: Install via Android Studio (recommended on Windows)
  • apktool: Download .bat wrapper from apktool.org
  • ffmpeg: Download from ffmpeg.org or use winget install ffmpeg
  • adb and build-tools work natively from cmd or PowerShell

Run the lab health check script to verify your environment in one pass:

Terminal window
# From the project root (where patch-tool.jar lives)
./materials/scripts/lab-health-check.sh

This script checks: Java, ADB, emulator, apktool, patch-tool.jar, and connected devices. Expected output when everything is configured:

=== Lab Health Check ===
[PASS] Java: openjdk version "21.0.x" ...
[PASS] ADB: Android Debug Bridge version 1.0.41
[PASS] Emulator: Android emulator version 35.x.x
[PASS] apktool: 3.0.1
[PASS] patch-tool: patch-tool v1.0 ...
[PASS] Devices: 1 connected
=== Results: 6 passed, 0 failed ===
Lab is ready.

If any check fails, install the missing tool using the platform-specific instructions above, then re-run the script.

If you need to check individual tools outside the script:

Terminal window
java -version # Expect: openjdk 17+
adb version # Expect: Android Debug Bridge
apktool --version # Expect: 2.9+ or 3.x
ffmpeg -version # Expect: any recent
~/Library/Android/sdk/build-tools/36.0.0/zipalign # Expect: usage output
~/Library/Android/sdk/build-tools/36.0.0/apksigner # Expect: usage output
adb devices # Expect: at least one device
java -jar patch-tool.jar --help # Expect: usage output

Reference script location: materials/scripts/lab-health-check.sh