intoolswetrust / jd-cli

Command line Java Decompiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow users to output specific files from jar

stiemannkj1 opened this issue · comments

This is a feature request to add a command line option to allow users to output only certain decompiled files from a jar rather than the decompiled source of the whole jar. This would be helpful when users only want the contents of a specific file. Potentially, the command line argument could take a pattern so that the user does not need to specify the full path (perhaps this should be separated out into another argument though).

Example usage:

jd-cli --pattern RenderKitBridgeImpl.class ~/.m2/repository/com/liferay/faces/com.
liferay.faces.bridge.impl/4.0.0/com.liferay.faces.bridge.impl-4.0.0.jar -oc

Example output:

package com.liferay.faces.bridge.renderkit.html_basic.internal;

import com.liferay.faces.bridge.renderkit.bridge.internal.ResponseWriterBridgeImpl;
import com.liferay.faces.bridge.renderkit.icefaces.internal.HeadRendererICEfacesImpl;
import com.liferay.faces.bridge.renderkit.primefaces.internal.FileUploadRendererPrimeFacesImpl;
import com.liferay.faces.bridge.renderkit.primefaces.internal.FormRendererPrimeFacesImpl;
import com.liferay.faces.bridge.renderkit.primefaces.internal.HeadRendererPrimeFacesImpl;
import com.liferay.faces.bridge.renderkit.richfaces.internal.FileUploadRendererRichFacesImpl;
import com.liferay.faces.util.product.Product;
import com.liferay.faces.util.product.Product.Name;
import com.liferay.faces.util.product.ProductFactory;
import java.io.Writer;
import javax.faces.context.ResponseWriter;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitWrapper;
import javax.faces.render.Renderer;

public class RenderKitBridgeImpl
  extends RenderKitWrapper
{

Snipped for brevity.

In case anyone else is looking for this feature, I created a simple command-line script to do this: https://github.com/stiemannkj1/liferay-tools/blob/master/Tools/my-tools/decompile.sh

However, I would prefer this to be part of jd-cmd instead.

Finally, if @kwart, doesn't have time to add this, I will consider sending a PR for it myself in the future (if he wants it).