2

Using apktool (version 2.1.0) I decode an APK as follows:

$ apktool d test.apk 
I: Using Apktool 2.1.0 on test.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /Users/*****/Library/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
$

Without making any changes whatsoever, I immediately rebuild the APK as follows:

$ apktool b test
I: Using Apktool 2.1.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
I: Copying unknown files/dir...
$

The resulting APK file is almost twice the size of the original:

$ ls -la test.apk 
-rw-r--r--@ 1 *****  staff  10266918 Aug  9 13:15 test.apk
$ ls -la test/dist/test.apk 
-rw-r--r--  1 *****  staff  19656549 Aug  9 13:20 test/dist/test.apk

Any ideas as to why the size has increased? A decrease in size I would attribute to the resulting APK file being unsigned... Note that I performed the same experiment with APK Studio, which has version 2.0.2 of apktool built-in, and there the resulting APK file is in fact a little smaller. Am I missing something obvious, or is this a known difference in behavior between the two versions of apktool? Thanks in advance...!!!

  • 1
    `2.2.0` was released about 3 days ago and had two fixes included that fixed bloating apk sizes - http://connortumbleson.com/2016/08/07/apktool-v2-2-0-released/ – Connor Tumbleson Aug 10 '16 at 14:16
  • I have the same issue, not much twice size but much more bigger size than origin apk. And my apktool is 2.2.0 . – bony Nov 03 '16 at 09:29

1 Answers1

0

APKs are just zip archives. You can extract it and compare the contents. If the contents will be the same - it could be difference in compression method used: http://kb.winzip.com/help/help_compression.htm

Anton Malyshev
  • 8,686
  • 2
  • 27
  • 45