Decompile

The decompile view mode is typically the most effective way to display classes. It works by decompiling the class and using the JavaParser library to analyze the decompiled code. When you right click on some text JavaParser can figure out what you have selected, be it a class, field, or method. With this knowledge Recaf will show you a context menu with relevant options. For field and method definitions this will allow you to bring up the assembler window for the selected field or method. If you select a reference to a field or method and not the definition itself then the option to jump to its definition will be presented instead.

This view mode is designed to be the most easy to use and familiar of the options since it presents the class in a familiar source-like fashion. Additionally this mode will allow you to compile the decompiled code if the code is compliant with the installed Java compiler on your system. If no Java compiler is found you will not be able to recompile code this way, but the assembler will always be there for you. Please be aware that this is a direct call to javac so any compile errors you have that show up when you attempt to save are compiler errors, not Recaf errors. There are plenty of edge cases that may cause compiling to fail that are not immediately obvious. Please double check what you are compiling.

Recaf provides support for the following decompilers:

The primary decompiler that will be used in this mode can be changed in the config window’s decompile tab. Different decompilers format the code slightly differently and may handle certain classes better than others. If at first one decompiler fails to fully reconstruct the code into something that is parseable, try another decompiler. If you are looking at an obfuscated class then it is likely that the decompilers will not be able to fully interpret the code. In this case you should switch to table mode which in the next section.

Note: While the ability to recompile code is made available to you, it is not the recommended way to make changes in complex programs. Decompilers do not always result in code that has the same behavior/semantics as the original code. Decompile mode is intended to make navigation easier. It is not intended to be a glorified compiler front-end.

Pros:

Cons: