diff --git a/app/src/main/groovy/org/jd/gui/view/MainView.groovy b/app/src/main/groovy/org/jd/gui/view/MainView.groovy new file mode 100644 index 00000000..c063bb6b --- /dev/null +++ b/app/src/main/groovy/org/jd/gui/view/MainView.groovy @@ -0,0 +1,331 @@ +/* + * Copyright (c) 2008-2015 Emmanuel Dupuy + * This program is made available under the terms of the GPLv3 License. + */ + +package org.jd.gui.view + +import groovy.swing.SwingBuilder +import org.jd.gui.Constants +import org.jd.gui.api.API +import org.jd.gui.api.feature.ContentSearchable +import org.jd.gui.api.feature.ContentSelectable +import org.jd.gui.api.feature.LineNumberNavigable +import org.jd.gui.api.feature.PageChangeListener +import org.jd.gui.api.feature.PageClosable +import org.jd.gui.api.feature.FocusedTypeGettable +import org.jd.gui.api.feature.ContentSavable +import org.jd.gui.api.feature.ContentCopyable +import org.jd.gui.api.feature.PreferencesChangeListener +import org.jd.gui.api.feature.SourcesSavable +import org.jd.gui.api.feature.UriGettable +import org.jd.gui.api.feature.UriOpenable +import org.jd.gui.model.configuration.Configuration +import org.jd.gui.model.history.History +import org.jd.gui.spi.FileLoader +import org.jd.gui.view.component.FileChooser + +import javax.swing.Icon +import javax.swing.JComponent +import javax.swing.JLabel +import javax.swing.event.ChangeEvent +import javax.swing.event.ChangeListener +import java.awt.Color +import java.awt.Dimension +import java.awt.Point +import javax.swing.JFileChooser +import javax.swing.JFrame +import javax.swing.JOptionPane +import javax.swing.filechooser.FileNameExtensionFilter + +import org.jd.gui.view.component.IconButton +import org.jd.gui.view.component.panel.MainTabbedPanel + +import java.awt.event.KeyAdapter +import java.awt.event.KeyEvent + +class MainView implements UriOpenable, PreferencesChangeListener { + SwingBuilder swing + History history + Closure openFilesClosure + Color findBackgroundColor + Color findErrorBackgroundColor + + MainView( + SwingBuilder swing, Configuration configuration, API api, History history, + Closure panelClosedClosure, + Closure currentPageChangedClosure, + Closure openFilesClosure, + Closure findCriteriaChangedClosure) { + this.swing = swing + this.history = history + this.openFilesClosure = openFilesClosure + + swing.edt { + // Setup + registerBeanFactory('iconButton', IconButton.class) + registerBeanFactory('mainTabbedPanel', MainTabbedPanel.class) + registerExplicitProperty('api', { api }, {}) // Used to init 'mainTabbedPanel.api' + // Load GUI description + build(MainDescription) + // Add listeners + mainTabbedPanel.pageChangedListeners.add(new PageChangeListener() { + JComponent currentPage = null + + public void pageChanged(T page) { + if (currentPage != page) { + // Update current page + currentPage = page + currentPageChangedClosure(page) + + swing.doLater { + if (page) { + // Update title + def path = page.uri.path + int index = path.lastIndexOf('/') + def name = (index == -1) ? path : path.substring(index + 1) + mainFrame.title = name ? name + ' - Java Decompiler' : 'Java Decompiler' + // Update history + history.add(page.uri) + // Update history actions + updateHistoryActions() + // Update menu + saveAction.enabled = (page instanceof ContentSavable) + copyAction.enabled = (page instanceof ContentCopyable) + selectAllAction.enabled = (page instanceof ContentSelectable) + findAction.enabled = (page instanceof ContentSearchable) + openTypeHierarchyAction.enabled = (page instanceof FocusedTypeGettable) + goToAction.enabled = (page instanceof LineNumberNavigable) + } else { + // Update title + mainFrame.title = 'Java Decompiler' + // Update menu + saveAction.enabled = false + copyAction.enabled = false + selectAllAction.enabled = false + openTypeHierarchyAction.enabled = false + goToAction.enabled = false + } + } + } + } + }) + mainTabbedPanel.tabbedPane.addChangeListener(new ChangeListener() { + int lastTabCount = 0 + + void stateChanged(ChangeEvent e) { + swing.with { + int tabCount = mainTabbedPanel.tabbedPane.tabCount + boolean enabled = (tabCount > 0) + + closeAction.enabled = enabled + openTypeAction.enabled = enabled + searchAction.enabled = enabled + saveAllSourcesAction.enabled = (mainTabbedPanel.tabbedPane.selectedComponent instanceof SourcesSavable) + + if (tabCount < lastTabCount) { + panelClosedClosure() + } + + lastTabCount = tabCount + } + } + }) + mainTabbedPanel.preferencesChanged(configuration.preferences) + findComboBox.editor.editorComponent.addKeyListener(new KeyAdapter() { + String lastStr = '' + + void keyReleased(KeyEvent e) { + def findComboBox = swing.findComboBox + + switch (e.keyCode) { + case KeyEvent.VK_ESCAPE: + swing.findPanel.visible = false + break + case KeyEvent.VK_ENTER: + def str = getFindText() + if (str.length() > 1) { + def index = findComboBox.model.getIndexOf(str) + if(index != -1 ) { + findComboBox.removeItemAt(index) + } + findComboBox.insertItemAt(str, 0) + findComboBox.selectedIndex = 0 + swing.findNextAction.closure() + } + break + default: + def str = getFindText() + if (! lastStr.equals(str)) { + findCriteriaChangedClosure() + lastStr = str + } + } + } + }) + findComboBox.editor.editorComponent.opaque = true + + this.findBackgroundColor = findComboBox.background = findComboBox.editor.editorComponent.background + this.findErrorBackgroundColor = Color.decode(configuration.preferences.get('JdGuiPreferences.errorBackgroundColor')) + } + swing.doLater { + // Lazy initialization + new JLabel('init HTML parser') + } + } + + void show(Point location, Dimension size, boolean maximize) { + swing.edt { + // Set position, resize and show + mainFrame.with { + setLocation(location) + setSize(size) + extendedState = maximize ? JFrame.MAXIMIZED_BOTH : 0 + } + mainFrame.show() + } + } + + void showFindPanel() { + swing.edt { + findPanel.visible = true + findComboBox.requestFocus() + } + } + + void setFindBackgroundColor(boolean wasFound) { + swing.doLater { + findComboBox.editor.editorComponent.background = wasFound ? findBackgroundColor : findErrorBackgroundColor + } + } + + JFileChooser createOpenFileChooser() { + FileChooser chooser = new FileChooser() { + void addFileFilters(Map loaders) { + removeChoosableFileFilter(getFileFilter()) + + def extensions = loaders.collect({ key, value -> key }).sort() + def description = extensions.collect({ "*.$it" }).join(', ') + + addChoosableFileFilter(new FileNameExtensionFilter("All files ($description)", extensions as String[])) + + for (def extension : extensions) { + def loader = loaders[extension] + addChoosableFileFilter(new FileNameExtensionFilter(loader.description, loader.extensions)) + } + } + void show(Closure okClosure) { + if (showOpenDialog(swing.mainFrame) == JFileChooser.APPROVE_OPTION) { + okClosure() + } + } + } + return chooser + } + + JFileChooser createSaveFileChooser() { + FileChooser chooser = new FileChooser() { + void show(Closure okClosure) { + if (showSaveDialog(swing.mainFrame) == JFileChooser.APPROVE_OPTION) { + if (selectedFile.exists()) { + def title = 'Are you sure?' + def message = "The file '$selectedFile.absolutePath' already isContainsIn.\n Do you want to replace the existing file?" + if (swing.optionPane().showConfirmDialog(swing.mainFrame, message, title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { + okClosure(selectedFile) + } + } else { + okClosure(selectedFile) + } + } + } + } + return chooser + } + + void showErrorDialog(String message) { + swing.optionPane().showMessageDialog(swing.mainFrame, message, 'Error', JOptionPane.ERROR_MESSAGE) + } + + public void addMainPanel(String title, Icon icon, String tip, T component) { + swing.edt { + swing.mainTabbedPanel.addPage(title, icon, tip, component) + } + } + + public List getMainPanels() { + return swing.mainTabbedPanel.getPages() + } + + public T getSelectedMainPanel() { + return swing.mainTabbedPanel.tabbedPane.getSelectedComponent() + } + + void closeCurrentTab() { + swing.doLater { + def component = mainTabbedPanel.tabbedPane.selectedComponent + if (component instanceof PageClosable) { + if (!component.closePage()) { + mainTabbedPanel.removeComponent(component) + } + } else { + mainTabbedPanel.removeComponent(component) + } + } + } + + void updateRecentFilesMenu(List files) { + swing.doLater { + recentFiles.removeAll() + files.each { f -> + recentFiles.add( + menuItem() { + action(name:reduceRecentFilePath(f.absolutePath), closure:{ openFilesClosure(f) }) + } + ) + } + } + } + + String getFindText() { + def doc = swing.findComboBox.editor.editorComponent.document + return doc.getText(0, doc.length) + } + + boolean getFindCaseSensitive() { swing.findCaseSensitive.isSelected() } + + void updateHistoryActions() { + swing.doLater { + backwardAction.enabled = history.canBackward() + forwardAction.enabled = history.canForward() + } + } + + // --- Utils --- // + static String reduceRecentFilePath(String path) { + int lastSeparatorPosition = path.lastIndexOf(File.separatorChar as int) + + if ((lastSeparatorPosition == -1) || (lastSeparatorPosition < Constants.RECENT_FILE_MAX_LENGTH)) { + return path + } + + int length = Constants.RECENT_FILE_MAX_LENGTH/2 - 2 + String left = path.substring(0, length) + String right = path.substring(path.length() - length) + + return left + "..." + right + } + + // --- URIOpener --- // + boolean openUri(URI uri) { + boolean success + swing.edt { + success = swing.mainTabbedPanel.openUri(uri) + } + return success + } + + // --- PreferencesChangeListener --- // + void preferencesChanged(Map preferences) { + swing.mainTabbedPanel.preferencesChanged(preferences) + } +} diff --git a/app/src/main/java/org/jd/gui/controller/MainController.java b/app/src/main/java/org/jd/gui/controller/MainController.java index 94b0e881..e607408f 100644 --- a/app/src/main/java/org/jd/gui/controller/MainController.java +++ b/app/src/main/java/org/jd/gui/controller/MainController.java @@ -35,6 +35,7 @@ import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileSystemView; +import org.jd.gui.view.component.FileChooser; import java.awt.*; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; @@ -155,7 +156,7 @@ public void show(List files) { // Set drop files transfer handler mainFrame.setTransferHandler(new FilesTransferHandler()); // Background class loading - new JFileChooser().addChoosableFileFilter(new FileNameExtensionFilter("", "dummy")); + new FileChooser().addChoosableFileFilter(new FileNameExtensionFilter("", "dummy")); FileSystemView.getFileSystemView().isFileSystemRoot(new File("dummy")); new JLayer(); }); @@ -183,7 +184,7 @@ protected void onOpen() { String description = sb.toString(); String[] array = extensions.toArray(new String[0]); - JFileChooser chooser = new JFileChooser(); + FileChooser chooser = new FileChooser(); chooser.removeChoosableFileFilter(chooser.getFileFilter()); chooser.addChoosableFileFilter(new FileNameExtensionFilter("All files (" + description + ")", array)); @@ -195,7 +196,7 @@ protected void onOpen() { chooser.setCurrentDirectory(configuration.getRecentLoadDirectory()); - if (chooser.showOpenDialog(mainView.getMainFrame()) == JFileChooser.APPROVE_OPTION) { + if (chooser.showOpenDialog(mainView.getMainFrame()) == FileChooser.APPROVE_OPTION) { configuration.setRecentLoadDirectory(chooser.getCurrentDirectory()); openFile(chooser.getSelectedFile()); } @@ -207,12 +208,12 @@ protected void onClose() { protected void onSaveSource() { if (currentPage instanceof ContentSavable) { - JFileChooser chooser = new JFileChooser(); + FileChooser chooser = new FileChooser(); JFrame mainFrame = mainView.getMainFrame(); chooser.setSelectedFile(new File(configuration.getRecentSaveDirectory(), ((ContentSavable)currentPage).getFileName())); - if (chooser.showSaveDialog(mainFrame) == JFileChooser.APPROVE_OPTION) { + if (chooser.showSaveDialog(mainFrame) == FileChooser.APPROVE_OPTION) { File selectedFile = chooser.getSelectedFile(); configuration.setRecentSaveDirectory(chooser.getCurrentDirectory()); @@ -245,12 +246,12 @@ protected void onSaveAllSources() { if (currentPanel instanceof SourcesSavable) { SourcesSavable sourcesSavable = (SourcesSavable)currentPanel; - JFileChooser chooser = new JFileChooser(); + FileChooser chooser = new FileChooser(); JFrame mainFrame = mainView.getMainFrame(); chooser.setSelectedFile(new File(configuration.getRecentSaveDirectory(), sourcesSavable.getSourceFileName())); - if (chooser.showSaveDialog(mainFrame) == JFileChooser.APPROVE_OPTION) { + if (chooser.showSaveDialog(mainFrame) == FileChooser.APPROVE_OPTION) { File selectedFile = chooser.getSelectedFile(); configuration.setRecentSaveDirectory(chooser.getCurrentDirectory()); diff --git a/app/src/main/java/org/jd/gui/util/io/FileUtils.groovy b/app/src/main/java/org/jd/gui/util/io/FileUtils.groovy new file mode 100644 index 00000000..94f51e7f --- /dev/null +++ b/app/src/main/java/org/jd/gui/util/io/FileUtils.groovy @@ -0,0 +1,20 @@ +package org.jd.gui.util.io + +/** + * Created by jianhua.fengjh on 27/11/2015. + */ +class FileUtils { + + static String ensureTrailingSlash(final String path) { + if ((path == null) || "".equals(path)) { + return ""; + } + + StringBuilder buf = new StringBuilder(path); + while (buf.charAt(buf.length() - 1) == File.separatorChar) { + buf.deleteCharAt(buf.length() - 1); + } + + return buf.append(File.separatorChar).toString(); + } +} diff --git a/app/src/main/java/org/jd/gui/util/io/FileUtils.java b/app/src/main/java/org/jd/gui/util/io/FileUtils.java new file mode 100644 index 00000000..a4548178 --- /dev/null +++ b/app/src/main/java/org/jd/gui/util/io/FileUtils.java @@ -0,0 +1,23 @@ +package org.jd.gui.util.io; + +import java.io.File; + + +/** + * Created by jianhua.fengjh on 27/11/2015. + */ +public class FileUtils { + + public static String ensureTrailingSlash(final String path) { + if ((path == null) || "".equals(path)) { + return ""; + } + + StringBuilder buf = new StringBuilder(path); + while (buf.charAt(buf.length() - 1) == File.separatorChar) { + buf.deleteCharAt(buf.length() - 1); + } + + return buf.append(File.separatorChar).toString(); + } +} diff --git a/app/src/main/java/org/jd/gui/util/sys/SystemUtils.groovy b/app/src/main/java/org/jd/gui/util/sys/SystemUtils.groovy new file mode 100644 index 00000000..c5905fcb --- /dev/null +++ b/app/src/main/java/org/jd/gui/util/sys/SystemUtils.groovy @@ -0,0 +1,20 @@ +package org.jd.gui.util.sys + +/** + * Created by jianhua.fengjh on 27/11/2015. + */ +final class SystemUtils { + + static boolean isLinux() { + return System.getProperty("os.name").startsWith("Linux"); + } + + static boolean isMacOS() { + return System.getProperty("os.name").startsWith("Mac"); + } + + static boolean isWindows() { + return System.getProperty("os.name").startsWith("Windows"); + } + +} diff --git a/app/src/main/java/org/jd/gui/util/sys/SystemUtils.java b/app/src/main/java/org/jd/gui/util/sys/SystemUtils.java new file mode 100644 index 00000000..6a75c591 --- /dev/null +++ b/app/src/main/java/org/jd/gui/util/sys/SystemUtils.java @@ -0,0 +1,20 @@ +package org.jd.gui.util.sys; + +/** + * Created by jianhua.fengjh on 27/11/2015. + */ +public final class SystemUtils { + + public static boolean isLinux() { + return System.getProperty("os.name").startsWith("Linux"); + } + + public static boolean isMacOS() { + return System.getProperty("os.name").startsWith("Mac"); + } + + public static boolean isWindows() { + return System.getProperty("os.name").startsWith("Windows"); + } + +} diff --git a/app/src/main/java/org/jd/gui/view/AboutView.java b/app/src/main/java/org/jd/gui/view/AboutView.java index f7cfa84a..c97c33ee 100644 --- a/app/src/main/java/org/jd/gui/view/AboutView.java +++ b/app/src/main/java/org/jd/gui/view/AboutView.java @@ -97,7 +97,7 @@ public AboutView(JFrame mainFrame) { hbox.add(Box.createHorizontalGlue()); hbox = Box.createHorizontalBox(); - hbox.add(new JLabel("Copyright © 2008, 2019 Emmanuel Dupuy")); + hbox.add(new JLabel("Copyright © 2008, 2021 Emmanuel Dupuy")); hbox.add(Box.createHorizontalGlue()); subvbox.add(hbox); diff --git a/app/src/main/java/org/jd/gui/view/component/FileChooser.groovy b/app/src/main/java/org/jd/gui/view/component/FileChooser.groovy new file mode 100644 index 00000000..0bf14379 --- /dev/null +++ b/app/src/main/java/org/jd/gui/view/component/FileChooser.groovy @@ -0,0 +1,87 @@ +package org.jd.gui.view.component + +import org.jd.gui.util.io.FileUtils +import org.jd.gui.util.sys.SystemUtils + +import javax.swing.* +import java.awt.* + +/** + * Created by jianhua.fengjh on 27/11/2015. + */ +class FileChooser extends JFileChooser { + + int showOpenDialog(Component parent) { + if (!SystemUtils.isMacOS()) { + return super.showOpenDialog(parent); + } else { + setDialogType(JFileChooser.OPEN_DIALOG); + return showNativeFileDialog(this); + } + } + + int showSaveDialog(Component parent) { + + if (!SystemUtils.isMacOS()) { + return super.showSaveDialog(parent); + } else { + setDialogType(JFileChooser.SAVE_DIALOG); + return showNativeFileDialog(this); + } + } + + private static int showNativeFileDialog(final JFileChooser chooser) { + if (chooser != null) { + + FileDialog fileDialog = new FileDialog((Frame) chooser.getParent()); + fileDialog.setDirectory(chooser.getCurrentDirectory().getPath()); + File file = chooser.getSelectedFile(); + + if (chooser.getDialogType() == JFileChooser.SAVE_DIALOG) { + fileDialog.setFile(file != null ? file.getName() : ""); //save only need name + } else { + fileDialog.setFile(file != null ? file.getPath() : ""); + } + + fileDialog.setFilenameFilter(new FilenameFilter() { + + boolean accept(File dir, String name) { + String path = dir.getPath(); + String pathSeparator = File.pathSeparator; + return chooser.getFileFilter().accept(new File(0 + path.length() + pathSeparator.length() + name.length() + path + pathSeparator + name)); + } + + }); + + if (chooser.getDialogType() == JFileChooser.SAVE_DIALOG) { + fileDialog.setMode(FileDialog.SAVE); + } else { + fileDialog.setMode(FileDialog.LOAD); + } + + if (chooser.getFileSelectionMode() == JFileChooser.DIRECTORIES_ONLY) { + System.setProperty("apple.awt.fileDialogForDirectories", "true"); + } else { + System.setProperty("apple.awt.fileDialogForDirectories", "false"); + } + + fileDialog.setVisible(true); + + //reset fileDialogForDirectories property + System.setProperty("apple.awt.fileDialogForDirectories", "false"); + if (fileDialog.getFile() == null) { + return JFileChooser.CANCEL_OPTION; + } + + String dir = fileDialog.getDirectory(); + String trailingSlash = FileUtils.ensureTrailingSlash(dir); + String strFile = fileDialog.getFile(); + chooser.setSelectedFile(new File(strFile.length() != 0 ? trailingSlash.concat(strFile) : trailingSlash)); + + return JFileChooser.APPROVE_OPTION; + } + + return JFileChooser.ERROR_OPTION; + } + +} diff --git a/app/src/main/java/org/jd/gui/view/component/FileChooser.java b/app/src/main/java/org/jd/gui/view/component/FileChooser.java new file mode 100644 index 00000000..ba477ce3 --- /dev/null +++ b/app/src/main/java/org/jd/gui/view/component/FileChooser.java @@ -0,0 +1,94 @@ +package org.jd.gui.view.component; + +import org.jd.gui.util.io.FileUtils; +import org.jd.gui.util.sys.SystemUtils; + +import javax.swing.*; +import java.awt.*; +import java.io.File; +import java.io.FilenameFilter; + +/** + * Created by jianhua.fengjh on 27/11/2015. + */ +public class FileChooser extends JFileChooser { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public int showOpenDialog(Component parent) { + if (!SystemUtils.isMacOS()) { + return super.showOpenDialog(parent); + } else { + setDialogType(JFileChooser.OPEN_DIALOG); + return showNativeFileDialog(this); + } + } + + public int showSaveDialog(Component parent) { + + if (!SystemUtils.isMacOS()) { + return super.showSaveDialog(parent); + } else { + setDialogType(JFileChooser.SAVE_DIALOG); + return showNativeFileDialog(this); + } + } + + private static int showNativeFileDialog(final JFileChooser chooser) { + if (chooser != null) { + + FileDialog fileDialog = new FileDialog((Frame) chooser.getParent()); + fileDialog.setDirectory(chooser.getCurrentDirectory().getPath()); + File file = chooser.getSelectedFile(); + + if (chooser.getDialogType() == JFileChooser.SAVE_DIALOG) { + fileDialog.setFile(file != null ? file.getName() : ""); //save only need name + } else { + fileDialog.setFile(file != null ? file.getPath() : ""); + } + + fileDialog.setFilenameFilter(new FilenameFilter() { + + public boolean accept(File dir, String name) { + String path = dir.getPath(); + String pathSeparator = File.pathSeparator; + return chooser.getFileFilter().accept(new File(0 + path.length() + pathSeparator.length() + name.length() + path + pathSeparator + name)); + } + + }); + + if (chooser.getDialogType() == JFileChooser.SAVE_DIALOG) { + fileDialog.setMode(FileDialog.SAVE); + } else { + fileDialog.setMode(FileDialog.LOAD); + } + + if (chooser.getFileSelectionMode() == JFileChooser.DIRECTORIES_ONLY) { + System.setProperty("apple.awt.fileDialogForDirectories", "true"); + } else { + System.setProperty("apple.awt.fileDialogForDirectories", "false"); + } + + fileDialog.setVisible(true); + + //reset fileDialogForDirectories property + System.setProperty("apple.awt.fileDialogForDirectories", "false"); + if (fileDialog.getFile() == null) { + return JFileChooser.CANCEL_OPTION; + } + + String dir = fileDialog.getDirectory(); + String trailingSlash = FileUtils.ensureTrailingSlash(dir); + String strFile = fileDialog.getFile(); + chooser.setSelectedFile(new File(strFile.length() != 0 ? trailingSlash.concat(strFile) : trailingSlash)); + + return JFileChooser.APPROVE_OPTION; + } + + return JFileChooser.ERROR_OPTION; + } + +} diff --git a/build.gradle b/build.gradle index 51633402..842ec1d0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,14 @@ buildscript { repositories { jcenter() + maven { + url "https://plugins.gradle.org/m2/" + } } dependencies { - classpath 'com.netflix.nebula:gradle-ospackage-plugin:5.3.0' // RPM & DEB support - classpath 'edu.sc.seis.gradle:launch4j:2.4.4' - classpath 'net.sf.proguard:proguard-gradle:6.1.0' + classpath 'com.netflix.nebula:gradle-ospackage-plugin:9.0.0' // RPM & DEB support + classpath 'edu.sc.seis.launch4j:launch4j:2.5.1' + classpath 'net.sf.proguard:proguard-gradle:6.2.2' } } @@ -15,7 +18,7 @@ apply plugin: 'edu.sc.seis.launch4j' apply plugin: 'nebula.ospackage' // Common configuration // -rootProject.version='1.6.6' +rootProject.version='1.6.7' rootProject.ext.set('jdCoreVersion', '1.1.3') targetCompatibility = '1.8' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9a6bf73b..7de2580f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip diff --git a/services/build.gradle b/services/build.gradle index 6ed884b9..07964299 100644 --- a/services/build.gradle +++ b/services/build.gradle @@ -1,8 +1,8 @@ apply plugin: 'java' dependencies { - compile 'com.fifesoft:rsyntaxtextarea:3.0.4' - compile 'org.ow2.asm:asm:7.1' + compile 'com.fifesoft:rsyntaxtextarea:3.1.3' + compile 'org.ow2.asm:asm:9.2' compile 'org.jd:jd-core:' + parent.jdCoreVersion compile project(':api') testCompile 'junit:junit:4.12' @@ -24,8 +24,8 @@ configurations { } dependencies { - compile 'org.antlr:antlr4-runtime:4.5' - antlr4 'org.antlr:antlr4:4.5' + compile 'org.antlr:antlr4-runtime:4.9.3' + antlr4 'org.antlr:antlr4:4.9.3' } task antlr4OutputDir() { diff --git a/src/osx/resources/Info.plist b/src/osx/resources/Info.plist index 264b3fd3..5e5f27c6 100644 --- a/src/osx/resources/Info.plist +++ b/src/osx/resources/Info.plist @@ -5,16 +5,16 @@ CFBundleDevelopmentRegion English CFBundleExecutable universalJavaApplicationStub.sh CFBundleName JD-GUI - CFBundleGetInfoString JD-GUI version ${VERSION}, Copyright 2008, 2019 Emmanuel Dupuy + CFBundleGetInfoString JD-GUI version ${VERSION}, Copyright 2008, 2021 Emmanuel Dupuy CFBundleIconFile jd-gui.icns CFBundleIdentifier jd.jd-gui CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL - CFBundleLongVersionString ${VERSION}, Copyright 2008, 2019 Emmanuel Dupuy + CFBundleLongVersionString ${VERSION}, Copyright 2008, 2021 Emmanuel Dupuy CFBundleShortVersionString ${VERSION} CSResourcesFileMapped LSRequiresCarbon - NSHumanReadableCopyright Copyright 2008, 2019 Emmanuel Dupuy + NSHumanReadableCopyright Copyright 2008, 2021 Emmanuel Dupuy NSPrincipalClass NSApplication NSHighResolutionCapable CFBundleDocumentTypes diff --git a/src/osx/resources/universalJavaApplicationStub.sh b/src/osx/resources/universalJavaApplicationStub.sh index 686db22d..c7ed84ea 100644 --- a/src/osx/resources/universalJavaApplicationStub.sh +++ b/src/osx/resources/universalJavaApplicationStub.sh @@ -286,13 +286,12 @@ elif [ -f "$JAVACMD" ] && [ -x "$JAVACMD" ] ; then # - main class # - JVM arguments exec "$JAVACMD" \ - -cp "${JVMClassPath}" \ -Xdock:icon="${ResourcesFolder}/${CFBundleIconFile}" \ -Xdock:name="${CFBundleName}" \ ${JVMOptions:+$JVMOptions }\ ${JVMDefaultOptions:+$JVMDefaultOptions }\ - ${JVMMainClass}\ - ${JVMArguments:+ $JVMArguments} + ${JVMArguments:+ $JVMArguments}\ + -jar "${JVMClassPath}" \ else