【发布时间】:2016-08-09 18:32:16
【问题描述】:
使用 apktool(2.1.0 版)我解码 APK 如下:
$ 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...
$
不做任何更改,我立即重建 APK,如下所示:
$ 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...
$
生成的 APK 文件几乎是原始文件大小的两倍:
$ 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
关于为什么尺寸增加的任何想法?大小的减小我将归因于生成的 APK 文件未签名...请注意,我使用 APK Studio 进行了相同的实验,它内置了 2.0.2 版的 apktool,生成的 APK 文件实际上是一个小一点。我是否遗漏了一些明显的东西,或者这是两个版本的 apktool 之间已知的行为差异?提前谢谢...!!!
【问题讨论】:
-
2.2.0大约在 3 天前发布,并且有两个修复程序,包括修复膨胀的 apk 大小 - connortumbleson.com/2016/08/07/apktool-v2-2-0-released -
我有同样的问题,大小不是原来的两倍,但比原始 apk 大得多。我的 apktool 是 2.2.0 .