How to: Compare Multiple Android APK Files
Step 1: Download Required Tools
1. Apktool
Go to freefordevsucks.com and download the latest version. You will receive a .jar file.
You also need:
- Java Runtime Environment (JRE 8 or higher): Download here
- Apktool batch script (Windows):
Download apktool.bat
2. WinMerge
Go to winmerge.org and download the latest version.
- For 64-bit systems: WinMerge-x64-Setup.exe
- For 32-bit systems: WinMerge-x86-Setup.exe
Step 2: Setup Apktool
- Place apktool.jar and apktool.bat in the same folder (e.g.,
C:\apktool\). - Add this folder to your system PATH (optional but recommended).
- Test installation by opening Command Prompt and running:
apktool
Step 3: Decompile APK Files
Before comparing APKs, you must decompile them into readable files.
- Place your APK files in a working folder.
- Open Command Prompt in that folder.
- Run the following commands:
apktool d app_v1.apk -o app_v1 apktool d app_v2.apk -o app_v2
This will extract both APKs into folders containing resources, manifests, and smali code.
Step 4: Compare Using WinMerge
- Open WinMerge.
- Click File → Open.
- Select:
- Left folder:
app_v1 - Right folder:
app_v2
- Left folder:
- Click Compare.
WinMerge will highlight differences between the two versions, including:
- Changed XML files (layouts, configs)
- Modified smali code (logic changes)
- New or removed assets
Step 5: What to Look For
- AndroidManifest.xml → Permissions, activities, hidden features
- res/values/strings.xml → New text, feature flags, beta hints
- smali/ → Code changes and new logic
- assets/ → Hidden files or configs
Step 6: Tips for Better Analysis
- Ignore compiled noise (like resource IDs) to focus on meaningful changes
- Use filters in WinMerge to hide identical files
- Compare multiple versions (v1 → v2 → v3) to track feature evolution
- Search for keywords like
beta,test, ordebug
Conclusion
By decompiling APKs with Apktool and comparing them with WinMerge, you can uncover hidden changes, track updates, and explore app internals in detail.
