I see some java decompilers can decompile bytecode to readable java sources, I wonder if all the bytecode which comes from java (not other JVM language) can be decompiled to java sources again?
Update
Sorry, let me make the question more clear.
Just talk about the normal Java code on JVM (no Android, no bytecode enhance, no AOP, no obfuscation), and I actually hope the bytecode can be decompiled. But I don't know if there are forms of java code which compiled into bytecode, will never be able to be decompiled to readable java sources.
Abstract. Java virtual machines execute Java bytecode instructions. Since this bytecode is a higher level representation than traditional ob- ject code, it is possible to decompile it back to Java source.
As code complexity increases, decompilation becomes even more difficult. It is also not possible to decompile all programs. Furthermore, it is not easy to separate data and code because both are represented similarly in most current computer systems.
It is possible. You need a Java Decompiler to do this. You'll find mostly it'll do a surprisingly good job.
Because Java byte-code is closer (more similar) to the source than assembly. In particular, . class files include metadata for classnames, method names, field & parameter types, etc...
I wonder if all the bytecode which comes from java (not other JVM language) can be decompiled to java sources again?
The answer is No.
Decompilers aren't guaranteed to work for all Java bytecodes:
A good obfuscator will deliberately rearrange the bytecodes in such a way that the common decompilers won't produce readable source code ... and probably won't produce valid source code.
Many decompilers out there have problems dealing with newer Java constructs.
Many decompilers have problems with bytecodes compiled from "complicated" source code.
Even if they generate compilable code, there is no guarantee that the code will be correct.
The bottom line is that a decompiler is only as good as the intelligence and diligence of its author can make it. I've never heard of a perfect one.
Java byctecode can be decompiled back to java source code. The decompiled source will generally not look the exact same, but will have the same functionality. If you're concerned that someone might decompile your source, you can use obfuscators (like ProGuard) to help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With