Java restricts decompilation of some classes

Is it possible, when the class is decompiled, displays some unwanted code.? But when running the same class, should it work correctly? I know this may seem strange, is it really possible? or restrict decompilation of some classes from the JAR

+4
source share
3 answers

No, this is not possible, however you can obfuscate code to make it less readable. This is usually a sufficient solution.

+2
source

The classes you are trying to decompile may be confusing.

From the wiki:

Obfuscation is the deliberate act of creating entangled code, that is, a source or machine code, that is difficult for people to understand.

Programmers can intentionally obfuscate code in order to hide their purpose (security through obscurity) or their logic, to prevent falsification, deterrence of reverse engineering, or as a puzzle or recreation challenge for someone reading the source code.

Read more here: http://en.wikipedia.org/wiki/Obfuscation_(software)

There are tools for obfuscating code, here are a few of them:

http://www.yworks.com/en/products_yguard_about.htm

http://proguard.sourceforge.net/

+2
source

It is possible to some extent. Not the actual garbage characters, but code that is quite difficult to decrypt. What you are looking for is called "Java bytecode obfuscator". There are a bunch of both commercial and non-commercial. After all, if the JVM can read and run your code correctly, it can be decompiled.

Note that obfuscating bytecode can make various JVM optimizations difficult.

+1
source

Source: https://habr.com/ru/post/1485938/


All Articles