後來找到一個軟體:DJ Java Decompiler,反組譯以後可讀性還是很高,變數名稱都還在,不過反組譯以後關鍵字的色彩標記有點問題,有時候可能會出現怪怪的程式片段,不過完整性很高可以不用擔心。
從 Tools => Decompile more files 可以一次反組譯某資料夾下的多個 bytecode。如果程式有包含中文字,記得要多選取一個選項「Convert Unicode strings to ANSI strings」,這樣中文就不會變成二進位碼。
-->
class Password {
String password;
public void setPassword(String in){
password = RSA(in);
}
public String getPassword(){
return RevertFromRSA(password);
}
}
class Asd
{
public static void main(String[] args)
{
String 我 = "天才";
System.out.println(我);
}
}
JFileChooser chooser = new JFileChooser();
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setApproveButtonText("確定");
chooser.showDialog(jLabel1, null); //留 null 否則上一行的設定被覆蓋
File filePath = chooser.getSelectedFile();
if(filePath!=null && !filePath.getPath().equals("")){
jTextField1.setText(filePath.getPath());
}
1 = 6 * 0 + 1
2
3
5 = 6 * 1 - 1
7 = 6 * 1 + 1
11 = 6 * 2 - 1
13 = 6 * 2 + 1
17 = 6 * 3 - 1
19 = 6 * 3 + 1
23 = 6 * 4 - 1
29 = 6 * 5 - 1
31 = 6 * 5 + 1
37 = 6 * 6 + 1
41 = 6 * 7 - 1
43 = 6 * 7 + 1
47 = 6 * 8 - 1
53 = 6 * 9 - 1
59 = 6 * 10 - 1
61 = 6 * 10 + 1
67 = 6 * 11 + 1
71 = 6 * 12 - 1
73 = 6 * 12 + 1
79 = 6 * 13 + 1
83 = 6 * 14 - 1
89 = 6 * 15 - 1
97 = 6 * 16 + 1
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class panel0 {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
JButton b1 = new JButton("Exit");
JButton b2 = new JButton("Add Line");
JTextArea text = new JTextArea(5,10);
JPanel panelControl = new JPanel();
public static void main(String[] arg){
panel0 gui = new panel0();
gui.go();
}
public void go(){
panel.setBackground(Color.gray);
panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
panelControl.setBackground(Color.gray);
panelControl.setLayout(new BoxLayout(panelControl,BoxLayout.X_AXIS) );
text.setLineWrap(true);
JScrollPane scroller = new JScrollPane(text);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
b1.addActionListener(this);
b2.addActionListener(this);
text.setText("Test string....\n");
panel.add(scroller);
panelControl.add(b2);
panelControl.add(b1);
frame.getContentPane().add(BorderLayout.CENTER,panel);
frame.getContentPane().add(BorderLayout.SOUTH,panelControl);
frame.setSize(300,300);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e){
if( e.getSource() == b1 )
System.exit(0);
else
text.append("new line\n");
}
}
public void actionPerformed(ActionEvent e){
if( e.getSource() == b1 )
System.exit(0);
else
text.append("new line\n");
}
class buttonListenerEXIT implements ActionListener{
public void actionPerformed(ActionEvent e){
System.exit(0);
}
}
class buttonListenerNewLine implements ActionListener {
public void actionPerformed(ActionEvent e){
text.append("new line\n");
}
}
b1.addActionListener(new buttonListenerEXIT());
b2.addActionListener(new buttonListenerNewLine());
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class panel0 {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
JButton b1 = new JButton("Exit");
JButton b2 = new JButton("Add Line");
JTextArea text = new JTextArea(5,10);
JPanel panelControl = new JPanel();
public static void main(String[] arg){
panel0 gui = new panel0();
gui.go();
}
public void go(){
panel.setBackground(Color.gray);
panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
panelControl.setBackground(Color.gray);
panelControl.setLayout(new BoxLayout(panelControl,BoxLayout.X_AXIS) );
text.setLineWrap(true);
JScrollPane scroller = new JScrollPane(text);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
b1.addActionListener(new buttonListenerEXIT());
b2.addActionListener(new buttonListenerNewLine());
text.setText("Test string....\n");
panel.add(scroller);
panelControl.add(b2);
panelControl.add(b1);
frame.getContentPane().add(BorderLayout.CENTER,panel);
frame.getContentPane().add(BorderLayout.SOUTH,panelControl);
frame.setSize(300,300);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
class buttonListenerEXIT implements ActionListener{
public void actionPerformed(ActionEvent e){
System.exit(0);
}
}
class buttonListenerNewLine implements ActionListener {
public void actionPerformed(ActionEvent e){
text.append("new line\n");
}
}
}
jar cfm out.jar manifest.mf *.class *.png
public class test {
public static void main(){
System.out.println("Hello World");
}
}
javac c:\java\test.java
java test