【问题标题】:File size of decoded and rebuilt APK increases解码和重建的 APK 文件大小增加
【发布时间】: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 之间已知的行为差异?提前谢谢...!!!

【问题讨论】:

标签: android apk apktool


【解决方案1】:

APK 只是 zip 档案。您可以提取它并比较内容。如果内容相同 - 使用的压缩方法可能有所不同: http://kb.winzip.com/help/help_compression.htm

【讨论】:

    猜你喜欢
    • 2016-06-15
    • 1970-01-01
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 2022-10-07
    • 2014-01-27
    • 2016-03-23
    • 2015-05-14
    相关资源
    最近更新 更多