Created
March 1, 2012 06:12
-
-
Save aya-eiya/1947726 to your computer and use it in GitHub Desktop.
Winmerge用のプラグインです。ClassファイルをJadして比較します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<scriptlet> | |
<!-- Diff Class files with jad plugin for WinMerge . (C) aya_eiya 2012 --> | |
<implements type="Automation" id="dispatcher"> | |
<property name="PluginEvent"> | |
<get/> | |
</property> | |
<property name="PluginDescription"> | |
<get/> | |
</property> | |
<property name="PluginFileFilters"> | |
<get/> | |
</property> | |
<property name="PluginIsAutomatic"> | |
<get/> | |
</property> | |
<method name="UnpackFile"/> | |
<method name="PackFile"/> | |
</implements> | |
<script language="VBS"> | |
Option Explicit | |
Dim JadPath | |
JadPath="C:\\eclipse\\eclipse\\jad.exe" | |
Function get_PluginEvent() | |
get_PluginEvent = "FILE_PACK_UNPACK" | |
End Function | |
Function get_PluginDescription() | |
get_PluginDescription = "ClassDiffWithJad" | |
End Function | |
Function get_PluginFileFilters() | |
get_PluginFileFilters = "\.class$" | |
End Function | |
Function get_PluginIsAutomatic() | |
get_PluginIsAutomatic = True | |
End Function | |
Function PackFile(fileSrc, fileDst, pbChanged, pSubcode) | |
PackFile = False | |
End Function | |
Function UnPackFile(fileSrc, fileDst, pbChanged, pSubcode) | |
Dim FSO | |
Dim cls | |
Dim strm | |
Dim src | |
Set FSO = CreateObject("Scripting.FileSystemObject") | |
Set cls = FSO.GetFile(fileSrc) | |
Set strm = FSO.OpenTextFile(fileDst,2) | |
src = Jad(cls.ParentFolder,cls.Name) | |
strm.Write(src) | |
strm.Close | |
pbChanged = True | |
pSubcode = 0 | |
UnpackFile = True | |
End Function | |
Function Jad(path_1,class_file) | |
'// CreateShell | |
Dim WshShell | |
Dim exec | |
set WshShell = CreateObject("WScript.Shell") | |
'// Jad | |
WshShell.CurrentDirectory = path_1 | |
set exec = WshShell.Exec(JadPath + " -p -8 " + class_file) | |
Jad = exec.StdOut.ReadAll() | |
End Function | |
</script> | |
</scriptlet> |
Attention
Jad is not support upper than Java 4.
JadはJava5以降の文法には対応していません。
Now I try to support upper version Java by using Java Decompiler for Eclipse.
ただいまJavaDecompilerを使って上位バージョンのJavaに対応しようと目論んでいます。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
インストール
この"class diff with jad.sct"というファイルを、WinMergeがインストールされたディレクトリの下にある"MergePlugins"に配置してください。(例:"C:\Program Files\WinMerge\MergePlugins")
23行目のJadPath="C:\eclipse\eclipse\jad.exe"を自分のJad.exeのパスに変更してください。
以上で、クラスファイルをWinMergeで比較した時に、このプラグインを選択できるようになります。