您的位置:首页 > 其它

ubuntu反编译apk步骤

2014-02-20 15:37 211 查看
ubuntu反编译apk步骤
apktool工具包括三个文件aapt,apktool,apktool.jar,主要是将apk中资源文件时行反编译,包括mainfest.xml,res,src–>ab.smali文件(下载地址:http://android-apktool.googlecode.com/files/apktool-install-linux-2.2_r01-1.tar.bz2
http://android-apktool.googlecode.com/files/apktool1.4.1.tar.bz2
dex2jar工具,主要是把打包的apk打包后形成的classes.dex来反编译成classes_dex2jar.jar文件(下载地址:http://code.google.com/p/dex2jar/downloads/list)
jd-gui工具主要是打开反编译后的classes_dex2jar.jar文件的
或者直接从百度云盘下载,下载地址:http://pan.baidu.com/s/1gdfz9mz
把下载的工具放在系统的某一位置加入环境变量好便后面用到相关命令或shell脚本
反编译过程主要利用的命令有 
apk–>desfile apktool d xxx.apk desfile
apk–>Test unzip -d Test xxx.apk
classes.dex–>classes_dex2jar.jar dex2jar.sh classes.dex
jd-gui classes_dex2jar.jar

脚本如下 

           #!/bin/bash

            apk_name=$1

            des_file=$2

            cd $des_file

            source_file="source_file"

            apktool d $apk_name $des_file/$source_file

            unzip -d $des_file  $apk_name

            cd $des_file

            rm -rvf res/

            rm AndroidManifest.xml

            echo "remove src successed"

            mv $des_file/$source_file/res $des_file

            mv $des_file/$source_file/AndroidManifest.xml $des_file

            echo "add reverse source file successed"

            rm -rvf $des_file/$source_file

            echo "remove temp source file suceessed"

            dex2jar classes.dex

            jd-gui classes_dex2jar.jar
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: