轉載請註明出處:http://blog.csdn.net/awebkit
1. 解壓apk
首先下載dex2jar
http://code.google.com/p/dex2jar/
在dex2jar的解壓縮目錄下面,有個dex2jar.sh
lijiangwei@lijiangwei-laptop:~/Downloads/tools/dex2jar-0.0.7.11-SNAPSHOT$ ./dex2jar.sh 20110712162837687-445218608.apk 1 [main] INFO com.googlecode.dex2jar.v3.Main - version:0.0.7.11-SNAPSHOT7 [main] INFO com.googlecode.dex2jar.v3.Main - dex2jar 20110712162837687-445218608.apk -> 20110712162837687-445218608_dex2jar.jar1077 [main] INFO com.googlecode.dex2jar.v3.Main - Done.
2. 解壓(unzip)jar包。
unzip 20110712162837687-445218608_dex2jar.jar
3. 查看class檔案。
這裡有兩種方法。
3.1 使用jdgui
下載jd-gui
http://java.decompiler.free.fr/?q=jdgui
./jd-gui
這種方式查看class檔案,有可能會報錯“Index out of bounds”.
3.2 使用jadEclipse
下載安裝:
http://jadclipse.sourceforge.net/wiki/index.php/Main_Page
匯入檔案:Build Path==>Configure Build Path==>Libraries ,點擊Add Class Folder==>Creat New Folder
然後把.class檔案放到建立立的目錄下面。
這樣就可以使用eclipse查看.class檔案了
如果您沒有按照使用篇步驟,那麼您使用 eclipse反編譯外掛程式,會拋異常
Could not open the editor: The Class File Viewer cannot handle the given input ('org.eclipse.ui.ide.FileStoreEditorInput').