如何反编译(Android)apk文件

所用到的工具:
apktool-install-linux-r04-brut1.tar.bz2
dex2jar-0.0.9.12-a.zip
jd-gui-0.3.5.linux.i686.tar.gz
apktool1.5.0.tar

工具下载地址:
https://code.google.com/p/android-apktool/
https://android-apktool.googlecode.com/files/apktool-install-linux-r04-brut1.tar.bz2
http://android-apktool.googlecode.com/files/apktool1.5.0.tar.bz2
http://code.google.com/p/dex2jar/
http://dex2jar.googlecode.com/files/dex2jar-0.0.9.12-a.zip
http://jd.benow.ca/jd-gui/downloads/jd-gui-0.3.5.linux.i686.tar.gz

配置环境

mkdir apk-tools
cd apk-tools

wget https://android-apktool.googlecode.com/files/apktool-install-linux-r04-brut1.tar.bz2
tar xf apktool-install-linux-r04-brut1.tar.bz2
rm -f apktool-install-linux-r04-brut1.tar.bz2

wget http://android-apktool.googlecode.com/files/apktool1.5.0.tar.bz2
tar xf apktool1.5.0.tar.bz2
rm -f apktool1.5.0.tar.bz2
mv apktool1.5.0/apktool.jar ./
rm -r apktool1.5.0


wget http://dex2jar.googlecode.com/files/dex2jar-0.0.9.12-a.zip
unzip dex2jar-0.0.9.12-a.zip -d dex2jar
rm -f dex2jar-0.0.9.12-a.zip

wget http://jd.benow.ca/jd-gui/downloads/jd-gui-0.3.5.linux.i686.tar.gz
tar xf jd-gui-0.3.5.linux.i686.tar.gz
rm -f jd-gui-0.3.5.linux.i686.tar.gz readme.txt

如何将 .apk文件转换为 .jar文件:


linux sh /home/zpz/dex2jar-version/d2j-dex2jar.sh /home/zpz/someApk.apk

然后可以使用 jd-gui 打开 .jar 文件,然后就可以察看 java反编译的代码了

cp -v /path/to/my.apk ./
./apktool d my.apk

输出如下:

I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/zpz/apktool/framework/1.apk
I: Loaded.
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable-hdpi/btm_bar_bg.9.png". Renaming it to *.png.
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...

my 目录中的文件就是我们所需要的内容

Post a Comment

Your email is never shared. Required fields are marked *

*
*