-4

I've been trying to edit the .CLASS files inside this program using .jar containers, and a .bat file to launch it.

I'm not familiar with Java, and I've tried Java decompilers but they don't let me edit the source, only copy it. I don't seem to have a program that can actually correctly save and encode it.

What's the best option here to easily edit this Java program's .CLASS files?

Edit: To everyone who's enjoying downrepping this, the program is open source and permits modifications. So thank you for all the blame flinging about it being illegal.

questy
  • 517
  • 2
  • 4
  • 14
  • 5
    What kind of edit you would make on .class? – Jayan Aug 07 '13 at 08:57
  • Google: "edit class java". – Maroun Aug 07 '13 at 08:59
  • It's a basic watermarking program and I want to change some default settings to speed up the process of its usage. I don't know why everyone's jumping to law breaking. – questy Aug 07 '13 at 09:00
  • 2
    @JavaNewbie_M107 It's not, actually. As the name "Copyright" implies, it applies to distribution (copying). In some countries it may be illegal to decompile code, I personally don't live in one of them. – Cubic Aug 07 '13 at 09:01
  • 2
    @JavaNewbie_M107 Not necessarily. For example, in germany, there are conditions under which you are explicitly allowed to reverse engineer software. Also, you might just want to fix a bug. – thejh Aug 07 '13 at 09:01
  • @questy Have you written this watermarking program? – Algorithmist Aug 07 '13 at 09:01
  • No, I haven't. I just want to change default settings like opacity, image quality, etc. to my preferences. – questy Aug 07 '13 at 09:02

3 Answers3

4

You could try decompiling it with Fernflower, editing the code, then compiling it back into a classfile with the normal javac.

thejh
  • 44,854
  • 16
  • 96
  • 107
1

There is no real "easy" way. You could edit the bytecode...but that is a bit more involved. You can use JD but, that as you said, is only so useful.

Thomas
  • 1,401
  • 8
  • 12
1

Use java de-compliler to get source code from byte code, modify as per you want save in different location(like copy source code with your modifications) then compile & run.

Ulaga
  • 863
  • 1
  • 8
  • 17