andriod的apk檔案相關的編譯反編譯工具

來源:互聯網
上載者:User

1、smali-1.2.6.jar

用途:.smali檔案 轉成 classes.dex檔案

說明:.smali檔案,類似於.class檔案,可以用普通文字編輯器查看和修改。

用法舉例:命令列:java -jar smali.jar classout/ -o classes.dex

下載:http://code.google.com/p/smali/downloads/list

 

2、baksmali-1.2.6.jar

用途:classes.dex檔案 轉成 .smali檔案

說明:classes.dex不便於查看和理解,使用此工具轉成的.smali檔案易於閱讀和修改。

用法:命令列:java -jar baksmali.jar -o classout/ classes.dex

下載:http://code.google.com/p/smali/downloads/list

 

3、AXMLPrinter2.jar

用途:xml檔案 轉成 普通文字檔(txt)

說明:apk中的xml檔案被搞成二進位了,無法閱讀,使用此工具轉換後,可以查看正常的xml檔案。

用法舉例:命令列:java -jar AXMLPrinter2.jar main.xml > main.txt

下載:http://code.google.com/p/android4me/downloads/list

 

學習了樓下dohkoos兄弟的總結,我也大概再總結一下:

1、dexdump

 

androidSDK提供的反編譯工具dexdump.exe,將dex檔案反編譯為較易理解的文字檔。

位於路徑:\android\sdk\android-sdk-windows\platform-tools

用法:

dexdump: [-c] [-d] [-f] [-h] [-i] [-l layout] [-m] [-t tempfile] dexfile...

 

 -c : verify checksum and exit

 -d : disassemble code sections

 -f : display summary information from file header

 -h : display file header details

 -i : ignore checksum failures

 -l : output layout, either 'plain' or 'xml'

 -m : dump register maps (and nothing else)

 -t : temp file name (defaults to /sdcard/dex-temp-*)

 

例子:dexdump classes.dex >dexdump.txt

2、Dedexer

 

使用工具ddx1.11.jar來進行反編譯dex,一般可讀性比dexdump工具能強點,但還是不好理解。

用法:

Usage: java -jar ddx.jar -o -D -r -d <destination directory> <source>

       <destination directory> is where the generated files will be placed.

       <source> is the name of the source DEX file.

       -D - if present, more detailed error report is printed in case of failure

.

       -o - if present, detailed log file will be created about the input DEX fi

le (dex.log).

       -r - if present, register trace will be emitted after each instruction

       -e <deps> - if present, the <deps> directory is supposed to contain depen

dencies necessary for ODEX disassembly. Read the manual for details.

 

例子:

java -jar ddx1.11.jar -o -D -r -d src classes.dex //在src目錄下產生ddx檔案  

3、AXMLPrinter2 

 

查看apk中的XML資源檔,因為xml都被壓縮成bytecode了,所以使用此工具協助查看。

用法:

java -jar AXMLPrinter2.jar AndroidManifest.xml > out.xml

4、apktool

dohkoos兄弟對這個講了不少了。能反編譯,也能編譯,能看class,也能看xml資源,是個不錯的工具。這裡推薦一個此工具的下載說明地址。

http://bbs.gfan.com/thread-971865-1-1.html

 

5、dex2jar

 

將apk或者dex轉化為可以用gui查看的class檔案。此種貌似很強大。

:http://code.google.com/p/dex2jar/downloads/list

 

6、smali和baksmali

類似於apktool產生的smali檔案。此兩個工具,smali編譯,baksmali反編譯。

 

 

最後再上一張自己總結的excel,這個應該比較直觀,總結的不太好,湊和著理解吧,截個圖上來:

 

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.