diff --git a/.gitignore b/.gitignore index 7e75df4..f4ee33b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /java-runtime-decompiler-2.0.tar.gz +/java-runtime-decompiler-3.0.tar.gz diff --git a/enjoyDoclint.patch b/enjoyDoclint.patch deleted file mode 100644 index f6e20ad..0000000 --- a/enjoyDoclint.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- runtime-decompiler/src/main/java/org/jrd/frontend/Templates/ConfigPanel.java -+++ runtime-decompiler/src/main/java/org/jrd/frontend/Templates/ConfigPanel (copy).java -@@ -98,7 +98,7 @@ - removeButtonListener.actionPerformed(actionEvent); - }); - trashCanPanel.setLayout(null); -- removeButton.setBounds(-2, 26, 32, 32); //🙈 -+ removeButton.setBounds(-2, 26, 32, 32); //monky emoticon removed, doclint do not eat it - if (wrapperInformation.getScope().equals("local")) { - trashCanPanel.add(removeButton); - } - diff --git a/includeLambdas.patch b/includeLambdas.patch deleted file mode 100644 index 2fc9fee..0000000 --- a/includeLambdas.patch +++ /dev/null @@ -1,58 +0,0 @@ -commit fd66fd3a37cc899b11d97a13e0e23319d86f39c3 -Author: Jiri Vanek -Date: Wed Jan 16 18:03:43 2019 +0100 - - Showing Lambdas again, but sorting them to the end. - -diff --git a/runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java b/runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java -index b7fddea..603c26d 100644 ---- runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java -+++ runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java -@@ -8,6 +8,7 @@ import org.jrd.backend.data.VmManager; - - import java.util.ArrayList; - import java.util.Arrays; -+import java.util.Comparator; - import java.util.List; - - /** -@@ -146,6 +147,29 @@ public class DecompilerRequestReceiver { - return ERROR_RESPONSE; - } - String[] arrayOfClasses = parseClasses(classes); -+ if (arrayOfClasses != null){ -+ Arrays.sort(arrayOfClasses, new Comparator() { -+ @Override -+ public int compare(String o1, String o2) { -+ if (o1 == null && o2 == null) { -+ return 0; -+ } -+ if (o1 == null && o2 != null) { -+ return 1; -+ } -+ if (o1 != null && o2 == null) { -+ return -1; -+ } -+ if (o1.startsWith("[") && !o2.startsWith("[")) { -+ return 1; -+ } -+ if (!o1.startsWith("[") && o2.startsWith("[")) { -+ return -1; -+ } -+ return o1.compareTo(o2); -+ } -+ }); -+ } - VmDecompilerStatus status = new VmDecompilerStatus(); - status.setHostname(hostname); - status.setListenPort(actualListenPort); -@@ -214,9 +238,7 @@ public class DecompilerRequestReceiver { - list.removeAll(Arrays.asList("", null)); - List list1 = new ArrayList<>(); - for (String s : list) { -- if (!(s.contains("Lambda") | s.startsWith("["))){ - list1.add(s); -- } - } - java.util.Collections.sort(list1); - return list1.toArray(new String[]{}); diff --git a/java-runtime-decompiler b/java-runtime-decompiler index 4906ab2..0d14213 100644 --- a/java-runtime-decompiler +++ b/java-runtime-decompiler @@ -58,7 +58,7 @@ for cpfile in $CP_FILES; do then cp $cpfile $PLUGIN_HOME else - echo "Configuration files were not copied for $FILE_NAME - the existing configuration would be overwritten." + echo "Configuration files were not copied for $FILE_NAME - the existing configuration would be overwritten." >&2 fi done @@ -69,17 +69,17 @@ if [ -e $AGENT ] then if grep -Fxq $AGENT_STRING $CONFIG_FILE then - echo "Default agent path is already set in $CONFIG_FILE. Skipping agent path setting." + echo "Default agent path is already set in $CONFIG_FILE. Skipping agent path setting." >&2 elif grep -rq $AGENT_PREFIX $CONFIG_FILE then RESULT_OF_GREP="$(grep -rq $AGENT_PREFIX $CONFIG_FILE)" - echo "Agent path is already set in $CONFIG_FILE as ${RESULT_OF_GREP}. Skipping agent path setting." + echo "Agent path is already set in $CONFIG_FILE as ${RESULT_OF_GREP}. Skipping agent path setting." >&2 else - echo $AGENT_STRING >> $CONFIG_FILE + echo $AGENT_STRING >> $CONFIG_FILE fi else - echo "Agent was not found and agent path was not set correctly. This has to be done manually in the decompiler GUI, or set AGENT_PATH===path_to_agent_jar in the configuration file: $CONFIG_FILE" + echo "Agent was not found and agent path was not set correctly. This has to be done manually in the decompiler GUI, or set AGENT_PATH===path_to_agent_jar in the configuration file: $CONFIG_FILE" >&2 fi run "$@" diff --git a/java-runtime-decompiler.1 b/java-runtime-decompiler.1 index 5aa7e3c..eb2cddd 100644 --- a/java-runtime-decompiler.1 +++ b/java-runtime-decompiler.1 @@ -1,4 +1,4 @@ -.TH java-runtime-decompiler 1 "05 September 2018" "version 2.0" +.TH java-runtime-decompiler 1 "26 August 2019" "version 3.0" .SH NAME java-runtime-decompiler \- launch java-runtime decompiler GUI .SH SYNOPSIS @@ -22,5 +22,11 @@ Print on stdout binary form of given class loaded in JVM with given PID/URL. Print on stdout binary form encoded in base64 of given class loaded in JVM with given PID/URL. .IP "-decompile pid-xor-url class-name config-file" Print on stdout decompiled class, needs PID/URL of JVM, class name and name/file with decompiler configuration, can use javap disassembler. To pass arguments to the disassembler, add them to javap without spaces (e.g. javap-v). +.IP "-overwrite pid/urlOfJVM classToOverwrite fileWithNewBytecode" +three args - pid or url of JVM and class to overwrite and file with new bytecode .SH AUTHOR Petra Alice Mikova (petra.alice.mikova@gmail.com) +Jiri Vanek (judovana@email.com) +Radek Manak (Radek.Manak@protonmail.com) +Ondrej Hrdlicka (ondra.ondrah@seznam.cz) + diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 3670533..57a836a 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -1,7 +1,7 @@ Summary: Application for extraction and decompilation of JVM byte code Name: java-runtime-decompiler -Version: 2.0 -Release: 5%{?dist} +Version: 3.0 +Release: 1%{?dist} License: GPLv3 URL: https://github.com/pmikova/java-runtime-decompiler Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz @@ -11,9 +11,6 @@ Source3: jrd.desktop Patch0: remove_rsyntaxtextarea.patch Patch1: systemFernflower.patch Patch2: systemProcyon.patch -Patch3: includeLambdas.patch -# this should be upstreamed -Patch4: enjoyDoclint.patch BuildArch: noarch BuildRequires: maven-local BuildRequires: byteman @@ -42,8 +39,6 @@ This package contains the API documentation for %{name}. %patch0 -p1 %patch1 %patch2 -%patch3 -%patch4 %build pushd runtime-decompiler diff --git a/remove_rsyntaxtextarea.patch b/remove_rsyntaxtextarea.patch index e2e9142..66d7af1 100644 --- a/remove_rsyntaxtextarea.patch +++ b/remove_rsyntaxtextarea.patch @@ -18,8 +18,8 @@ index 26a416e..e6e2425 100644 byteman-install diff --git a/runtime-decompiler/src/main/java/org/jrd/frontend/BytecodeDecompilerView.java b/runtime-decompiler/src/main/java/org/jrd/frontend/BytecodeDecompilerView.java index 9c19e2c..8d17775 100644 ---- a/runtime-decompiler/src/main/java/org/jrd/frontend/BytecodeDecompilerView.java -+++ b/runtime-decompiler/src/main/java/org/jrd/frontend/BytecodeDecompilerView.java +--- a/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/BytecodeDecompilerView.java ++++ b/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/BytecodeDecompilerView.java @@ -2,9 +2,9 @@ package org.jrd.frontend.MainFrame; import org.jrd.backend.core.OutputController; @@ -43,10 +43,10 @@ index 9c19e2c..8d17775 100644 + private JTextArea bytecodeSyntaxTextArea; private ActionListener bytesActionListener; private ActionListener classesActionListener; - private String[] classes; -@@ -120,10 +120,10 @@ public class BytecodeDecompilerView { - - topComboBox = new JComboBox(); + private ActionListener rewriteActionListener; +@@ -147,10 +147,10 @@ public class BytecodeDecompilerView { + } + }); - bytecodeSyntaxTextArea = new RSyntaxTextArea(); - bytecodeSyntaxTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); @@ -59,3 +59,4 @@ index 9c19e2c..8d17775 100644 leftMainPanel = new JPanel(); leftMainPanel.setLayout(new BorderLayout()); + diff --git a/sources b/sources index bbb57cd..d54d342 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (java-runtime-decompiler-2.0.tar.gz) = dc7c1e9c785539ef464d18d039403b677476e34ba54cc3717552c59a2e405b550c86b40607cc77efafdfdd0b3ce1f6813a7532915bbfabffc0e46023bb85ed95 +SHA512 (java-runtime-decompiler-3.0.tar.gz) = 329184689763b7777ef0bad1c0f787aa649f855692b52bd843cacd424d5d2c0caadad328f80cd7f229031a151b6414c712bd770abd285412055c5d34d932875c diff --git a/systemFernflower.patch b/systemFernflower.patch index ab707cd..ecb8d07 100644 --- a/systemFernflower.patch +++ b/systemFernflower.patch @@ -1,10 +1,13 @@ --- runtime-decompiler/src/plugins/FernflowerDecompilerWrapper.json +++ runtime-decompiler/src/plugins/FernflowerDecompilerWrapper.json -@@ -2,7 +2,7 @@ +@@ -1,9 +1,8 @@ + { "Name": "Fernflower", - "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/FernflowerDecompilerWrapper.java", +- "WrapperURL": "file://${XDG_CONFIG_HOME}/plugins/FernflowerDecompilerWrapper.java", ++ "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/FernflowerDecompilerWrapper.java", "DependencyURL": [ -- "file://${HOME}/IdeaProjects/fernflower/build/libs/fernflower.jar" +- "file://${HOME}/.m2/repository/org/jboss/windup/decompiler/decompiler-fernflower/4.2.1.Final/decompiler-fernflower-4.2.1.Final.jar", +- "file://${HOME}/.m2/repository/org/jboss/windup/decompiler/fernflower/windup-fernflower/1.0.0.20171018/windup-fernflower-1.0.0.20171018.jar" + "file:///usr/share/java/fernflower.jar" ], "DecompilerDownloadURL": "https://github.com/JetBrains/intellij-community/tree/master/plugins/java-decompiler/engine" diff --git a/systemProcyon.patch b/systemProcyon.patch index 91e2c7b..1581df9 100644 --- a/systemProcyon.patch +++ b/systemProcyon.patch @@ -1,10 +1,13 @@ --- runtime-decompiler/src/plugins/ProcyonDecompilerWrapper.json 2018-11-12 15:25:47.000000000 +0100 +++ runtime-decompiler/src/plugins/ProcyonDecompilerWrapper.json 2019-01-16 12:13:37.317778036 +0100 -@@ -2,7 +2,9 @@ +@@ -1,9 +1,10 @@ + { "Name": "Procyon", - "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/ProcyonDecompilerWrapper.java", +- "WrapperURL": "file://${XDG_CONFIG_HOME}/plugins/ProcyonDecompilerWrapper.java", ++ "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/ProcyonDecompilerWrapper.java", "DependencyURL": [ -- "file:///usr/share/java/procyon-decompiler.jar" +- "file://${HOME}/.m2/repository/org/bitbucket/mstrobel/procyon-core/0.5.35/procyon-core-0.5.35.jar", +- "file://${HOME}/.m2/repository/org/bitbucket/mstrobel/procyon-compilertools/0.5.35/procyon-compilertools-0.5.35.jar" + "/usr/share/java/procyon/procyon-core.jar", + "/usr/share/java/procyon/procyon-compilertools.jar", + "/usr/share/java/procyon/procyon-decompiler.jar"