diff --git a/CHANGELOG.md b/CHANGELOG.md index f6be1efee..709c81a4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added +- Deobfuscation and its options as icons on script panel toolbar ## [18.0.0] - 2022-12-18 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 042353d2f..d88428054 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -863,6 +863,10 @@ public final class Configuration { @ConfigurationCategory("ui") public static ConfigurationItem doubleClickNodeToEdit = null; + @ConfigurationDefaultBoolean(true) + @ConfigurationCategory("script") + public static ConfigurationItem warningDeobfuscation = null; + private enum OSId { WINDOWS, OSX, UNIX } diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index 45409f6bf..ab425ea1f 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -881,7 +881,7 @@ public abstract class MainFrameMenu implements MenuBuilder { AbstractButton button = (AbstractButton) evt.getSource(); boolean selected = button.isSelected(); - if (ViewMessages.showConfirmDialog(Main.getDefaultMessagesComponent(), translate("message.confirm.autodeobfuscate") + "\r\n" + (selected ? translate("message.confirm.on") : translate("message.confirm.off")), translate("message.confirm"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { + if (ViewMessages.showConfirmDialog(Main.getDefaultMessagesComponent(), translate("message.confirm.autodeobfuscate") + "\r\n" + (selected ? translate("message.confirm.on") : translate("message.confirm.off")), translate("message.confirm"), JOptionPane.OK_CANCEL_OPTION, Configuration.warningDeobfuscation, JOptionPane.OK_OPTION) == JOptionPane.OK_OPTION) { Configuration.autoDeobfuscate.set(selected); mainFrame.getPanel().autoDeobfuscateChanged(); } else { diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 8eee2c4c7..ec4acc9bc 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -1587,6 +1587,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } public void updateClassesList() { + String selectionPath = getCurrentTree().getSelectionPathString(); List nodes = getASTreeNodes(tagTree); boolean updateNeeded = false; for (TreeItem n : nodes) { @@ -1601,6 +1602,11 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se if (updateNeeded) { tagTree.updateUI(); } + TreePath tp = getCurrentTree().getTreePathFromString(selectionPath); + if (tp != null) + { + getCurrentTree().setSelectionPath(tp); + } } private boolean isFilterEmpty(String filter) { diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index ffdaac248..122079de6 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -96,6 +96,7 @@ import de.hameister.treetable.MyTreeTableModel; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; +import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Insets; import java.awt.event.ActionEvent; @@ -121,10 +122,13 @@ import javax.swing.AbstractAction; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; +import javax.swing.JCheckBoxMenuItem; import javax.swing.JComboBox; import javax.swing.JLabel; +import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTabbedPane; @@ -957,7 +961,23 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener