Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the code of any Java application available to anyone?

Any class file can be decompiled to original Java source code relatively easily.

Does this mean that the source code of any Java program, unless encrypted in some way, is relatively easily available to anyone who has the final program?

If so, then isn't this a problem for major companies that don't want their trade secrets or their work available to anyone?

like image 528
Aviv Cohn Avatar asked Mar 20 '23 05:03

Aviv Cohn


1 Answers

Open source refers to license. You can have the source code of a non-open source program, for example.

Generally speaking, no, your original source code is not available to anyone - you can easily use methods such as obfuscation and encryption if you are concerned about this. Check out this question.

However Java bytecode can be reverse engineered to Java source code. You can take a look here to get more information: http://resources.infosecinstitute.com/java-bytecode-reverse-engineering.

If so, then isn't this a problem for major companies that don't want their trade secrets or their work available to anyone?

Why would it be? Java is usually running on the server side, where you can't even access the bytecode. If you're creating a desktop application you're just as likely to have it reverse engineered as pirated, I'd wager.

In essence it's possible to get the source code from bytecode, but you can prevent that, and it's usually not a big deal.

like image 138
corazza Avatar answered Apr 01 '23 22:04

corazza