I made a command line interface with WinMerge Plugin using JD-Core

01_title.jpg

About JD-CLI

__Java __ __ Decompiler __ that hits on the command line and outputs the result on the command line.

About JD

A Java decompiler that can also compile Java 5 and later class files, which are also used in Eclipse. (Reference) To JD Project JD-CLI uses the core library JD-Core used in that JD.

how to use

Go to here ["Jd-cli-windows-1.0.0.zip"] in Assets (https://github.com/jd-wrapper/jd-cli/releases/download/v1.0.0/jd-cli-windows-1.0 Download the .0.zip "DL") zip file. After thawing, the contents look like this. 02_arch.jpg From the command line, you can get the result with jd-cli [file you want to decompile]. 09_res_jd.jpg Other options are as follows

> jd-cli.exe -h
example:
jd-cli(.exe) Example.class
jd-cli(.exe) -b example.jar org.aaa.Example.class
jd-cli(.exe) -b org\aaa Example.class

usage:
 classes...      : Specify the class files...
 -b (--base) VAL : Specify the reference directory or Jar file.
 -h (--help)     : Show helps. (default: false)
 -l (--loc)      : Show full classpath. (default: false)
 -m (--meta)     : Show metadatas.(e.g. Filename, Java versions..) (default:false)
 -n (--line)     : Show Line Number. (default: false)
 -r (--real)     : Realignment Line Number. (default: false)
 -u (--unicode)  : Escapes Unicode Charset. (default: false)

About WinMerge Plugin

There is a folder called WinMergePlugins in the unzipped folder, and if you follow it, there are two types of folders, one for exe and one for jar. For example, the contents of For exe are as follows 03.jpg If WinMerge is installed, running install.bat in the folder with administrator privileges will copy it to the installed folder. After that, please check by deploying the plug-in in WinMerge.

Below is the result of comparing commons-lang3-3.10 and commons-lang3-3.11 of the latest common-lang3. 04_res_exec.gif It is automatically expanded and compared in about 87013ms (317 files). (By the way, the Jar version is 85174ms. It seems that it is about 10ms faster per file. If you have java8 or more and the path is passing, the Jar version may be faster.

The source is ...

JD-ECLIPSE Look at the source and respect the good points. I also brought it as it is. (Of course, the license part will not be erased.) The full path of the file name was the default, so all files will be caught when diffing. Fixed to support non-full path versions. Also, the replacement process when UNICODE was included in the file path was incorrect, so I fixed it. (Resolved the path like org / util / reader becoming org // til / reader)

Digression

The following is a digression, but ...

I was wearing ...

I checked it when I made it, and I made it because it wasn't there, but there were people who had already done the same thing. .. ..

kwart/jd-cmd jd-cmd - Command line Java Decompiler

Almost the same idea as it is not converted to exe. Is it more sophisticated because you can change the output pattern? Well, please use it properly. .. ..

OSX and Linux versions are also available

I made it with reference to Gradle of JD-GUI, so actually check out the source

gradlew build

Then, both Linux version and OSX version will be output. But I haven't tested it, so I haven't put it out before. Somehow it seems to have a GUI-specific option.

Finally

Java related (or rather the article itself) update after a long time. I started with the desire to compare classes with WinMerge. There was a predecessor at the very end, and I was crazy I learned a lot about minifying the jar, executing it with launch4j, and zipping it with distributions. Everyone is amazing at using gradle. .. ..

Recommended Posts

I made a command line interface with WinMerge Plugin using JD-Core
I made a LINE bot with Rails + heroku
I made a plugin to execute jextract with Gradle task
I made a GUI with Swing
I made a risky die with Ruby
I made a plugin for IntelliJ IDEA
I made a rock-paper-scissors app with kotlin
I made a rock-paper-scissors app with android
I made a bulletin board using Docker 1
[LINE BOT] I made a ramen BOT with Java (Maven) + Heroku + Spring Boot (1)
04. I made a front end with SpringBoot + Thymeleaf
I made a mosaic art with Pokemon images
I made a gender selection column with enum
I made blackjack with Ruby (I tried using minitest)
[Rails] I made a draft function using enum
I made a portfolio with Ruby On Rails
[Ruby] I made a crawler with anemone and nokogiri.
I made a lock pattern using the volume key with the Android app. Fragment edition
I made a development environment with rails6 + docker + postgreSQL + Materialize.
I made a mod that instantly calls a vehicle with Minecraft
I made a simple MVC sample system using Spring Boot
I made a Dockerfile to start Glassfish 5 using Oracle Java
I made a chat app.
[Rails] I made a simple calendar mini app with customized specifications.
I want to make a button with a line break with link_to [Note]
[Unity] I tried to make a native plug-in UniNWPathMonitor using NWPathMonitor
I got a warning message with the rails _6.0.3_ new hello_myapp command
I made a simple search form with Spring Boot + GitHub Search API.
Run a simple model made with Keras on iOS using CoreML
What I don't like when using interface of a function with default arguments in Kotlin from Java
Ruby: I made a FizzBuzz program!
Conditional branching with a flowing interface
I made a shopify app @java
I tried using JOOQ with Gradle
I made a simple recommendation function.
Create command line app with maven
Exception handling with a fluid interface
Create exceptions with a fluid interface
I made a matching app (Android app)
Create a Maven project with a command
I made a package.xml generation tool.
[Android] I made a pedometer app.
I was in trouble at work, so I made a plugin for IntelliJ
I made an app to scribble with PencilKit on a PDF file
I made a site that summarizes information on carbohydrate restriction with Vue.js