![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
Java Decompiler..
I found a website with a java applet that I liked a lot, so I searched "download.com" and within seconds found a java decompiler.
While this is a good thing, it also worries me. I have a Java project which I hope to put up soon. I have a lot of code which I don't want people viewing. So is there anyway to make this a little harder for people to view? The only thing I can think of is encrypting the .class file. But then again, they'll be able to decompile my java decrypter as they can with my project. It really doesn't seem like there's anything I can do (besides not posting it online). I understand if there's no bullet-proof solution. However, what technique can I use to make it harder to view my code, Any ideas?
__________________
Death smiles at us all. All a man can do is smile back. |
|
|
|
|
|
#2 |
|
Sexy Programmer
|
Natively compile the Java program.
http://www.ej-technologies.com/produ.../overview.html That's the only thing that comes to mind man!
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
How about obfuscation?
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Nov 2006
Location: 163H
Posts: 213
Rep Power: 2
![]() |
It works with C# pretty well though but i havent heard of it used with java. Or anything of the kind.
__________________
You never test the depth of a river with both feet. The believer is happy. The doubter is wise. Free speech carries with it some freedom to listen. The next generation will always surpass the previous one. It`s one of the never ending cycles of life. |
|
|
|
|
|
#5 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Obfuscation:
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() ![]() ![]() |
Obfuscation wouldn't make it "harder to view", only harder to understand. It is also not 100%, but in most cases, it is likely to cause enough confusion for the other person to abandon their efforts.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#7 |
|
Sexy Programmer
|
I don't think decompilers translate "exactly" what someone wrote or am I wrong?
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
|
|
#8 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Not really, and certainly not well, if a lot of extraneous information (symbols, etc.) weren't available in the file set one was decompiling. Imagine that you are presented with the assembly language,
ld a, 0x4357fb add a, 1 st 0x4357fb,a Furthermore, in simple embedded systems, particularly, data might be sandwiched right in with code. The data might be binary numbers, or a floating point representation, or text, or anything else. It still might occur in patterns that could be interpreted as a sequence of instructions. Reverse engineering of non-trivial material, to be effective, takes as much information as one might dredge up, and a lot of competent human interpretation.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#9 | |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
Quote:
NOTE: USED "CAVAJ Java Decompiler" ORIGINAL SOURCE: ".java" file /**
* Contains radio boxes, labels, textBoxes, comboBox, checkBoxes, textFields
and actionListener. Done by Placing all components on a JPanel. Once done, places all
JPanels on GridLayout().
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Survey extends JFrame implements ActionListener
{
JScrollPane scrFeedBack; // scroll bar for txtFeedBack
JTextArea txtFeedBack; // text area for comments
public Survey()
{
super("Health Awareness Survey");
//Place first Question
JLabel lblSleep = new JLabel("3: On average how many hours of sleep do you get per night?");
JComboBox cmbSleep = new JComboBox();
cmbSleep.addItem("3-5 hours");
cmbSleep.addItem("5-6 hours");
cmbSleep.addItem("6-7 hours");
cmbSleep.addItem("7-8 hours");
cmbSleep.addItem("> 9 hours");
cmbSleep.setEditable(false); // so user can't mess with the data
cmbSleep.setMaximumRowCount(3);
//adds the basic label + the comboBox
FlowLayout flowSleep = new FlowLayout(FlowLayout.LEFT,0,0);
JPanel pnlSleep = new JPanel(flowSleep);
pnlSleep.add(lblSleep);
pnlSleep.add(cmbSleep);
// Second Question
JLabel lblFood = new JLabel ("4. How many items of junk food do you consume per week?");
JRadioButton opt0Items = new JRadioButton("0-5 Items");
JRadioButton opt5Items = new JRadioButton("5-10 Items");
JRadioButton opt10Items = new JRadioButton("10-15 Items");
// create a button group for the radio buttons (so that you can only select 1 at a time)
ButtonGroup grpItems = new ButtonGroup();
grpItems.add(opt0Items);
grpItems.add(opt5Items);
grpItems.add(opt10Items);
FlowLayout flowItems = new FlowLayout(FlowLayout.LEFT, 1,0); // adds to the visuals ;)
JPanel pnlItems = new JPanel(flowItems);
pnlItems.add(lblFood); // adding labels and optionBoxes to the Panel
pnlItems.add(opt0Items);
pnlItems.add(opt5Items);
pnlItems.add(opt10Items);
//Third Question
JCheckBox chkHealthy = new JCheckBox("2. Is the majority of food you eat healthy?", false);
JLabel lblStatus = new JLabel("5: At what time(s) of the days do you brush your teeth?");
JCheckBox chkMorning = new JCheckBox ("1. Morning "); // creats a CheckBox
JCheckBox chkLunch = new JCheckBox ("2. Lunch "); // that isn't a family with the
JCheckBox chkNight = new JCheckBox ("3. Night"); // other ones
// panel that will hold all the CheckBox components + the label
FlowLayout flowTeeth = new FlowLayout(FlowLayout.LEFT, 1,0);
JPanel pnlTeeth = new JPanel(flowItems);
pnlTeeth.add(lblStatus);
pnlTeeth.add(chkMorning);
pnlTeeth.add(chkLunch);
pnlTeeth.add(chkNight);
//Fourth Question
JLabel lblFav = new JLabel("1. What is your favorite food?");
JTextField txtFav = new JTextField(25);
txtFav.setToolTipText("Enter your favorite food");
//adds fourth question to the JPanel for later use
FlowLayout flowFood = new FlowLayout(FlowLayout.LEFT, 1,0);
JPanel pnlFav = new JPanel(flowFood);
pnlFav.add(lblFav);
pnlFav.add(txtFav);
JLabel lblDrinks = new JLabel ("6. What do you usually drink in the morning?");
String[] strDrink = {"Orange", "Juice", "Milk", "Coffee", "Tea", "Other", "can't remember"};
JList drink = new JList(strDrink);
// set how much space the list takes up
drink.setVisibleRowCount(2);
JScrollPane scrDrinks = new JScrollPane(drink, ScrollPaneConstants.
VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
// Label + box goes in the panel
FlowLayout flowDrinks = new FlowLayout(FlowLayout.LEFT, 1,0);
JPanel pnlDrinks = new JPanel(flowDrinks);
pnlDrinks.add(lblDrinks);
pnlDrinks.add(scrDrinks);
// ALL THE COMPONENTS ABOVE, get added to the main layout here
JPanel pnlFields = new JPanel(new GridLayout(5, 1));
pnlFields.add(pnlFav);
pnlFields.add(pnlSleep);
pnlFields.add(pnlItems);
pnlFields.add(pnlTeeth);
pnlFields.add(pnlDrinks);
pnlFav.add(chkHealthy);
//Comment Box + Button
JLabel lblFeedBack = new JLabel("Before you submit form, please take a moment to enter any feedback you'd like to give us");
// uses HTML code to produce a line ;)
lblFeedBack.setText("<html><hr>Before you submit form, please take<br> a moment to to enter any feedback you <br> would like to give us</html>");
lblFeedBack.setSize(10, 4);
txtFeedBack = new JTextArea(4, 30); // creating a textbox
txtFeedBack.setLineWrap(true); // so that the text goes to next line when full
txtFeedBack.setWrapStyleWord(true);
txtFeedBack.setToolTipText("Enter your (Questions/Problems) here");
scrFeedBack = new JScrollPane(txtFeedBack, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
JPanel pnlAddress = new JPanel(new BorderLayout());
pnlAddress.add(lblFeedBack, BorderLayout.CENTER);
JButton cmdSubmit = new JButton("Submit");
JButton cmdReset = new JButton("Reset");
JButton cmdExit = new JButton("Exit");
cmdSubmit.setMnemonic(KeyEvent.VK_G);// G instead of S, incase people think 'S = save'
cmdSubmit.setToolTipText("Click here to submit form");
cmdReset.setMnemonic(KeyEvent.VK_R); // hotkey for 'r'
cmdReset.setToolTipText("Click here to reset form");
cmdExit.setMnemonic(KeyEvent.VK_E); // adds hotkeys 'e'
cmdExit.setToolTipText("Click here to exit the program.");
JPanel pnlButtons = new JPanel(new GridLayout(1,0));
pnlButtons.add(cmdSubmit);
pnlButtons.add(cmdReset);
pnlButtons.add(cmdExit);
JPanel pnlFeedBack = new JPanel(new BorderLayout());
pnlFeedBack.add(pnlButtons, BorderLayout.SOUTH);
pnlFeedBack.add(scrFeedBack, BorderLayout.CENTER);
pnlFeedBack.add(lblFeedBack, BorderLayout.NORTH);
Container pane = this.getContentPane();
pane.setLayout(new BorderLayout());
pane.add(pnlFeedBack, BorderLayout.SOUTH);
pane.add(pnlFields, BorderLayout.CENTER);
// Action listeners
cmdSubmit.addActionListener(this);
cmdExit.addActionListener(this);
cmdReset.addActionListener(this);
//final configurations
this.pack();
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
this.setSize (350, 500);
}
/*
* Performs tasks based on buttons pressed
*/
/**
* The Action Listener, takes in an ActionEvent.
*/
public void actionPerformed(ActionEvent evt)
{
Object source = evt.getSource();
}FROM ".class" file decompiled import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.EventObject;
import javax.swing.*;
public class Survey extends JFrame
implements ActionListener
{
JScrollPane scrFeedBack;
JTextArea txtFeedBack;
public void actionPerformed(ActionEvent actionevent)
{
Object obj = actionevent.getSource();
}
public Survey()
{
super("Health Awareness Survey");
JLabel jlabel = new JLabel("3: On average how many hours of sleep do you get per night?");
JComboBox jcombobox = new JComboBox();
jcombobox.addItem("3-5 hours");
jcombobox.addItem("5-6 hours");
jcombobox.addItem("6-7 hours");
jcombobox.addItem("7-8 hours");
jcombobox.addItem("> 9 hours");
jcombobox.setEditable(false);
jcombobox.setMaximumRowCount(3);
FlowLayout flowlayout = new FlowLayout(0, 0, 0);
JPanel jpanel = new JPanel(flowlayout);
jpanel.add(jlabel);
jpanel.add(jcombobox);
JLabel jlabel1 = new JLabel("4. How many items of junk food do you consume per week?");
JRadioButton jradiobutton = new JRadioButton("0-5 Items");
JRadioButton jradiobutton1 = new JRadioButton("5-10 Items");
JRadioButton jradiobutton2 = new JRadioButton("10-15 Items");
ButtonGroup buttongroup = new ButtonGroup();
buttongroup.add(jradiobutton);
buttongroup.add(jradiobutton1);
buttongroup.add(jradiobutton2);
FlowLayout flowlayout1 = new FlowLayout(0, 1, 0);
JPanel jpanel1 = new JPanel(flowlayout1);
jpanel1.add(jlabel1);
jpanel1.add(jradiobutton);
jpanel1.add(jradiobutton1);
jpanel1.add(jradiobutton2);
JCheckBox jcheckbox = new JCheckBox("2. Is the majority of food you eat healthy?", false);
JLabel jlabel2 = new JLabel("5: At what time(s) of the days do you brush your teeth?");
JCheckBox jcheckbox1 = new JCheckBox("1. Morning ");
JCheckBox jcheckbox2 = new JCheckBox("2. Lunch ");
JCheckBox jcheckbox3 = new JCheckBox("3. Night");
FlowLayout flowlayout2 = new FlowLayout(0, 1, 0);
JPanel jpanel2 = new JPanel(flowlayout1);
jpanel2.add(jlabel2);
jpanel2.add(jcheckbox1);
jpanel2.add(jcheckbox2);
jpanel2.add(jcheckbox3);
JLabel jlabel3 = new JLabel("1. What is your favorite food?");
JTextField jtextfield = new JTextField(25);
jtextfield.setToolTipText("Enter your favorite food");
FlowLayout flowlayout3 = new FlowLayout(0, 1, 0);
JPanel jpanel3 = new JPanel(flowlayout3);
jpanel3.add(jlabel3);
jpanel3.add(jtextfield);
JLabel jlabel4 = new JLabel("6. What do you usually drink in the morning?");
String as[] = {
"Orange", "Juice", "Milk", "Coffee", "Tea", "Other", "can't remember"
};
JList jlist = new JList(as);
jlist.setVisibleRowCount(2);
JScrollPane jscrollpane = new JScrollPane(jlist, 20, 31);
FlowLayout flowlayout4 = new FlowLayout(0, 1, 0);
JPanel jpanel4 = new JPanel(flowlayout4);
jpanel4.add(jlabel4);
jpanel4.add(jscrollpane);
JPanel jpanel5 = new JPanel(new GridLayout(5, 1));
jpanel5.add(jpanel3);
jpanel5.add(jpanel);
jpanel5.add(jpanel1);
jpanel5.add(jpanel2);
jpanel5.add(jpanel4);
jpanel3.add(jcheckbox);
JLabel jlabel5 = new JLabel("Before you submit form, please take a moment to enter any feedback you'd like to" +
" give us"
);
jlabel5.setText("<html><hr>Before you submit form, please take<br> a moment to to enter any feedb" +
"ack you <br> would like to give us</html>"
);
jlabel5.setSize(10, 4);
txtFeedBack = new JTextArea(4, 30);
txtFeedBack.setLineWrap(true);
txtFeedBack.setWrapStyleWord(true);
txtFeedBack.setToolTipText("Enter your (Questions/Problems) here");
scrFeedBack = new JScrollPane(txtFeedBack, 22, 31);
JPanel jpanel6 = new JPanel(new BorderLayout());
jpanel6.add(jlabel5, "Center");
JButton jbutton = new JButton("Submit");
JButton jbutton1 = new JButton("Reset");
JButton jbutton2 = new JButton("Exit");
jbutton.setMnemonic(71);
jbutton.setToolTipText("Click here to submit form");
jbutton1.setMnemonic(82);
jbutton1.setToolTipText("Click here to reset form");
jbutton2.setMnemonic(69);
jbutton2.setToolTipText("Click here to exit the program.");
JPanel jpanel7 = new JPanel(new GridLayout(1, 0));
jpanel7.add(jbutton);
jpanel7.add(jbutton1);
jpanel7.add(jbutton2);
JPanel jpanel8 = new JPanel(new BorderLayout());
jpanel8.add(jpanel7, "South");
jpanel8.add(scrFeedBack, "Center");
jpanel8.add(jlabel5, "North");
Container container = getContentPane();
container.setLayout(new BorderLayout());
container.add(jpanel8, "South");
container.add(jpanel5, "Center");
jbutton.addActionListener(this);
jbutton2.addActionListener(this);
jbutton1.addActionListener(this);
pack();
setDefaultCloseOperation(3);
setVisible(true);
setSize(350, 500);
}
}
__________________
Death smiles at us all. All a man can do is smile back. |
|
|
|
|
|
|
#10 |
|
Programmer
Join Date: Oct 2007
Posts: 41
Rep Power: 0
![]() |
Re: Java Decompiler..
Sorry Dawei but this was the dead post I meant to resurrect to begin with. http://www.chainkey.com/en/prod.htm
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming with Java: Tutorial | ReggaetonKing | Java | 7 | May 20th, 2008 10:58 AM |
| Special browser in Java (Project) | stalefish | Java | 3 | Feb 9th, 2008 4:22 PM |
| First Java Program | duale2005 | Java | 3 | May 22nd, 2006 5:17 PM |
| Java programmers, game developers, artists, be ware! RPG game team is recruiting! | atcomputers.us | Paid Job Offers | 7 | Sep 25th, 2005 7:25 PM |
| JAVA and C#??? | java_roshan | C# | 6 | Apr 13th, 2005 10:18 PM |