diff --git a/.gitignore b/.gitignore index f4ee33b..4b41dde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /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 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.spec b/java-runtime-decompiler.spec index d680bc7..0a078e9 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} +Version: 5.0.beta2 +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,7 +11,11 @@ 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 +24,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 +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,18 +49,19 @@ 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 %install @@ -79,6 +89,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,6 +104,41 @@ desktop-file-install --vendor="fedora" \ %license LICENSE %changelog +* Thu 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 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..4b08845 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (java-runtime-decompiler-3.0.tar.gz) = 329184689763b7777ef0bad1c0f787aa649f855692b52bd843cacd424d5d2c0caadad328f80cd7f229031a151b6414c712bd770abd285412055c5d34d932875c +SHA512 (java-runtime-decompiler-5.0.beta2.tar.gz) = 81269e4885f34227ea832c29fdc646a25f65e292ed72783c40b65ba59a1937daf021eac6c3cf2176b8b3b511e62c2ecbf5d72fb4b5f512b99ce4124d0749ba02 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 -+} + } +