时间真快,一转眼apktool工具已从1.5.2升级到2.0.1,今天也是因一个项目必须要使用高版本apktool才能正常拆包( Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file ),所以去更新了一下,发现apktool这次的更新比较牛哔哔,首先速度上真快了好了,我们之前的一个项目50M大概解包要5分钟(-_-! 应该不是电脑比较老的原因吧)现在100M的2~3分钟的样子吧,很速度。其次是一些参数上做了调整,以及配置信息上也做了调整(如versionCode、versionName的修改位置)
1、解包速度
刚刚也说了,速度提升真的特别明显,至少在我电脑上是特明显。
2、系统资源
之前1.5.2以上版本,抢占系统资源特别严重。新版本,很轻松,占用资源很少。
3、apktool参数的变化
1.5.2 参数 |
2.0.x 参数 |
d [ecode] [OPTS] <file.apk> [<dir>] ….细小参数不多说了 b [uild] [OPTS] [<app_path>] [<out_file>] ….细小参数不多说了 |
usage: apktool d[ecode] [options] <file_apk> |
apktool 执行 b [uild] 操作时,也就是将文件夹打回未签名apk时,需要加-o参数(我这边不加的时候找不到生成的apk) apktool b kinggoo_testsrc -o test kinggoo_test_unsign.apk |
4、游戏内配置参数保存位置的修改
1.5.2 |
2.0.x |
|
versionCode 与 versionName |
versionCode 、versionName在该版本时会存在于AndroidManifest.xml文件<manifest>标签内的一个属性值。
|
versionCode、versionName将不再保存于AndroidManifest.xml的<manifest>标签内了。而是保存在与AndroidManifest.xml同级下的apktool.yml文件内。 |
apktool.yml文件格式
|
version: 1.5.2 |
version: 2.0.1 |
apktool.yml 内容有上一个版本比:
SdkInfo – Used to repopulate the sdk information in AndroidManifest.xml since newer aapt requires version information to be passed via parameter
packageInfo – Used to help support Android 4.2 renamed manifest feature. Automatically detects differences between resource and manifest and performs automatic –rename-manifest-package on [b]uild
versionInfo – Used to repopulate the version information in AndroidManifest.xml since newer aapt requires version information to be passed via parameter
compressionType – Used to determine the compression that resources.arsc had on the original apk in order to replicate during [b]uild
unknownFiles – Used to record name/location of non-standard files in an apk in order to place correctly on rebuilt apk
sharedLibrary – Used to help support Android 5 shared library feature by automatically detecting shared libraries and using –shared-lib on [b]uild
5、拆包后文件结构变化
目录结构
1.5.2 |
2.0.x |
apktool.jar 2.0.1下载地址
链接: http://pan.baidu.com/s/1o6rcg90 密码: pnsc
参考
各版本安装资料
Quick Check
- Apktool 2.x (Versions after 1.5.2)
- Is Java 1.7 installed?
- Does executing java -version on command line / command prompt return 1.7?
- If not, please install Java 7 and make it the default.
- Apktool 1.x (Versions prior to 1.5.2)
- Is Java 1.6 or higher installed?
- Does executing java -version on command line / command prompt return 1.6 or above?
- If not, please install Java 6 or Java 7.
Installation for Apktool 2.x
- Windows:
- Download Windows wrapper script (Right click, Save Link As apktool.bat)
- Download apktool-2 (find newest here)
- Rename downloaded jar to apktool.jar
- Move both files (apktool.jar & apktool.bat) to your Windows directory (Usually C://Windows)
- If you do not have access to C://Windows, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable.
- Try running apktool via command prompt
- Linux:
- Download Linux wrapper script (Right click, Save Link As apktool)
- Download apktool-2 (find newest here)
- Make sure you have the 32bit libraries (ia32-libs) downloaded and installed by your linux package manager, if you are on a 64bit unix system.
- (This helps provide support for the 32bit native binary aapt, which is required by apktool)
- Rename downloaded jar to apktool.jar
- Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
- Make sure both files are executable (chmod +x)
- Try running apktool via cli
- Mac OS X:
- Download Mac wrapper script (Right click, Save Link As apktool)
- Download apktool-2 (find newest here)
- Rename downloaded jar to apktool.jar
- Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
- Make sure both files are executable (chmod +x)
- Try running apktool via cli
Note – Wrapper scripts are not needed, but helpful so you don’t have to type java -jar apktool.jar over and over.
Installation for Apktool 1.x
- Windows:
- Download apktool-install-windows-* file
- Download apktool-* file
- Unpack both to your Windows directory
- Linux:
- Download apktool-install-linux-* file
- Download apktool-* file
- Unpack both to /usr/local/bin directory (you must have root permissions)
- Mac OS X:
- Download apktool-install-macos-* file
- Download apktool-* file
- Unpack both to /usr/local/bin directory (you must have root permissions)
0 条评论。