eclipse中整合jad反編譯
【安裝jad程式】
(拷貝即可,為最新版本Jad 1.5.8g for Windows9x/NT/2000 on Intel platform)
1、將jad.exe拷貝到%JAVA_HOME%\Bin程式目錄。(也可以放置任意目錄,例如:C:\ProgramFiles\Jad\jad.exe)
【安裝jadclipse外掛程式】
2、解壓net.sf.jadclipse_3.3.0.jar,將其拷貝到eclipse\plugins目錄下,重新啟動eclipse。
MyEclipse7.x,請在Genuitec\MyEclipse7.1\dropins\下建立
(MyEclipse8.x,請在Genuitec\MyEclipse BlueEdition 8.0 GA\dropins\下建立)
eclipse\features
eclipse\plugins
然後將net.sf.jadclipse_3.3.0.jar拷貝到新建立的plugins目錄下,方可生效。
【配置jadclipse】
3、在eclipse視窗下,點擊Window > Preferences> Java > JadClipse > Path to Decompiler。
(如果在命令列中能執行Jad命令時不用修改此值,否則需要設定jad的絕對路徑,例如 C:\ProgramFiles\Jad\jad.exe)
可將Use Eclipse codeformatter(overrides Jad formatting instructions)選項打勾,這樣可以與Ctrl+Shif+F格式化出來的代碼樣式一致。
4、解決中文反編譯的問題
在eclipse視窗下,點擊Window > Preferences> Java > JadClipse > Misc,將Convert Unicode strings into ANSIstrings選項打勾。
展開jar檔案中的class檔案,即可看到原始碼。
【程式下載地址】
JadClipse 官網:http://jadclipse.sourceforge.net/wiki/index.php/Main_Page
Jad官網:http://www.kpdus.com/jad.html#download,在該頁中找到適合自己作業系統平台的jad下載。下載後解壓,然後將解壓後的jad.exe檔案複製到%JAVA_HOME%\BIN目錄下面(可以將jad.exe隨便放到哪,只要記住路徑就好,下面要用到)。
備忘: 1.安裝完成後,eclipse自動將JadClipse Class FileViewer設定成class檔案的預設開啟檔案。如果沒有預設,可以在Eclipse的Windows——>Perference——>General->Editors->FileAssociations中修改“*.class”預設關聯的編輯器為“JadClipse ClassFileViewer”。設定完成後,雙擊*.class檔案,eclipse將自動反編譯。
2.對於存在原始碼的類,它不會強行反編譯,也就是說它還是會用eclipse內建的Class FileViewer查看class檔案,手動設定Window->Preferences->Java->JadClipse,把Ignore existingsource選中,就不會管有沒有源碼,都會反編譯。