From a42e10ccf15eb059ba4f9e90be4eebf76015c364 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 26 Aug 2019 19:04:29 +0200 Subject: [PATCH 1/7] moved to usptream version 3.0 - adjusted configs, removed lambda patch --- .gitignore | 1 + includeLambdas.patch | 58 ------------------------------------ java-runtime-decompiler.1 | 8 ++++- java-runtime-decompiler.spec | 14 +++++---- sources | 2 +- systemFernflower.patch | 9 ++++-- systemProcyon.patch | 9 ++++-- 7 files changed, 29 insertions(+), 72 deletions(-) delete mode 100644 includeLambdas.patch 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/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.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 e0d503a..0f9f4eb 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: 7%{?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 @@ -10,7 +10,6 @@ Source2: java-runtime-decompiler.1 Source3: jrd.desktop Patch1: systemFernflower.patch Patch2: systemProcyon.patch -Patch3: includeLambdas.patch BuildArch: noarch BuildRequires: maven-local BuildRequires: byteman @@ -35,9 +34,8 @@ This package contains the API documentation for %{name}. %prep %setup -q -n %{name}-%{name}-%{version} -%patch1 -%patch2 -%patch3 +%patch1 -p0 +%patch2 -p0 %build pushd runtime-decompiler @@ -81,6 +79,10 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog +* Mon Aug 26 2019 Jiri Vanek - 3.0-0 +- moved to usptream version 3.0 +- adjusted configs, removed lambda patch + * Thu Jul 25 2019 Fedora Release Engineering - 2.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild 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" From 11490b72665d7785ae2700ac2305e68cd1cadd69 Mon Sep 17 00:00:00 2001 From: Jiri Date: Tue, 27 Aug 2019 09:01:00 +0200 Subject: [PATCH 2/7] Added hunit depndencies --- java-runtime-decompiler.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 0f9f4eb..7321107 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -14,6 +14,8 @@ BuildArch: noarch BuildRequires: maven-local BuildRequires: byteman BuildRequires: rsyntaxtextarea +BuildRequires: junit5 +BuildRequires: junit # depends on devel, not runtime (needs tools.jar) BuildRequires: java-devel = 1:1.8.0 BuildRequires: google-gson From ef67d94c84bd69b8fb90e8feeaf9fdb414cc5a96 Mon Sep 17 00:00:00 2001 From: Jiri Date: Tue, 27 Aug 2019 09:31:43 +0200 Subject: [PATCH 3/7] Added surefire and test deps --- java-runtime-decompiler.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 7321107..e0f678b 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -15,7 +15,13 @@ BuildRequires: maven-local BuildRequires: byteman BuildRequires: rsyntaxtextarea BuildRequires: junit5 +BuildRequires: ant-junit5 BuildRequires: junit +BuildRequires: ant-junit +BuildRequires: maven-surefire-provider-junit +BuildRequires: maven-surefire-provider-junit5 +BuildRequires: maven-surefire +BuildRequires: maven-surefire-plugin # depends on devel, not runtime (needs tools.jar) BuildRequires: java-devel = 1:1.8.0 BuildRequires: google-gson From e33654e7d080dd3e62cbc18ec6b6aa8ed7593d90 Mon Sep 17 00:00:00 2001 From: Jiri Date: Tue, 27 Aug 2019 10:29:49 +0200 Subject: [PATCH 4/7] All debu outputs moved to stderr. It was killing headless mode --- java-runtime-decompiler | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java-runtime-decompiler b/java-runtime-decompiler index f7da489..9dda23a 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 >&2 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 "$@" From 39968af95e4f5a3549065f42355aada0ffb82494 Mon Sep 17 00:00:00 2001 From: Jiri Date: Tue, 27 Aug 2019 10:37:29 +0200 Subject: [PATCH 5/7] - all stdouts from customlauncher moved to stderr --- java-runtime-decompiler.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index e0f678b..ce775b5 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: 3.0 -Release: 1%{?dist} +Release: 3%{?dist} License: GPLv3 URL: https://github.com/pmikova/java-runtime-decompiler Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz @@ -87,6 +87,9 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog +* Tue Aug 27 2019 Jiri Vanek - 3.0-3 +- all stdouts from customlauncher moved to stderr + * Mon Aug 26 2019 Jiri Vanek - 3.0-0 - moved to usptream version 3.0 - adjusted configs, removed lambda patch From bd25d1cbce5f16ff1034c2c9618bdf999b4c20fe Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 27 Aug 2019 17:17:17 +0200 Subject: [PATCH 6/7] Fixed generation of default agent --- java-runtime-decompiler | 2 +- java-runtime-decompiler.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java-runtime-decompiler b/java-runtime-decompiler index 9dda23a..e2b83b0 100644 --- a/java-runtime-decompiler +++ b/java-runtime-decompiler @@ -75,7 +75,7 @@ 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." >&2 else - echo $AGENT_STRING >> $CONFIG_FILE >&2 + echo $AGENT_STRING >> $CONFIG_FILE fi else diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index ce775b5..3198a16 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: 3.0 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3 URL: https://github.com/pmikova/java-runtime-decompiler Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz From edf67171d3928de19239c0077bfc2fd0921afb7c Mon Sep 17 00:00:00 2001 From: Jiri Date: Tue, 17 Mar 2020 17:09:37 +0100 Subject: [PATCH 7/7] changed jdk8 requirement --- java-runtime-decompiler.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 3198a16..ae7c2b1 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: 3.0 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3 URL: https://github.com/pmikova/java-runtime-decompiler Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz @@ -23,10 +23,10 @@ BuildRequires: maven-surefire-provider-junit5 BuildRequires: maven-surefire BuildRequires: maven-surefire-plugin # depends on devel, not runtime (needs tools.jar) -BuildRequires: java-devel = 1:1.8.0 +BuildRequires: java-1.8.0-devel BuildRequires: google-gson BuildRequires: desktop-file-utils -Requires: java-devel = 1:1.8.0 +Requires: java-1.8.0-devel Recommends: fernflower Recommends: procyon-decompiler @@ -87,6 +87,9 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog +* Tue Mar 17 2020 Jiri Vanek - 3.0-5 +- changed jdk8 requirement + * Tue Aug 27 2019 Jiri Vanek - 3.0-3 - all stdouts from customlauncher moved to stderr