-2

How can a Java program be closed-source when the source code is easily retrieved through the use of jad or similar programs?

For example, a jar can be unzipped to get class files and these can be decompiled, read, edited and compiled again. So, how?

Because a proprietary license does not hide the code.

  • I know about closed source licenses, but you do nit gide the code by using those – willem schipper Dec 26 '17 at 14:46
  • 5
    Closed source means that you are not making your source code generally available. It doesn't mean that it is impossible for anyone to get hold of any version of your source. – khelwood Dec 26 '17 at 14:46

3 Answers3

2

The best option you have is obfuscating your code before publicizing.

The basic idea is to replace all "readable" names (say, "fetchTaxRate") with meaningless names as short as possible (say, "a"). If you have an instruction in your source "taxManager.fetchTaxRate(customerClass, countryID);" that might end up being "aB.e(zY, Q);" and anyone trying to decompile the binary will get to see the latter not the former.

A good article on obfuscation is at https://www.excelsior-usa.com/articles/java-obfuscators.html

The article also has a list of obfuscators and the one I use personally to my satisfaction (ProGuard) is among the list.

Erwin Smout
  • 18,113
  • 4
  • 33
  • 52
0

"Closed source" means the source code is not published, not that a representation of the code cannot be obtained.

Obfuscated code can be very hard to read when decompiled, however, with time, tools, and determination the secrets of all code will fall.

Paul
  • 19,704
  • 14
  • 78
  • 96
-3

Well, the best thing I can suggest is what web developers do, which is make the algorithm impossible to read. You can start at removing every space or tab from the code(with an algoritm of course) then making var names jumbled and so on.