From 47e433a6b88b07e921988982c76db78d0a521eed Mon Sep 17 00:00:00 2001 From: pmikova Date: Wed, 28 Nov 2018 14:51:45 +0100 Subject: [PATCH 01/15] Initial import (#1636019) --- .gitignore | 1 + java-runtime-decompiler | 86 ++++++++++++++++++++++++++++++++++++ java-runtime-decompiler.1 | 26 +++++++++++ java-runtime-decompiler.spec | 84 +++++++++++++++++++++++++++++++++++ jrd.desktop | 8 ++++ sources | 1 + 6 files changed, 206 insertions(+) create mode 100644 .gitignore create mode 100644 java-runtime-decompiler create mode 100644 java-runtime-decompiler.1 create mode 100644 java-runtime-decompiler.spec create mode 100644 jrd.desktop create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e75df4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/java-runtime-decompiler-2.0.tar.gz diff --git a/java-runtime-decompiler b/java-runtime-decompiler new file mode 100644 index 0000000..f7da489 --- /dev/null +++ b/java-runtime-decompiler @@ -0,0 +1,86 @@ +#!/usr/bin/bash + +# java runtime decompiler launch script + +# JPackage Project +# Source functions library + +. /usr/share/java-utils/java-functions + +# identify directory tree +JRD=`basename $0` +CONF_HOME=$XDG_CONFIG_HOME + + +if [ "$CONF_HOME" = "" ] ; then + CONF_HOME=$HOME/.config/$JRD + +else + CONF_HOME=$CONF_HOME/$JRD + +fi + +LOG_DIR=$CONF_HOME/logs + +CONF_DIR=$CONF_HOME/conf + +# create directory tree +PLUGIN_HOME=$CONF_HOME/plugins + +mkdir -p $LOG_DIR + +mkdir -p $CONF_DIR + +mkdir -p $PLUGIN_HOME + +: ${MAIN_CLASS:=org.jrd.backend.data.Main} + +# set java and jvm arguments +export _prefer_jre=false +_set_java_home +set_jvm + +# all dependencies must be on classpath +set_classpath java-runtime-decompiler rsyntaxtextarea byteman google-gson +CLASSPATH=$CLASSPATH:${JAVA_HOME}/lib/tools.jar + +# set path to agent automatically +AGENT="/usr/share/java/java-runtime-decompiler/decompiler-agent.jar" +CONFIG_FILE=$CONF_DIR/config.cfg +AGENT_PREFIX="AGENT_PATH===" +AGENT_STRING=$AGENT_PREFIX$AGENT + +# copy json wrappers information to home so the users can edit +CP_FILES="$(ls /etc/$JRD/plugins/*.json)" +for cpfile in $CP_FILES; do + FILE_NAME="$(basename -- $cpfile)" + if [ ! -e "$PLUGIN_HOME/$FILE_NAME" ] + then + cp $cpfile $PLUGIN_HOME + else + echo "Configuration files were not copied for $FILE_NAME - the existing configuration would be overwritten." + fi +done + +# create config file and add agent default path +touch $CONFIG_FILE + +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." + 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." + else + 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" +fi + +run "$@" + diff --git a/java-runtime-decompiler.1 b/java-runtime-decompiler.1 new file mode 100644 index 0000000..5aa7e3c --- /dev/null +++ b/java-runtime-decompiler.1 @@ -0,0 +1,26 @@ +.TH java-runtime-decompiler 1 "05 September 2018" "version 2.0" +.SH NAME +java-runtime-decompiler \- launch java-runtime decompiler GUI +.SH SYNOPSIS +java-runtime-decompiler +.SH DESCRIPTION +It is used for extraction of bytecode from running JVM and decompilation of the bytecode with an external decompiler. Paths to the decompiler need to be specified in .json configuration file located in /etc/java-runtime-decompiler +.SH OPTIONS +.IP -verbose +Print out all exceptions and debugging strings in stdout. +.IP -help +Print out help and exits. +.IP -listjvms +List available local JVMs. +.IP -listplugins +List currently configured plugins with their status. +.IP "-listclasses pid-xor-url" +List loaded classes from JVM with given PID/URL. +.IP "-bytes pid class-name" +Print on stdout binary form of given class loaded in JVM with given PID/URL. +.IP "-base64bytes pid-xor-url class-name" +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). +.SH AUTHOR +Petra Alice Mikova (petra.alice.mikova@gmail.com) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec new file mode 100644 index 0000000..b96cacd --- /dev/null +++ b/java-runtime-decompiler.spec @@ -0,0 +1,84 @@ +Summary: Application for extraction and decompilation of JVM byte code +Name: java-runtime-decompiler +Version: 2.0 +Release: 2%{?dist} +License: GPLv3 +URL: https://github.com/pmikova/java-runtime-decompiler +Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz +Source1: java-runtime-decompiler +Source2: java-runtime-decompiler.1 +Source3: jrd.desktop +BuildArch: noarch +BuildRequires: maven-local +BuildRequires: byteman +BuildRequires: rsyntaxtextarea +# depends on devel, not runtime (needs tools.jar) +BuildRequires: java-devel = 1:1.8.0 +BuildRequires: google-gson +BuildRequires: desktop-file-utils +Requires: java-devel = 1:1.8.0 + +%description +This application can access JVM memory at runtime, +extract byte code from the JVM and decompile it. +%package javadoc +Summary: Javadoc for %{name} +Requires: %{name} = %{version}-%{release} + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q -n %{name}-%{name}-%{version} + +%build +pushd runtime-decompiler +%pom_remove_dep com.sun:tools +%pom_add_dep com.sun:tools +%pom_remove_plugin :maven-jar-plugin +popd +%mvn_build + +%install +%mvn_install +install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1/ +install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1/ + +install -d -m 755 $RPM_BUILD_ROOT%{_bindir} +install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/ +install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/ +cp -r %{_builddir}/%{name}-%{name}-%{version}/runtime-decompiler/src/plugins/ $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/ + +install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/applications +desktop-file-install --vendor="fedora" \ +--dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE3} + +%files -f .mfiles +%attr(755, root, -) %{_bindir}/java-runtime-decompiler +%{_mandir}/man1/java-runtime-decompiler.1* + +# wrappers for decompilers +%dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/plugins +%config %{_sysconfdir}/%{name}/plugins/FernflowerDecompilerWrapper.java +%config(noreplace) %{_sysconfdir}/%{name}/plugins/FernflowerDecompilerWrapper.json +%config %{_sysconfdir}/%{name}/plugins/ProcyonDecompilerWrapper.java +%config(noreplace) %{_sysconfdir}/%{name}/plugins/ProcyonDecompilerWrapper.json +%license LICENSE + +%dir %{_datadir}/applications +%{_datadir}/applications/fedora-jrd.desktop + +%files javadoc -f .mfiles-javadoc +%license LICENSE + +%changelog +* Wed Nov 28 2018 Petra Mikova - 2.0-2 +- fixed changelog + +* Mon Nov 19 2018 Petra Mikova - 2.0-1 +- fixed issues listed in review (rhbz#1636019) +- added installation of desktop file + +* Wed Jun 06 2018 Petra Mikova - 1.1-1 +- initial commit diff --git a/jrd.desktop b/jrd.desktop new file mode 100644 index 0000000..eb2d468 --- /dev/null +++ b/jrd.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Categories=Development;Profiling;Java; +Version=1.0 +Name=Java Runtime Decompiler +Exec=java-runtime-decompiler +Terminal=false diff --git a/sources b/sources new file mode 100644 index 0000000..bbb57cd --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (java-runtime-decompiler-2.0.tar.gz) = dc7c1e9c785539ef464d18d039403b677476e34ba54cc3717552c59a2e405b550c86b40607cc77efafdfdd0b3ce1f6813a7532915bbfabffc0e46023bb85ed95 From 8061ac7bb11578523074aecd3031995dd2130559 Mon Sep 17 00:00:00 2001 From: pmikova Date: Mon, 3 Dec 2018 14:20:00 +0100 Subject: [PATCH 02/15] Patch to remove rsyntaxtextarea, as rhel does not provide this package --- java-runtime-decompiler | 2 +- java-runtime-decompiler.spec | 12 +++++-- remove_rsyntaxtextarea.patch | 61 ++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 remove_rsyntaxtextarea.patch diff --git a/java-runtime-decompiler b/java-runtime-decompiler index f7da489..4906ab2 100644 --- a/java-runtime-decompiler +++ b/java-runtime-decompiler @@ -41,7 +41,7 @@ _set_java_home set_jvm # all dependencies must be on classpath -set_classpath java-runtime-decompiler rsyntaxtextarea byteman google-gson +set_classpath java-runtime-decompiler byteman google-gson CLASSPATH=$CLASSPATH:${JAVA_HOME}/lib/tools.jar # set path to agent automatically diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index b96cacd..d25e5d7 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -1,17 +1,20 @@ Summary: Application for extraction and decompilation of JVM byte code Name: java-runtime-decompiler Version: 2.0 -Release: 2%{?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 Source1: java-runtime-decompiler Source2: java-runtime-decompiler.1 Source3: jrd.desktop +# Remove RSyntaxTextArea library from the sources and dependencies, as it is not packaged for epel +Patch1: remove_rsyntaxtextarea.patch BuildArch: noarch BuildRequires: maven-local BuildRequires: byteman -BuildRequires: rsyntaxtextarea +# RHEL does not have this package +# BuildRequires: rsyntaxtextarea # depends on devel, not runtime (needs tools.jar) BuildRequires: java-devel = 1:1.8.0 BuildRequires: google-gson @@ -30,6 +33,7 @@ This package contains the API documentation for %{name}. %prep %setup -q -n %{name}-%{name}-%{version} +%patch1 -p1 %build pushd runtime-decompiler @@ -73,6 +77,10 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog +* Mon Dec 3 2018 Petra Mikova - 2.0-3 +- patch to remove rsyntaxtextarea, because rhel does not have the package +- removed from spec and runscript accordingly + * Wed Nov 28 2018 Petra Mikova - 2.0-2 - fixed changelog diff --git a/remove_rsyntaxtextarea.patch b/remove_rsyntaxtextarea.patch new file mode 100644 index 0000000..e2e9142 --- /dev/null +++ b/remove_rsyntaxtextarea.patch @@ -0,0 +1,61 @@ +diff --git a/runtime-decompiler/pom.xml b/runtime-decompiler/pom.xml +index 26a416e..e6e2425 100644 +--- a/runtime-decompiler/pom.xml ++++ b/runtime-decompiler/pom.xml +@@ -100,11 +100,11 @@ + system + ${java.home}/../lib/tools.jar + +- ++ + + org.jboss.byteman + 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 +@@ -2,9 +2,9 @@ package org.jrd.frontend.MainFrame; + + import org.jrd.backend.core.OutputController; + import org.jrd.backend.decompiling.DecompilerWrapperInformation; +-import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; +-import org.fife.ui.rsyntaxtextarea.SyntaxConstants; +-import org.fife.ui.rtextarea.RTextScrollPane; ++//import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; ++//import org.fife.ui.rsyntaxtextarea.SyntaxConstants; ++//import org.fife.ui.rtextarea.RTextScrollPane; + + import javax.swing.*; + import javax.swing.border.EtchedBorder; +@@ -30,8 +30,8 @@ public class BytecodeDecompilerView { + private JPanel rightMainPanel; + private JScrollPane leftScrollPanel; + private JList filteredClassesJlist; +- private RTextScrollPane bytecodeScrollPane; +- private RSyntaxTextArea bytecodeSyntaxTextArea; ++ private JScrollPane bytecodeScrollPane; ++ private JTextArea bytecodeSyntaxTextArea; + private ActionListener bytesActionListener; + private ActionListener classesActionListener; + private String[] classes; +@@ -120,10 +120,10 @@ public class BytecodeDecompilerView { + + topComboBox = new JComboBox(); + +- bytecodeSyntaxTextArea = new RSyntaxTextArea(); +- bytecodeSyntaxTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); +- bytecodeSyntaxTextArea.setCodeFoldingEnabled(true); +- bytecodeScrollPane = new RTextScrollPane(bytecodeSyntaxTextArea); ++ bytecodeSyntaxTextArea = new JTextArea(); ++ //bytecodeSyntaxTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); ++ //bytecodeSyntaxTextArea.setCodeFoldingEnabled(true); ++ bytecodeScrollPane = new JScrollPane(bytecodeSyntaxTextArea); + + leftMainPanel = new JPanel(); + leftMainPanel.setLayout(new BorderLayout()); From 8b7f5e040e782ac975b740de9453a3be98ecba35 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 18 Jan 2019 10:25:57 +0100 Subject: [PATCH 03/15] Sync from rawhide to new docompilers and with hope to build agaisnt new json --- includeLambdas.patch | 58 ++++++++++++++++++++++++++++++++++++ java-runtime-decompiler.spec | 29 ++++++++++++++---- systemFernflower.patch | 13 ++++++++ systemProcyon.patch | 15 ++++++++++ 4 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 includeLambdas.patch create mode 100644 systemFernflower.patch create mode 100644 systemProcyon.patch diff --git a/includeLambdas.patch b/includeLambdas.patch new file mode 100644 index 0000000..2fc9fee --- /dev/null +++ b/includeLambdas.patch @@ -0,0 +1,58 @@ +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.spec b/java-runtime-decompiler.spec index d25e5d7..51062e0 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -1,15 +1,17 @@ Summary: Application for extraction and decompilation of JVM byte code Name: java-runtime-decompiler Version: 2.0 -Release: 3%{?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 Source1: java-runtime-decompiler Source2: java-runtime-decompiler.1 Source3: jrd.desktop -# Remove RSyntaxTextArea library from the sources and dependencies, as it is not packaged for epel -Patch1: remove_rsyntaxtextarea.patch +Patch0: remove_rsyntaxtextarea.patch +Patch1: systemFernflower.patch +Patch2: systemProcyon.patch +Patch3: includeLambdas.patch BuildArch: noarch BuildRequires: maven-local BuildRequires: byteman @@ -20,6 +22,8 @@ BuildRequires: java-devel = 1:1.8.0 BuildRequires: google-gson BuildRequires: desktop-file-utils Requires: java-devel = 1:1.8.0 +Recommends: fernflower +Recommends: procyon-decompiler %description This application can access JVM memory at runtime, @@ -33,7 +37,10 @@ This package contains the API documentation for %{name}. %prep %setup -q -n %{name}-%{name}-%{version} -%patch1 -p1 +%patch0 -p1 +%patch1 +%patch2 +%patch3 %build pushd runtime-decompiler @@ -77,8 +84,20 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog +* Thu Jan 17 2019 Jiri Vanek - 2.0-5 +- improved Patch3, includeLambdas.patch to sort the lamdas t the bottom + +* Thu Jan 17 2019 Jiri Vanek - 2.0-4 +- added depndence of procyon decompiler (currenlty under review +- added and applied Patch2, systemProcyon.patch to enable system procyon out of thebox +- added and applied Patch3, includeLambdas.patch to at least list lamdas untill fixed in upstream + +* Thu Jan 10 2019 Jiri Vanek - 2.0-3 +- added depndence of fernflower decompiler +- added and applied Patch1, systemFernflower.patch to enable system fernflower + * Mon Dec 3 2018 Petra Mikova - 2.0-3 -- patch to remove rsyntaxtextarea, because rhel does not have the package +- patch to remove rsyntaxtextarea, because rhel does not have the package(guilty is jvanek, sorry) - removed from spec and runscript accordingly * Wed Nov 28 2018 Petra Mikova - 2.0-2 diff --git a/systemFernflower.patch b/systemFernflower.patch new file mode 100644 index 0000000..ab707cd --- /dev/null +++ b/systemFernflower.patch @@ -0,0 +1,13 @@ +--- runtime-decompiler/src/plugins/FernflowerDecompilerWrapper.json ++++ runtime-decompiler/src/plugins/FernflowerDecompilerWrapper.json +@@ -2,7 +2,7 @@ + "Name": "Fernflower", + "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/FernflowerDecompilerWrapper.java", + "DependencyURL": [ +- "file://${HOME}/IdeaProjects/fernflower/build/libs/fernflower.jar" ++ "file:///usr/share/java/fernflower.jar" + ], + "DecompilerDownloadURL": "https://github.com/JetBrains/intellij-community/tree/master/plugins/java-decompiler/engine" +-} +\ No newline at end of file ++} diff --git a/systemProcyon.patch b/systemProcyon.patch new file mode 100644 index 0000000..91e2c7b --- /dev/null +++ b/systemProcyon.patch @@ -0,0 +1,15 @@ +--- 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 @@ + "Name": "Procyon", + "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/ProcyonDecompilerWrapper.java", + "DependencyURL": [ +- "file:///usr/share/java/procyon-decompiler.jar" ++ "/usr/share/java/procyon/procyon-core.jar", ++ "/usr/share/java/procyon/procyon-compilertools.jar", ++ "/usr/share/java/procyon/procyon-decompiler.jar" + ], + "DecompilerDownloadURL": "https://bitbucket.org/mstrobel/procyon/downloads/" +-} +\ No newline at end of file ++} From 2cafc5ab61ee1b5177f294ac9f2d9cfe7c1c9a21 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 18 Jan 2019 10:35:54 +0100 Subject: [PATCH 04/15] Rehl7 do not have week dependences. Removing fernwloer and procyon for now --- java-runtime-decompiler.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 51062e0..dda611b 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -22,8 +22,8 @@ BuildRequires: java-devel = 1:1.8.0 BuildRequires: google-gson BuildRequires: desktop-file-utils Requires: java-devel = 1:1.8.0 -Recommends: fernflower -Recommends: procyon-decompiler +#Requires: fernflower +#Requires: procyon-decompiler %description This application can access JVM memory at runtime, From 6c8b16d150e1b10e26c48787da7173f670493b06 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 18 Jan 2019 10:36:55 +0100 Subject: [PATCH 05/15] Enabled fenflower, it is already in testing --- java-runtime-decompiler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index dda611b..7224452 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -22,7 +22,7 @@ BuildRequires: java-devel = 1:1.8.0 BuildRequires: google-gson BuildRequires: desktop-file-utils Requires: java-devel = 1:1.8.0 -#Requires: fernflower +Requires: fernflower #Requires: procyon-decompiler %description From d63f93c8d3697956a67d713bb848ac36c5cc7aec Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 18 Jan 2019 12:35:57 +0100 Subject: [PATCH 06/15] Fixed doclint error. The patch should be upstreamed --- enjoyDoclint.patch | 12 ++++++++++++ java-runtime-decompiler.spec | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 enjoyDoclint.patch diff --git a/enjoyDoclint.patch b/enjoyDoclint.patch new file mode 100644 index 0000000..f6e20ad --- /dev/null +++ b/enjoyDoclint.patch @@ -0,0 +1,12 @@ +--- 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/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 7224452..626641b 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -12,6 +12,8 @@ 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 @@ -41,6 +43,7 @@ This package contains the API documentation for %{name}. %patch1 %patch2 %patch3 +%patch4 %build pushd runtime-decompiler From fda3b3d5e6f9ffa5b6c2b43bbe1fea83da1fbeaa Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Fri, 18 Jan 2019 12:51:58 +0100 Subject: [PATCH 07/15] Disabling doclint --- java-runtime-decompiler.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 626641b..3670533 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -51,6 +51,7 @@ pushd runtime-decompiler %pom_add_dep com.sun:tools %pom_remove_plugin :maven-jar-plugin popd +export JAVA_TOOL_OPTIONS="-Dadditionalparam=-Xdoclint:none -DadditionalJOption=-Xdoclint:none" %mvn_build %install @@ -89,6 +90,7 @@ desktop-file-install --vendor="fedora" \ %changelog * Thu Jan 17 2019 Jiri Vanek - 2.0-5 - improved Patch3, includeLambdas.patch to sort the lamdas t the bottom +- disabled doclint, remove invlaid src character * Thu Jan 17 2019 Jiri Vanek - 2.0-4 - added depndence of procyon decompiler (currenlty under review From 0fbc5d1d5ca50f4d4b2d3a3f0ecf4bc5c2fafb85 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 27 Aug 2019 17:56:44 +0200 Subject: [PATCH 08/15] Bumped to upstream 3.0 --- .gitignore | 1 + enjoyDoclint.patch | 12 -------- includeLambdas.patch | 58 ------------------------------------ java-runtime-decompiler | 10 +++---- java-runtime-decompiler.1 | 8 ++++- java-runtime-decompiler.spec | 9 ++---- remove_rsyntaxtextarea.patch | 13 ++++---- sources | 2 +- systemFernflower.patch | 9 ++++-- systemProcyon.patch | 9 ++++-- 10 files changed, 35 insertions(+), 96 deletions(-) delete mode 100644 enjoyDoclint.patch 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/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" From 666550f9c95f765d986d991ad44d9299fe7ea054 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 27 Aug 2019 18:35:36 +0200 Subject: [PATCH 09/15] Adapted 3.0 to epel --- fixDoclint.patch | 19 +++++++++++++++++++ java-runtime-decompiler.spec | 11 ++++++++--- remove_rsyntaxtextarea.patch | 35 +++++++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 fixDoclint.patch diff --git a/fixDoclint.patch b/fixDoclint.patch new file mode 100644 index 0000000..bdd46dc --- /dev/null +++ b/fixDoclint.patch @@ -0,0 +1,19 @@ +diff --git a/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java b/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java +index 86f9a87..18dce1a 100644 +--- a/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java ++++ b/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java +@@ -174,11 +174,11 @@ public class MainFrameView { + welcomeJTextArea = new JTextArea(9, 40); + welcomeJTextArea.setText("Welcome to Java-Runtime-Decompiler\n" + + "\n" + +- "Before using the app, the Decompiler Agent's path needs to be selected in 'Configure → Decompiler Agent'.\n" + ++ "Before using the app, the Decompiler Agent's path needs to be selected in 'Configure -> Decompiler Agent'.\n" + + "It's a built-in project and can usually be found at '"+ ((isPortable())?"./libs/":"./decompiler_agent/target/") +"decompiler-agent-*.jar'.\n" + + "\n" + + "Internal javap decompiling tools are available by default.\n" + +- "You can also download an external decompiler, e.g. via 'mvn clean install -PdownloadPlugins', and set it up in 'Configure → Plugins'.\n" + ++ "You can also download an external decompiler, e.g. via 'mvn clean install -PdownloadPlugins', and set it up in 'Configure -> Plugins'.\n" + + "Currently supported decompilers are: Fernflower, Procyon.\n"); + welcomeJTextArea.setFont(new Font(welcomeJTextArea.getFont().getFontName(), welcomeJTextArea.getFont().getStyle(), 20)); + welcomeJTextArea.setLineWrap(true); + diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 57a836a..8be33f7 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -11,11 +11,15 @@ Source3: jrd.desktop Patch0: remove_rsyntaxtextarea.patch Patch1: systemFernflower.patch Patch2: systemProcyon.patch +Patch3: fixDoclint.patch BuildArch: noarch BuildRequires: maven-local BuildRequires: byteman -# RHEL does not have this package -# BuildRequires: rsyntaxtextarea +BuildRequires: junit +BuildRequires: ant-junit +BuildRequires: maven-surefire-provider-junit +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 @@ -39,6 +43,7 @@ This package contains the API documentation for %{name}. %patch0 -p1 %patch1 %patch2 +%patch3 -p1 %build pushd runtime-decompiler @@ -47,7 +52,7 @@ pushd runtime-decompiler %pom_remove_plugin :maven-jar-plugin popd export JAVA_TOOL_OPTIONS="-Dadditionalparam=-Xdoclint:none -DadditionalJOption=-Xdoclint:none" -%mvn_build +%mvn_build -f %install %mvn_install diff --git a/remove_rsyntaxtextarea.patch b/remove_rsyntaxtextarea.patch index 66d7af1..a68d62c 100644 --- a/remove_rsyntaxtextarea.patch +++ b/remove_rsyntaxtextarea.patch @@ -2,20 +2,43 @@ diff --git a/runtime-decompiler/pom.xml b/runtime-decompiler/pom.xml index 26a416e..e6e2425 100644 --- a/runtime-decompiler/pom.xml +++ b/runtime-decompiler/pom.xml -@@ -100,11 +100,11 @@ +@@ -131,11 +131,6 @@ system ${java.home}/../lib/tools.jar - -+ org.jboss.byteman byteman-install +@@ -144,24 +139,6 @@ + + + +- +- org.junit.jupiter +- junit-jupiter-api +- 5.5.0 +- test +- +- +- org.junit.jupiter +- junit-jupiter-params +- 5.5.0 +- test +- +- +- org.junit.jupiter +- junit-jupiter-engine +- 5.5.0 +- test +- + + + 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/MainFrame/BytecodeDecompilerView.java From c60515c87c18a492f8874fe1126347446c132888 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 3 Sep 2019 15:11:43 +0200 Subject: [PATCH 10/15] Enabled procyon --- java-runtime-decompiler.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 8be33f7..54bb8f8 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: 2%{?dist} License: GPLv3 URL: https://github.com/pmikova/java-runtime-decompiler Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz @@ -26,7 +26,7 @@ BuildRequires: google-gson BuildRequires: desktop-file-utils Requires: java-devel = 1:1.8.0 Requires: fernflower -#Requires: procyon-decompiler +Requires: procyon-decompiler %description This application can access JVM memory at runtime, @@ -88,6 +88,9 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog +* Wed Sep 03 2019 Jiri Vanek - 3.0-2 +- Enabled procyon + * Thu Jan 17 2019 Jiri Vanek - 2.0-5 - improved Patch3, includeLambdas.patch to sort the lamdas t the bottom - disabled doclint, remove invlaid src character From afbe812d956be42ca6801deee239063ee3d2cc8e Mon Sep 17 00:00:00 2001 From: Jiri Date: Mon, 9 Aug 2021 18:42:34 +0200 Subject: [PATCH 11/15] Bump to 5.0 --- .gitignore | 3 + fixDoclint.patch | 4 +- java-runtime-decompiler | 6 +- java-runtime-decompiler.1 | 32 ----------- java-runtime-decompiler.spec | 104 +++++++++++++++++++++++++++-------- remove_rsyntaxtextarea.patch | 101 +++++++++++++++++----------------- sources | 2 +- systemCfr.patch | 14 +++++ systemFernflower.patch | 9 ++- systemJasm.patch | 14 +++++ systemJcoder.patch | 14 +++++ systemProcyon.patch | 9 ++- 12 files changed, 192 insertions(+), 120 deletions(-) delete mode 100644 java-runtime-decompiler.1 create mode 100644 systemCfr.patch create mode 100644 systemJasm.patch create mode 100644 systemJcoder.patch diff --git a/.gitignore b/.gitignore index f4ee33b..caba84a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /java-runtime-decompiler-2.0.tar.gz /java-runtime-decompiler-3.0.tar.gz +/java-runtime-decompiler-4.0.tar.gz +/java-runtime-decompiler-5.0.beta2.tar.gz +/java-runtime-decompiler-5.0.rc1.tar.gz diff --git a/fixDoclint.patch b/fixDoclint.patch index bdd46dc..f863abb 100644 --- a/fixDoclint.patch +++ b/fixDoclint.patch @@ -1,7 +1,7 @@ diff --git a/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java b/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java index 86f9a87..18dce1a 100644 ---- a/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java -+++ b/runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java +--- runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java ++++ runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/MainFrameView.java @@ -174,11 +174,11 @@ public class MainFrameView { welcomeJTextArea = new JTextArea(9, 40); welcomeJTextArea.setText("Welcome to Java-Runtime-Decompiler\n" + diff --git a/java-runtime-decompiler b/java-runtime-decompiler index 0d14213..f6dfc13 100644 --- a/java-runtime-decompiler +++ b/java-runtime-decompiler @@ -41,7 +41,7 @@ _set_java_home set_jvm # all dependencies must be on classpath -set_classpath java-runtime-decompiler byteman google-gson +set_classpath java-runtime-decompiler byteman google-gson classpathless-compiler CLASSPATH=$CLASSPATH:${JAVA_HOME}/lib/tools.jar # set path to agent automatically @@ -82,5 +82,5 @@ 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" >&2 fi -run "$@" - +export FLAGS="$FLAGS -Djdk.attach.allowAttachSelf=true" +run "$@" diff --git a/java-runtime-decompiler.1 b/java-runtime-decompiler.1 deleted file mode 100644 index eb2cddd..0000000 --- a/java-runtime-decompiler.1 +++ /dev/null @@ -1,32 +0,0 @@ -.TH java-runtime-decompiler 1 "26 August 2019" "version 3.0" -.SH NAME -java-runtime-decompiler \- launch java-runtime decompiler GUI -.SH SYNOPSIS -java-runtime-decompiler -.SH DESCRIPTION -It is used for extraction of bytecode from running JVM and decompilation of the bytecode with an external decompiler. Paths to the decompiler need to be specified in .json configuration file located in /etc/java-runtime-decompiler -.SH OPTIONS -.IP -verbose -Print out all exceptions and debugging strings in stdout. -.IP -help -Print out help and exits. -.IP -listjvms -List available local JVMs. -.IP -listplugins -List currently configured plugins with their status. -.IP "-listclasses pid-xor-url" -List loaded classes from JVM with given PID/URL. -.IP "-bytes pid class-name" -Print on stdout binary form of given class loaded in JVM with given PID/URL. -.IP "-base64bytes pid-xor-url class-name" -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 54bb8f8..1961a15 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -1,17 +1,20 @@ Summary: Application for extraction and decompilation of JVM byte code Name: java-runtime-decompiler -Version: 3.0 +Version: 5.0.rc1 Release: 2%{?dist} License: GPLv3 URL: https://github.com/pmikova/java-runtime-decompiler Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz Source1: java-runtime-decompiler -Source2: java-runtime-decompiler.1 Source3: jrd.desktop Patch0: remove_rsyntaxtextarea.patch Patch1: systemFernflower.patch Patch2: systemProcyon.patch -Patch3: fixDoclint.patch +Patch4: systemCfr.patch +Patch5: systemJasm.patch +Patch6: systemJcoder.patch + + BuildArch: noarch BuildRequires: maven-local BuildRequires: byteman @@ -20,17 +23,22 @@ BuildRequires: ant-junit BuildRequires: maven-surefire-provider-junit BuildRequires: maven-surefire BuildRequires: maven-surefire-plugin -# depends on devel, not runtime (needs tools.jar) -BuildRequires: java-devel = 1:1.8.0 +BuildRequires: java-11-devel BuildRequires: google-gson BuildRequires: desktop-file-utils -Requires: java-devel = 1:1.8.0 -Requires: fernflower -Requires: procyon-decompiler +BuildRequires: classpathless-compiler +Requires: java-11-openjdk-headless +Recommends: java-11-openjdk +Requires: classpathless-compiler +Recommends: fernflower +Recommends: procyon-decompiler +Recommends: CFR +Recommends: openjdk-asmtools %description This application can access JVM memory at runtime, extract byte code from the JVM and decompile it. + %package javadoc Summary: Javadoc for %{name} Requires: %{name} = %{version}-%{release} @@ -40,24 +48,26 @@ This package contains the API documentation for %{name}. %prep %setup -q -n %{name}-%{name}-%{version} -%patch0 -p1 -%patch1 -%patch2 -%patch3 -p1 +%patch0 -p0 +%patch1 -p0 +%patch2 -p0 +%patch4 -p0 +%patch5 -p0 +%patch6 -p0 %build pushd runtime-decompiler -%pom_remove_dep com.sun:tools -%pom_add_dep com.sun:tools %pom_remove_plugin :maven-jar-plugin popd export JAVA_TOOL_OPTIONS="-Dadditionalparam=-Xdoclint:none -DadditionalJOption=-Xdoclint:none" +export JAVA_HOME=/usr/lib/jvm/java-11-openjdk %mvn_build -f +java -cp /usr/share/java/classpathless-compiler/classpathless-compiler.jar:runtime-decompiler/target/runtime-decompiler-5.0-SNAPSHOT.jar org.jrd.backend.data.Help > %{name}.1 %install %mvn_install install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1/ -install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1/ +install -m 644 %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/ install -d -m 755 $RPM_BUILD_ROOT%{_bindir} install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/ @@ -71,7 +81,6 @@ desktop-file-install --vendor="fedora" \ %files -f .mfiles %attr(755, root, -) %{_bindir}/java-runtime-decompiler %{_mandir}/man1/java-runtime-decompiler.1* - # wrappers for decompilers %dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}/plugins @@ -79,6 +88,12 @@ desktop-file-install --vendor="fedora" \ %config(noreplace) %{_sysconfdir}/%{name}/plugins/FernflowerDecompilerWrapper.json %config %{_sysconfdir}/%{name}/plugins/ProcyonDecompilerWrapper.java %config(noreplace) %{_sysconfdir}/%{name}/plugins/ProcyonDecompilerWrapper.json +%config %{_sysconfdir}/%{name}/plugins/CfrDecompilerWrapper.java +%config(noreplace) %{_sysconfdir}/%{name}/plugins/CfrDecompilerWrapper.json +%config %{_sysconfdir}/%{name}/plugins/JasmDecompilerWrapper.java +%config(noreplace) %{_sysconfdir}/%{name}/plugins/JasmDecompilerWrapper.json +%config %{_sysconfdir}/%{name}/plugins/JcoderDecompilerWrapper.java +%config(noreplace) %{_sysconfdir}/%{name}/plugins/JcoderDecompilerWrapper.json %license LICENSE %dir %{_datadir}/applications @@ -88,12 +103,59 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog -* Wed Sep 03 2019 Jiri Vanek - 3.0-2 -- Enabled procyon +* Mon Aug 09 2021 Fedora Release Engineering - 5.0.rc1-1 +- adapted manpage + +* Mon Aug 02 2021 Fedora Release Engineering - 5.0.beta2-1 +- updated to 5.0 +- removed jdk8 subpkg due to compiler api +- added Cfr and asmtools plugins +- todo man page + +* Thu Jul 22 2021 Fedora Release Engineering - 4.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Dec 08 2020 Jiri Vanek - 4.0-2 +- Added subpackage built by jdk8 to allow looking into jdk8 apps +- for some reason, jdk8 vm can not look into jdk11 vm, even if agent is correctly jdk8 version +- the config is still share, which is stupid, but I doubt there is another target audeince then me + +* Tue Dec 08 2020 Jiri Vanek - 4.0-1 +- built by jdk11 + +* Tue Jul 28 2020 Fedora Release Engineering - 3.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jul 10 2020 Jiri Vanek - 3.0-8 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Tue Mar 17 2020 Jiri Vanek - 3.0-7 +- aligned rsyntaxtextarea version, fixed javadoc generation + +* Tue Mar 17 2020 Jiri Vanek - 3.0-6 +- changed jdk8 requirement + +* Wed Jan 29 2020 Fedora Release Engineering - 3.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* 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 + +* Thu Jul 25 2019 Fedora Release Engineering - 2.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 2.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Thu Jan 17 2019 Jiri Vanek - 2.0-5 - improved Patch3, includeLambdas.patch to sort the lamdas t the bottom -- disabled doclint, remove invlaid src character * Thu Jan 17 2019 Jiri Vanek - 2.0-4 - added depndence of procyon decompiler (currenlty under review @@ -104,10 +166,6 @@ desktop-file-install --vendor="fedora" \ - added depndence of fernflower decompiler - added and applied Patch1, systemFernflower.patch to enable system fernflower -* Mon Dec 3 2018 Petra Mikova - 2.0-3 -- patch to remove rsyntaxtextarea, because rhel does not have the package(guilty is jvanek, sorry) -- removed from spec and runscript accordingly - * Wed Nov 28 2018 Petra Mikova - 2.0-2 - fixed changelog diff --git a/remove_rsyntaxtextarea.patch b/remove_rsyntaxtextarea.patch index a68d62c..76c0671 100644 --- a/remove_rsyntaxtextarea.patch +++ b/remove_rsyntaxtextarea.patch @@ -1,73 +1,52 @@ diff --git a/runtime-decompiler/pom.xml b/runtime-decompiler/pom.xml index 26a416e..e6e2425 100644 ---- a/runtime-decompiler/pom.xml -+++ b/runtime-decompiler/pom.xml -@@ -131,11 +131,6 @@ - system - ${java.home}/../lib/tools.jar - +--- runtime-decompiler/pom.xml ++++ runtime-decompiler/pom.xml +@@ -157,11 +157,6 @@ + directories + 10 + --> - - com.fifesoft - rsyntaxtextarea -- 2.6.1 +- 3.1.2 - org.jboss.byteman byteman-install -@@ -144,24 +139,6 @@ - - - -- -- org.junit.jupiter -- junit-jupiter-api -- 5.5.0 -- test -- -- -- org.junit.jupiter -- junit-jupiter-params -- 5.5.0 -- test -- -- -- org.junit.jupiter -- junit-jupiter-engine -- 5.5.0 -- test -- - - - 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/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; - import org.jrd.backend.decompiling.DecompilerWrapperInformation; +--- runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/BytecodeDecompilerView.java ++++ runtime-decompiler/src/main/java/org/jrd/frontend/MainFrame/BytecodeDecompilerView.java +@@ -4,11 +4,11 @@ import org.fife.ui.hex.event.HexSearchActionListener; + import org.fife.ui.hex.event.HexSearchDocumentListener; + import org.fife.ui.hex.swing.HexEditor; + import org.fife.ui.hex.swing.HexSearch; -import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; -import org.fife.ui.rsyntaxtextarea.SyntaxConstants; -import org.fife.ui.rtextarea.RTextScrollPane; +-import org.fife.ui.rtextarea.SearchContext; +-import org.fife.ui.rtextarea.SearchEngine; +//import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; +//import org.fife.ui.rsyntaxtextarea.SyntaxConstants; +//import org.fife.ui.rtextarea.RTextScrollPane; ++//import org.fife.ui.rtextarea.SearchContext; ++//import org.fife.ui.rtextarea.SearchEngine; + import org.jrd.backend.core.OutputController; + import org.jrd.backend.decompiling.DecompilerWrapperInformation; - import javax.swing.*; - import javax.swing.border.EtchedBorder; -@@ -30,8 +30,8 @@ public class BytecodeDecompilerView { - private JPanel rightMainPanel; +@@ -52,8 +52,8 @@ public class BytecodeDecompilerView { + private JPanel rightBin; private JScrollPane leftScrollPanel; private JList filteredClassesJlist; - private RTextScrollPane bytecodeScrollPane; - private RSyntaxTextArea bytecodeSyntaxTextArea; + private JScrollPane bytecodeScrollPane; + private JTextArea bytecodeSyntaxTextArea; - private ActionListener bytesActionListener; - private ActionListener classesActionListener; - private ActionListener rewriteActionListener; -@@ -147,10 +147,10 @@ public class BytecodeDecompilerView { + private HexEditor hex; + private JPanel hexControls; + private String lastDecompiledClass = ""; +@@ -198,10 +198,10 @@ public class BytecodeDecompilerView { } }); @@ -80,6 +59,30 @@ index 9c19e2c..8d17775 100644 + //bytecodeSyntaxTextArea.setCodeFoldingEnabled(true); + bytecodeScrollPane = new JScrollPane(bytecodeSyntaxTextArea); - leftMainPanel = new JPanel(); - leftMainPanel.setLayout(new BorderLayout()); - + hex = new HexEditor(); + hexControls = new JPanel(); +@@ -410,15 +410,15 @@ public class BytecodeDecompilerView { + * Search string in decompiled code + */ + private void searchCode() { +- SearchContext context = new SearchContext(); +- String match = searchCodeField.getText(); +- context.setSearchFor(match); +- context.setWholeWord(false); +- SearchEngine.markAll(bytecodeSyntaxTextArea, context); +- int line = SearchEngine.getNextMatchPos(match, bytecodeSyntaxTextArea.getText(), true, true, false); +- if (line >= 0) { +- bytecodeSyntaxTextArea.setCaretPosition(line); +- } ++// SearchContext context = new SearchContext(); ++// String match = searchCodeField.getText(); ++// context.setSearchFor(match); ++// context.setWholeWord(false); ++// SearchEngine.markAll(bytecodeSyntaxTextArea, context); ++// int line = SearchEngine.getNextMatchPos(match, bytecodeSyntaxTextArea.getText(), true, true, false); ++// if (line >= 0) { ++// bytecodeSyntaxTextArea.setCaretPosition(line); ++// } + } + + private void classWorker(String name) { diff --git a/sources b/sources index d54d342..0958208 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (java-runtime-decompiler-3.0.tar.gz) = 329184689763b7777ef0bad1c0f787aa649f855692b52bd843cacd424d5d2c0caadad328f80cd7f229031a151b6414c712bd770abd285412055c5d34d932875c +SHA512 (java-runtime-decompiler-5.0.rc1.tar.gz) = c864e4847d83a25d241811cec9afe26b7c600e7f57f7c141ce85490936f414385d11334f20fb787fe32e65edb6e6fbf8028e2ca346f00ac6bfd716d6b4328576 diff --git a/systemCfr.patch b/systemCfr.patch new file mode 100644 index 0000000..2a0a77d --- /dev/null +++ b/systemCfr.patch @@ -0,0 +1,14 @@ +--- runtime-decompiler/src/plugins/CfrDecompilerWrapper.json ++++ runtime-decompiler/src/plugins/CfrDecompilerWrapper.json +@@ -1,8 +1,8 @@ + { + "Name": "Cfr", +- "WrapperURL": "file://${XDG_CONFIG_HOME}/plugins/CfrDecompilerWrapper.java", ++ "WrapperURL": "file:/etc/java-runtime-decompiler/plugins/CfrDecompilerWrapper.java", + "DependencyURL": [ +- "file://${HOME}/.m2/repository/org/benf/cfr/0.151/cfr-0.151.jar" ++ "file:/usr/share/java/CFR/cfr.jar" + ], + "DecompilerDownloadURL": "https://www.benf.org/other/cfr/faq.html" + } + diff --git a/systemFernflower.patch b/systemFernflower.patch index ecb8d07..b179e10 100644 --- a/systemFernflower.patch +++ b/systemFernflower.patch @@ -4,13 +4,12 @@ { "Name": "Fernflower", - "WrapperURL": "file://${XDG_CONFIG_HOME}/plugins/FernflowerDecompilerWrapper.java", -+ "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/FernflowerDecompilerWrapper.java", ++ "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/FernflowerDecompilerWrapper.java", "DependencyURL": [ -- "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/decompiler-fernflower/5.1.4.Final/decompiler-fernflower-5.1.4.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" --} -\ No newline at end of file -+} + } + diff --git a/systemJasm.patch b/systemJasm.patch new file mode 100644 index 0000000..b5099af --- /dev/null +++ b/systemJasm.patch @@ -0,0 +1,14 @@ +--- runtime-decompiler/src/plugins/JasmDecompilerWrapper.json 2018-11-12 15:25:47.000000000 +0100 ++++ runtime-decompiler/src/plugins/JasmDecompilerWrapper.json 2019-01-16 12:13:37.317778036 +0100 +@@ -1,8 +1,8 @@ + { + "Name": "jasm", +- "WrapperURL": "file://${XDG_CONFIG_HOME}/plugins/JasmDecompilerWrapper.java", ++ "WrapperURL": "file:/etc/java-runtime-decompiler/plugins/JasmDecompilerWrapper.java", + "DependencyURL": [ +- "file://${HOME}/.m2/repository/org/openjdk/asmtools/asmtools-core/7.0.b10-ea/asmtools-core-7.0.b10-ea.jar" ++ "file:/usr/share/java/openjdk-asmtools/asmtools-core.jar" + ], + "DecompilerDownloadURL": "https://github.com/openjdk/asmtools" + } + diff --git a/systemJcoder.patch b/systemJcoder.patch new file mode 100644 index 0000000..1454b9e --- /dev/null +++ b/systemJcoder.patch @@ -0,0 +1,14 @@ +--- runtime-decompiler/src/plugins/JcoderDecompilerWrapper.json 2018-11-12 15:25:47.000000000 +0100 ++++ runtime-decompiler/src/plugins/JcoderDecompilerWrapper.json 2019-01-16 12:13:37.317778036 +0100 +@@ -1,8 +1,8 @@ + { + "Name": "jcoder", +- "WrapperURL": "file://${XDG_CONFIG_HOME}/plugins/JcoderDecompilerWrapper.java", ++ "WrapperURL": "file:/etc/java-runtime-decompiler/plugins/JcoderDecompilerWrapper.java", + "DependencyURL": [ +- "file://${HOME}/.m2/repository/org/openjdk/asmtools/7.0.b10-ea/asmtools-core-7.0.b10-ea.jar" ++ "file:/usr/share/java/openjdk-asmtools/asmtools-core.jar" + ], + "DecompilerDownloadURL": "https://github.com/openjdk/asmtools" + } + diff --git a/systemProcyon.patch b/systemProcyon.patch index 1581df9..342a998 100644 --- a/systemProcyon.patch +++ b/systemProcyon.patch @@ -6,13 +6,12 @@ - "WrapperURL": "file://${XDG_CONFIG_HOME}/plugins/ProcyonDecompilerWrapper.java", + "WrapperURL": "file:///etc/java-runtime-decompiler/plugins/ProcyonDecompilerWrapper.java", "DependencyURL": [ -- "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" +- "file://${HOME}/.m2/repository/org/bitbucket/mstrobel/procyon-core/0.5.36/procyon-core-0.5.36.jar", +- "file://${HOME}/.m2/repository/org/bitbucket/mstrobel/procyon-compilertools/0.5.36/procyon-compilertools-0.5.36.jar" + "/usr/share/java/procyon/procyon-core.jar", + "/usr/share/java/procyon/procyon-compilertools.jar", + "/usr/share/java/procyon/procyon-decompiler.jar" ], "DecompilerDownloadURL": "https://bitbucket.org/mstrobel/procyon/downloads/" --} -\ No newline at end of file -+} + } + From 83ce04b650f3f31155fa8683abedb74c96c708e2 Mon Sep 17 00:00:00 2001 From: Jiri Date: Mon, 9 Aug 2021 18:51:42 +0200 Subject: [PATCH 12/15] Removed soft requirement --- java-runtime-decompiler.spec | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 1961a15..8e3abfe 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -28,12 +28,11 @@ BuildRequires: google-gson BuildRequires: desktop-file-utils BuildRequires: classpathless-compiler Requires: java-11-openjdk-headless -Recommends: java-11-openjdk Requires: classpathless-compiler -Recommends: fernflower -Recommends: procyon-decompiler -Recommends: CFR -Recommends: openjdk-asmtools +Requires: fernflower +Requires: procyon-decompiler +Requires: CFR +Requires: openjdk-asmtools %description This application can access JVM memory at runtime, From 38a9524bcc9aa74028b35632443d83f07aaecf60 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 12 Aug 2021 17:40:21 +0200 Subject: [PATCH 13/15] bumped to final sources --- .gitignore | 1 + java-runtime-decompiler.spec | 9 ++++++--- sources | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index caba84a..1bb0ab1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /java-runtime-decompiler-4.0.tar.gz /java-runtime-decompiler-5.0.beta2.tar.gz /java-runtime-decompiler-5.0.rc1.tar.gz +/java-runtime-decompiler-5.1.tar.gz diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 8e3abfe..28110e5 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: 5.0.rc1 -Release: 2%{?dist} +Version: 5.1 +Release: 1%{?dist} License: GPLv3 URL: https://github.com/pmikova/java-runtime-decompiler Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz @@ -61,7 +61,7 @@ popd export JAVA_TOOL_OPTIONS="-Dadditionalparam=-Xdoclint:none -DadditionalJOption=-Xdoclint:none" export JAVA_HOME=/usr/lib/jvm/java-11-openjdk %mvn_build -f -java -cp /usr/share/java/classpathless-compiler/classpathless-compiler.jar:runtime-decompiler/target/runtime-decompiler-5.0-SNAPSHOT.jar org.jrd.backend.data.Help > %{name}.1 +java -cp /usr/share/java/classpathless-compiler/classpathless-compiler.jar:runtime-decompiler/target/runtime-decompiler-%{version}.jar org.jrd.backend.data.Help > %{name}.1 %install %mvn_install @@ -102,6 +102,9 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog +* Thu Aug 12 2021 Fedora Release Engineering - 5.1-1 +- bumped to final sources + * Mon Aug 09 2021 Fedora Release Engineering - 5.0.rc1-1 - adapted manpage diff --git a/sources b/sources index 0958208..12c4568 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (java-runtime-decompiler-5.0.rc1.tar.gz) = c864e4847d83a25d241811cec9afe26b7c600e7f57f7c141ce85490936f414385d11334f20fb787fe32e65edb6e6fbf8028e2ca346f00ac6bfd716d6b4328576 +SHA512 (java-runtime-decompiler-5.1.tar.gz) = 0a1e644696c7fc0595a9b4ca05ef1f392a78e5a6bb6e9631ede8a93776740ae8cf65ced0cfaacd7890985ee659e41947bcf17a87d7bc3ba5958ae84a943b64d9 From 029cc40cd95e24a1580a78b8ce2548e0876ecca9 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 12 Aug 2021 17:50:44 +0200 Subject: [PATCH 14/15] Now calling jdk11 to generate man page --- java-runtime-decompiler.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 28110e5..8cf55ea 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -61,7 +61,7 @@ popd export JAVA_TOOL_OPTIONS="-Dadditionalparam=-Xdoclint:none -DadditionalJOption=-Xdoclint:none" export JAVA_HOME=/usr/lib/jvm/java-11-openjdk %mvn_build -f -java -cp /usr/share/java/classpathless-compiler/classpathless-compiler.jar:runtime-decompiler/target/runtime-decompiler-%{version}.jar org.jrd.backend.data.Help > %{name}.1 +$JAVA_HOME/bin/java -cp /usr/share/java/classpathless-compiler/classpathless-compiler.jar:runtime-decompiler/target/runtime-decompiler-%{version}.jar org.jrd.backend.data.Help > %{name}.1 %install %mvn_install From e4c6fef5c9e462f21fc6478d55503fa0e2a0ef2f Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 16 Aug 2021 13:07:27 +0200 Subject: [PATCH 15/15] Excluded tool.jar from transitive byteman dep --- excludeTrasnitiveTools.patch | 16 ++++++++++++++++ java-runtime-decompiler.spec | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 excludeTrasnitiveTools.patch diff --git a/excludeTrasnitiveTools.patch b/excludeTrasnitiveTools.patch new file mode 100644 index 0000000..396eb8d --- /dev/null +++ b/excludeTrasnitiveTools.patch @@ -0,0 +1,16 @@ +--- runtime-decompiler/pom.xml ++++ runtime-decompiler/pom.xml +@@ -163,6 +163,12 @@ + byteman-install + 4.0.15 + jar ++ ++ ++ com.sun ++ tools ++ ++ + + + + diff --git a/java-runtime-decompiler.spec b/java-runtime-decompiler.spec index 8cf55ea..bff8f12 100644 --- a/java-runtime-decompiler.spec +++ b/java-runtime-decompiler.spec @@ -13,6 +13,8 @@ Patch2: systemProcyon.patch Patch4: systemCfr.patch Patch5: systemJasm.patch Patch6: systemJcoder.patch +#to fix issue, when byteman requires tools.jar +Patch7: excludeTrasnitiveTools.patch BuildArch: noarch @@ -23,7 +25,7 @@ BuildRequires: ant-junit BuildRequires: maven-surefire-provider-junit BuildRequires: maven-surefire BuildRequires: maven-surefire-plugin -BuildRequires: java-11-devel +BuildRequires: java-11-openjdk-devel BuildRequires: google-gson BuildRequires: desktop-file-utils BuildRequires: classpathless-compiler @@ -53,6 +55,7 @@ This package contains the API documentation for %{name}. %patch4 -p0 %patch5 -p0 %patch6 -p0 +%patch7 -p0 %build pushd runtime-decompiler