New TC Plugin: Java Decompiler v1.1

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
moisescastellano
Junior Member
Junior Member
Posts: 36
Joined: 2021-12-05, 19:11 UTC

New TC Plugin: Java Decompiler v1.1

Post by *moisescastellano »

Update: new version JavaDecompiler 1.1 released on 2022-Jan-30, see changes in next posts

JavaDecompiler 1.1, a Total Commander plugin
This plugin allows Total Commander to both decompile and navigate java *.class* files. It is a packer plugin, meaning you can "enter" these files as archives.

But... a .class file is not an archive, is it?

It is not, .class files do NOT contain other files. However this plugin "hacks" the TC packer interface so that class files appear to be archives containing all of:
- a file "classname.java" which you can view (F3) or copy (F5). This java is the decompiled class file
- a list of directories representing all the methods, fields, constructors, member classes and interfaces of the class. This way you can have a very quick view of the class structure
- a couple more directories show the system properties and environment variables (this info is not directly related to the class, but it could be useful)

In the screenshot, on the left panel we have entered to a .class file. The sub-directories contain members of the class. Decompiled class is viewed on the right panel.

Screenshot

The plugin uses CFR 0.152 decompiler as a library, so it does not need any extra executables or processes.

Download and resources
- Download the latest release in this project: https://github.com/moisescastellano/javadecompiler-tcplugin/blob/main/releases
- Plugin page at totalcmd.net: http://totalcmd.net/plugring/java_decompiler.html
- JavaDecompiler Github page
- JavaDecompiler Github project
- This is a work in progress, you can help with things to do: https://moisescastellano.github.io/javadecompiler-tcplugin/to-do
- History of changes

Java plugin
JavaDecompiler is written in Java, so you need to have installed a Java Runtime Environment (JRE)(https://www.java.com/en/download/manual.jsp).
Because it uses lambda expressions, it needs **at least Java 8**. It has been tested on JDK1.8.0

This plugin is based on the Java plugin interface: https://moisescastellano.github.io/tcmd-java-plugin

Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

License
Licensed under the GNU General Public License v3.0, a strong copyleft license:
https://github.com/moisescastellano/tcmd-java-plugin/blob/main/LICENSE
moisescastellano
Junior Member
Junior Member
Posts: 36
Joined: 2021-12-05, 19:11 UTC

Re: New TC Plugin: Java Decompiler v1.1

Post by *moisescastellano »

v1.0 - 2021-dec-27
  • JavaDecompiler is now available at [Totalcmd.net](http://totalcmd.net/plugring/java_decompiler.html)
  • This plugin allows Total Commander to both **decompile** and **navigate** java *.class* files.
    - It is a packer plugin, meaning you can "enter" these files as archives.
  • This plugin "hacks" the TC packer interface so that class files appear to be archives containing all of:
    - a file "classname.java" which you can view (F3) or copy (F5). This java is the decompiled class file.
    - a list of directories representing all the methods, fields, constructors, member classes and interfaces of the class.
    - a couple more directories show the system properties and environment variables.
moisescastellano
Junior Member
Junior Member
Posts: 36
Joined: 2021-12-05, 19:11 UTC

Re: New TC Plugin: Java Decompiler v1.1

Post by *moisescastellano »

v1.1 - 2022-jan-30
  • You can now also view (F3) or copy (F5) files with extension ".env" and ".property" as they were text files
    - files with extension ".env" contain the environment variables
    - files with extension ".property" contain the system properties
    - new "environment.env" and "properties.property " files in the root dir.
  • JavaDecompiler 1.1 is now based on [Java Plugin Interface v2.3](https://github.com/moisescastellano/tcmd-java-plugin)
    - PluginClassLoader was incomplete (missing e.g. findResources implementation). It has now been completed.
  • Better exception management when getting/showing elements (e.g. class methods) fails:
    - if an error occurs, an ".exception" file is shown that you can open (F3) to view the detail.
    - other elements (e.g. decompiled class) can still be shown in that case
  • Troubleshooting guide linked and main problems enumerated in main README
  • Major code restructure - more legible if you are familiar with lambda expressions
    - it now shares a common extended class (ItemsPlugin) with ThousandTypes plugin
  • JavaDecompiler is now hosted at Github pages
  • Version check (for at least tc-classloader 2.2.0) to avoid javalib problems
    - Refer to: In case you have more than one Java plugin installed
  • Source code is now available at Github project
  • Logging is updated to SLF4J (previously was based on deprecated Apache commons-logging implementation).
    - Logging now works for Log4j2 via SLF4J.
    - Logging is disabled by default, any logging implementation has been removed from the plugin itself.
    - Documentation about how to configure logging for plugins.
  • errormessages.ini: corrected typos on english and german messages, showing some memory dump
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: New TC Plugin: Java Decompiler v1.1

Post by *Hacker »

moisescastellano,
The forum does not support Markdown.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
moisescastellano
Junior Member
Junior Member
Posts: 36
Joined: 2021-12-05, 19:11 UTC

Re: New TC Plugin: Java Decompiler v1.1

Post by *moisescastellano »

Well that's why I spent some time inserting lists, URLs, bold, hr's, and other equally fun forum-proprietary tags.
Post Reply