updated to 6.1
Sync with fedora
This commit is contained in:
parent
aeb9c030dc
commit
b95081725a
9 changed files with 105 additions and 120 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -4,3 +4,7 @@
|
|||
/java-runtime-decompiler-5.0.beta2.tar.gz
|
||||
/java-runtime-decompiler-5.0.rc1.tar.gz
|
||||
/java-runtime-decompiler-5.1.tar.gz
|
||||
/java-runtime-decompiler-6.0.0.pre.1.tar.gz
|
||||
/java-runtime-decompiler-6.0.0.pre.2.tar.gz
|
||||
/java-runtime-decompiler-6.0.0.pre.3.tar.gz
|
||||
/java-runtime-decompiler-6.1.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
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
|
||||
--- 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" +
|
||||
"\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);
|
||||
|
||||
|
|
@ -7,6 +7,15 @@
|
|||
|
||||
. /usr/share/java-utils/java-functions
|
||||
|
||||
echo $@ | grep -q -e "-verbose"
|
||||
verbose=$?
|
||||
|
||||
function warning() {
|
||||
if [ $verbose -eq 0 ] ; then
|
||||
echo ${1} >&2
|
||||
fi
|
||||
}
|
||||
|
||||
# identify directory tree
|
||||
JRD=`basename $0`
|
||||
CONF_HOME=$XDG_CONFIG_HOME
|
||||
|
|
@ -41,7 +50,7 @@ _set_java_home
|
|||
set_jvm
|
||||
|
||||
# all dependencies must be on classpath
|
||||
set_classpath java-runtime-decompiler byteman google-gson classpathless-compiler
|
||||
set_classpath java-runtime-decompiler rsyntaxtextarea byteman google-gson classpathless-compiler objectweb-asm
|
||||
CLASSPATH=$CLASSPATH:${JAVA_HOME}/lib/tools.jar
|
||||
|
||||
# set path to agent automatically
|
||||
|
|
@ -58,7 +67,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." >&2
|
||||
warning "Configuration files were not copied for $FILE_NAME - the existing configuration would be overwritten."
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -69,11 +78,11 @@ 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." >&2
|
||||
warning "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." >&2
|
||||
warning "Agent path is already set in $CONFIG_FILE as ${RESULT_OF_GREP}. Skipping agent path setting."
|
||||
else
|
||||
echo $AGENT_STRING >> $CONFIG_FILE
|
||||
|
||||
|
|
@ -82,5 +91,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
|
||||
|
||||
export FLAGS="$FLAGS -Djdk.attach.allowAttachSelf=true"
|
||||
export FLAGS="$FLAGS -Djdk.attach.allowAttachSelf=true --add-exports jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED" # jdk11+ do not allow attach by default; jdk17 is hiding javap api
|
||||
run "$@"
|
||||
|
|
|
|||
|
|
@ -1,28 +1,33 @@
|
|||
Summary: Application for extraction and decompilation of JVM byte code
|
||||
Name: java-runtime-decompiler
|
||||
Version: 5.1
|
||||
Version: 6.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
|
||||
Source1: java-runtime-decompiler
|
||||
Source3: jrd.desktop
|
||||
Patch0: remove_rsyntaxtextarea.patch
|
||||
Patch1: systemFernflower.patch
|
||||
Patch2: systemProcyon.patch
|
||||
Patch3: rsyntaxVersion.patch
|
||||
Patch4: systemCfr.patch
|
||||
Patch5: systemJasm.patch
|
||||
Patch6: systemJcoder.patch
|
||||
|
||||
Patch7: removeMultilineSpotbugs.patch
|
||||
|
||||
BuildArch: noarch
|
||||
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
|
||||
BuildRequires: maven-clean-plugin
|
||||
BuildRequires: java-11-devel
|
||||
BuildRequires: google-gson
|
||||
BuildRequires: desktop-file-utils
|
||||
|
|
@ -48,20 +53,32 @@ This package contains the API documentation for %{name}.
|
|||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{name}-%{version}
|
||||
%patch0 -p0
|
||||
%patch1 -p0
|
||||
%patch2 -p0
|
||||
%patch3 -p0
|
||||
%patch4 -p0
|
||||
%patch5 -p0
|
||||
%patch6 -p0
|
||||
%patch7 -p1
|
||||
|
||||
%build
|
||||
pushd runtime-decompiler
|
||||
%pom_remove_plugin :maven-jar-plugin
|
||||
popd
|
||||
export JAVA_TOOL_OPTIONS="-Dadditionalparam=-Xdoclint:none -DadditionalJOption=-Xdoclint:none"
|
||||
%pom_remove_plugin :spotbugs-maven-plugin
|
||||
%pom_remove_plugin :maven-checkstyle-plugin
|
||||
%pom_remove_plugin :formatter-maven-plugin
|
||||
%pom_remove_dep :spotbugs-annotations
|
||||
a=`find | grep ".*\.java$"`
|
||||
for x in $a ; do
|
||||
#grep -e ".*SuppressFBWarnings.*" $x && echo "^ $x ^"
|
||||
sed "s/.*SuppressFBWarnings.*//g" $x -i
|
||||
done
|
||||
|
||||
#export JAVA_TOOL_OPTIONS="-Dadditionalparam=-Xdoclint:none -DadditionalJOption=-Xdoclint:none"
|
||||
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
|
||||
%mvn_build -f
|
||||
|
||||
%mvn_build -f --xmvn-javadoc -- -Plegacy
|
||||
$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
|
||||
|
|
@ -103,6 +120,17 @@ desktop-file-install --vendor="fedora" \
|
|||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
* Sun Dec 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0.pre.3-1
|
||||
- bumped sources to upstream rc candidate
|
||||
|
||||
* Sun Dec 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0.pre.2-1
|
||||
- bumped sources to upstream pre release
|
||||
|
||||
* Thu Aug 12 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0.pre.1-1
|
||||
- umped sources to upstream pre release
|
||||
- adapted jcoder plugin
|
||||
- todo, patch for removed plugins
|
||||
|
||||
* Thu Aug 12 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.1-1
|
||||
- bumped to final sources
|
||||
|
||||
|
|
|
|||
39
removeMultilineSpotbugs.patch
Normal file
39
removeMultilineSpotbugs.patch
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
--- a/runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java
|
||||
+++ a/runtime-decompiler/src/main/java/org/jrd/backend/core/XDecompilerRequestReceiver.java
|
||||
@@ -262,10 +262,6 @@
|
||||
private static class ClassesComparator implements Comparator<ClassInfo>, Serializable {
|
||||
|
||||
@SuppressWarnings({"ReturnCount", "CyclomaticComplexity"}) // comparator syntax
|
||||
- @SuppressFBWarnings(
|
||||
- value = "NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE",
|
||||
- justification = "False report of possible NP dereference, despite testing both o1 & o2 for nullness."
|
||||
- )
|
||||
@Override
|
||||
public int compare(ClassInfo c1, ClassInfo c2) {
|
||||
if (c1 == null && c2 == null) {
|
||||
--- a/runtime-decompiler/src/main/java/org/jrd/backend/data/VmInfo.java
|
||||
+++ a/runtime-decompiler/src/main/java/org/jrd/backend/data/XVmInfo.java
|
||||
@@ -112,10 +112,6 @@
|
||||
this.type = local;
|
||||
}
|
||||
|
||||
- @SuppressFBWarnings(
|
||||
- value = "NP_LOAD_OF_KNOWN_NULL_VALUE",
|
||||
- justification = "Classpath is only used for FS VMs, in other cases getCp() does not get called"
|
||||
- )
|
||||
public void setCp(List<File> cp) {
|
||||
if (cp == null) {
|
||||
this.cp = null;
|
||||
--- a/runtime-decompiler/src/test/java/org/jrd/frontend/frame/plugins/FileSelectorArrayRowTest.java
|
||||
+++ a/runtime-decompiler/src/test/java/org/jrd/frontend/frame/plugins/XFileSelectorArrayRowTest.java
|
||||
@@ -11,9 +11,6 @@
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
-@SuppressFBWarnings(
|
||||
- value = "DMI_HARDCODED_ABSOLUTE_FILENAME", justification = "Hardcoded paths aren't used for manipulating with an actual filesystem."
|
||||
-)
|
||||
class FileSelectorArrayRowTest {
|
||||
@BeforeAll
|
||||
static void setup() {
|
||||
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
diff --git a/runtime-decompiler/pom.xml b/runtime-decompiler/pom.xml
|
||||
index 26a416e..e6e2425 100644
|
||||
--- runtime-decompiler/pom.xml
|
||||
+++ runtime-decompiler/pom.xml
|
||||
@@ -157,11 +157,6 @@
|
||||
<artifactId>directories</artifactId>
|
||||
<version>10</version>
|
||||
</dependency>-->
|
||||
- <dependency>
|
||||
- <groupId>com.fifesoft</groupId>
|
||||
- <artifactId>rsyntaxtextarea</artifactId>
|
||||
- <version>3.1.2</version>
|
||||
- </dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.byteman</groupId>
|
||||
<artifactId>byteman-install</artifactId>
|
||||
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
|
||||
--- 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;
|
||||
|
||||
@@ -52,8 +52,8 @@ public class BytecodeDecompilerView {
|
||||
private JPanel rightBin;
|
||||
private JScrollPane leftScrollPanel;
|
||||
private JList<String> filteredClassesJlist;
|
||||
- private RTextScrollPane bytecodeScrollPane;
|
||||
- private RSyntaxTextArea bytecodeSyntaxTextArea;
|
||||
+ private JScrollPane bytecodeScrollPane;
|
||||
+ private JTextArea bytecodeSyntaxTextArea;
|
||||
private HexEditor hex;
|
||||
private JPanel hexControls;
|
||||
private String lastDecompiledClass = "";
|
||||
@@ -198,10 +198,10 @@ public class BytecodeDecompilerView {
|
||||
}
|
||||
});
|
||||
|
||||
- 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);
|
||||
|
||||
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) {
|
||||
12
rsyntaxVersion.patch
Normal file
12
rsyntaxVersion.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
--- runtime-decompiler/pom.xml
|
||||
+++ runtime-decompiler/pom.xml
|
||||
@@ -134,7 +134,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fifesoft</groupId>
|
||||
<artifactId>rsyntaxtextarea</artifactId>
|
||||
- <version>3.1.2</version>
|
||||
+ <version>3.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.byteman</groupId>
|
||||
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (java-runtime-decompiler-5.1.tar.gz) = 0a1e644696c7fc0595a9b4ca05ef1f392a78e5a6bb6e9631ede8a93776740ae8cf65ced0cfaacd7890985ee659e41947bcf17a87d7bc3ba5958ae84a943b64d9
|
||||
SHA512 (java-runtime-decompiler-6.1.tar.gz) = 41bd87f0311d47819107fbd34173e4e1cebef71eb8651a337fb71a30947ffbb6bcaea6877508e0a02b0b2fcead7fe51497ed6251329a0254a8ee48220275e86f
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
- "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://${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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue