如何使用apktool.jar进行反编译

2024-12-05 07:25:57
推荐回答(2个)
回答1:

a.下载地址:
http://android-apktool.googlecode.com/files/apktool1.5.2.tar.bz2
b.下载之后,解压之后,就一个apktool.jar文件
c.使用apktool.jar解压apk文件
条件:
1).JDK是必不可少的
2).JDK环境变量配置
使用:
打开windows的cmd或者linux下的终端,将当前目录切换到apktool.jar所在目录

使用提示:
Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]

COMMANDs are:

d[ecode] [OPTS] [

]
Decode to .

OPTS:

-s, --no-src
Do not decode sources.
-r, --no-res
Do not decode resources.
-d, --debug
Decode in debug mode. Check project page for more info.
-b, --no-debug-info
Baksmali -- don't write out debug info (.local, .param, .line, etc.)

-f, --force
Force delete destination directory.
-t , --frame-tag
Try to use framework files tagged by .
--frame-path
Use the specified directory for framework files
--keep-broken-res
Use if there was an error and some resources were dropped, e.g.:
"Invalid config flags detected. Dropping resources", but you
want to decode them anyway, even with errors. You will have to
fix them manually before building.

b[uild] [OPTS] [] []
Build an apk from already decoded application located in .

It will automatically detect, whether files was changed and perform
needed steps only.

If you omit then current directory will be used.
If you omit then /dist/
will be used.

OPTS:

-f, --force-all
Skip changes detection and build all files.
-d, --debug
Build in debug mode. Check project page for more info.
-a, --aapt
Loads aapt from specified location.

if|install-framework [] --frame-path []
Install framework file to your system.

For additional info, see: http://code.google.com/p/android-apktool/
For smali/baksmali info, see: http://code.google.com/p/smali/

反编译命令:java -jar apktool.jar decode apk文件所在路径

回答2:

命令:
java -jar apktool.jar d android.jar c:\android
其中:android.jar 要进行反编译的jar, c:\anroid 生成到这个路径下