MyEclipse9.0 jad逆コンパイルプラグインのインストール
4797 ワード
1.逆コンパイルツールjadのダウンロード(以下、ダウンロード)
ダウンロードしたjadstar 158.zip解凍jad.exeファイルはjdkインストールディレクトリの下に入れます
例えば:D:Program FilesJavajdk 1.6.0_20\bin
2.eclipse逆コンパイルプラグインnetをダウンロードする.sf.jadclipse_3.3.0.JAr(以下ダウンロード)
3.net.sf.jadclipse_3.3.0.JArはMyEclipseインストールディレクトリの下に入れ、
例えば、インストールディレクトリGenuitecdropinsの下にdropinsがなく、新規に作成し、dropinsでfeaturesフォルダとpluginsフォルダを新規作成すると、net.sf.jadclipse_3.3.0.JArをpluginsにコピーし、javaプロジェクトを新規作成し、次のコードを実行します(最後のコードを置き換え、コンピュータの逆コンパイルプラグインがある実際の場所).
4.MyEclipseを再起動し、jadclipseを構成する
EclipseのWindows->Perferences->General->Editors->File Associationsで「*.class」のデフォルトの関連付けを変更したエディタは、「JadClipse Class File Viewer」です.もしなかったらclassでは、「add」をクリックして1つ追加します.
インストール設定が完了したら、classファイルをダブルクリックできます.
ダウンロードしたjadstar 158.zip解凍jad.exeファイルはjdkインストールディレクトリの下に入れます
例えば:D:Program FilesJavajdk 1.6.0_20\bin
2.eclipse逆コンパイルプラグインnetをダウンロードする.sf.jadclipse_3.3.0.JAr(以下ダウンロード)
3.net.sf.jadclipse_3.3.0.JArはMyEclipseインストールディレクトリの下に入れ、
例えば、インストールディレクトリGenuitecdropinsの下にdropinsがなく、新規に作成し、dropinsでfeaturesフォルダとpluginsフォルダを新規作成すると、net.sf.jadclipse_3.3.0.JArをpluginsにコピーし、javaプロジェクトを新規作成し、次のコードを実行します(最後のコードを置き換え、コンピュータの逆コンパイルプラグインがある実際の場所).
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* MyEclipse9
*
*
*/
public class CreatePluginsConfig
{
public CreatePluginsConfig()
{
}
public void print(String path)
{
List<String> list = getFileList(path);
if (list == null)
{
return;
}
int length = list.size();
for (int i = 0; i < length; i++)
{
String result = "";
String thePath = getFormatPath(getString(list.get(i)));
File file = new File(thePath);
if (file.isDirectory())
{
String fileName = file.getName();
if (fileName.indexOf("_") < 0)
{
print(thePath);
continue;
}
String[] filenames = fileName.split("_");
String filename1 = filenames[0];
String filename2 = filenames[1];
result = filename1 + "," + filename2 + ",file:/" + path + "\\"
+ fileName + "\\,4,false";
System.out.println(result);
} else if (file.isFile())
{
String fileName = file.getName();
if (fileName.indexOf("_") < 0)
{
continue;
}
int last = fileName.lastIndexOf("_");//
String filename1 = fileName.substring(0, last);
String filename2 = fileName.substring(last + 1, fileName
.length() - 4);
result = filename1 + "," + filename2 + ",file:/" + path + "\\"
+ fileName + ",4,false";
System.out.println(result);
}
}
}
public List<String> getFileList(String path)
{
path = getFormatPath(path);
path = path + "/";
File filePath = new File(path);
if (!filePath.isDirectory())
{
return null;
}
String[] filelist = filePath.list();
List<String> filelistFilter = new ArrayList<String>();
for (int i = 0; i < filelist.length; i++)
{
String tempfilename = getFormatPath(path + filelist[i]);
filelistFilter.add(tempfilename);
}
return filelistFilter;
}
public String getString(Object object)
{
if (object == null)
{
return "";
}
return String.valueOf(object);
}
public String getFormatPath(String path)
{
path = path.replaceAll("\\\\", "/");
path = path.replaceAll("//", "/");
return path;
}
public static void main(String[] args)
{
/* */
String plugin = "C:\\Users\\Administrator\\AppData\\Local\\Genuitec\\dropins";
new CreatePluginsConfig().print(plugin);
}
}
4.MyEclipseを再起動し、jadclipseを構成する
EclipseのWindows->Perferences->General->Editors->File Associationsで「*.class」のデフォルトの関連付けを変更したエディタは、「JadClipse Class File Viewer」です.もしなかったらclassでは、「add」をクリックして1つ追加します.
インストール設定が完了したら、classファイルをダブルクリックできます.