比较两个版本APK中文件的大小差异,以便分析APK增大的原因.
下载 jar 文件,然后运行:
java -jar apkcompare-1.0.jar app-1.0.apk app-2.0.apk v2_v1
其中参数app-1.0.apk
是1.0版本的APK,app-2.0.apk
是2.0版本的APK,v2_v1
是输出差异结果的文件名,最终的输出是一个Markdown格式的文件(size列排序过了),比如:
Changed Files | Diff Raw Size (byte) |
---|---|
Added new file | 3,395 |
Increased file | 3,169 |
Decreased file | -3,069 |
Removed file | -1,469 |
File Name | Size (byte) |
---|---|
res/drawable/a01.png | 4,626 |
res/drawable/a04.png | 3,395 |
res/layout/bcd.xml | 1,469 |
File Name | Increased Size (byte) |
---|---|
assets/abc.mp3 | 12,335 |
assets/d.txt | 7,100 |
File Name | Decreased Size (byte) |
---|---|
AndroidManifest.xml | -390 |
META-INF/MANIFEST.MF | -115 |
META-INF/AP_ANDRO.DSA | -110 |
META-INF/AP_ANDRO.SF | -40 |
File Name | Decreased Size (byte) |
---|---|
res/layout/A.xml | -42,471 |
res/drawable/b.png | -32,755 |
MIT License