diff --git a/CHANGELOG.md b/CHANGELOG.md index bc0f2e791..bf0d7cdd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - Support for installing java in FFDec windows installer ### Changed +- Making internal flash viewer a default viewer + move FP option switch to Advanced settings / others - Increased scrolling speed in folder preview - Changed /bin/bash to /usr/bin/env bash - Building does not require Naashorn - uses Beanshell instead 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 f0b413462..407a9933d 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 @@ -95,9 +95,14 @@ public final class Configuration { @ConfigurationCategory("") public static ConfigurationItem cacheImages = null; + /* @ConfigurationDefaultBoolean(false) @ConfigurationCategory("display") public static ConfigurationItem internalFlashViewer = null; + */ + @ConfigurationDefaultBoolean(false) + @ConfigurationInternal + public static ConfigurationItem useAdobeFlashPlayerForPreviews = null; @ConfigurationDefaultInt(1000) @ConfigurationCategory("display") diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index de08c62d6..4fab04a11 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -99,10 +99,9 @@ public abstract class MainFrameMenu implements MenuBuilder { protected final Map menuActions = new HashMap<>(); - public boolean isInternalFlashViewerSelected() { + /*public boolean isInternalFlashViewerSelected() { return isMenuChecked("/settings/internalViewer"); //miInternalViewer.isSelected(); - } - + }*/ private final boolean externalFlashPlayerUnavailable; public MainFrameMenu(MainFrame mainFrame, boolean externalFlashPlayerUnavailable) { @@ -648,14 +647,14 @@ public abstract class MainFrameMenu implements MenuBuilder { } } - protected void internalViewerSwitchActionPerformed(ActionEvent evt) { + /*protected void internalViewerSwitchActionPerformed(ActionEvent evt) { AbstractButton button = (AbstractButton) evt.getSource(); boolean selected = button.isSelected(); Configuration.internalFlashViewer.set(selected); mainFrame.getPanel().reload(true); } - + */ protected void simplifyExpressionsActionPerformed(ActionEvent evt) { AbstractButton button = (AbstractButton) evt.getSource(); boolean selected = button.isSelected(); @@ -935,7 +934,7 @@ public abstract class MainFrameMenu implements MenuBuilder { addToggleMenuItem("/settings/autoDeobfuscation", translate("menu.settings.autodeobfuscation"), null, null, this::autoDeobfuscationActionPerformed, 0, null); addToggleMenuItem("/settings/simplifyExpressions", translate("menu.settings.simplifyExpressions"), null, null, this::simplifyExpressionsActionPerformed, 0, null); - addToggleMenuItem("/settings/internalViewer", translate("menu.settings.internalflashviewer"), null, null, this::internalViewerSwitchActionPerformed, 0, null); + //addToggleMenuItem("/settings/internalViewer", translate("menu.settings.internalflashviewer"), null, null, this::internalViewerSwitchActionPerformed, 0, null); addToggleMenuItem("/settings/parallelSpeedUp", translate("menu.settings.parallelspeedup"), null, null, this::parallelSpeedUpActionPerformed, 0, null); addToggleMenuItem("/settings/disableDecompilation", translate("menu.settings.disabledecompilation"), null, null, this::disableDecompilationActionPerformed, 0, null); //addToggleMenuItem("/settings/cacheOnDisk", translate("menu.settings.cacheOnDisk"), null, null, this::cacheOnDiskActionPerformed, 0, null); @@ -976,11 +975,11 @@ public abstract class MainFrameMenu implements MenuBuilder { setMenuChecked("/settings/simplifyExpressions", newValue); }); - setMenuChecked("/settings/internalViewer", Configuration.internalFlashViewer.get() || externalFlashPlayerUnavailable); + /*setMenuChecked("/settings/internalViewer", Configuration.internalFlashViewer.get() || externalFlashPlayerUnavailable); Configuration.internalFlashViewer.addListener(configListenerInternalFlashViewer = (Boolean newValue) -> { setMenuChecked("/settings/internalViewer", newValue || externalFlashPlayerUnavailable); }); - + */ setMenuChecked("/settings/parallelSpeedUp", Configuration.parallelSpeedUp.get()); Configuration.parallelSpeedUp.addListener(configListenerParallelSpeedUp = (Boolean newValue) -> { setMenuChecked("/settings/parallelSpeedUp", newValue); @@ -1178,7 +1177,7 @@ public abstract class MainFrameMenu implements MenuBuilder { Configuration.autoDeobfuscate.removeListener(configListenerAutoDeobfuscate); Configuration.simplifyExpressions.removeListener(configListenerSimplifyExpressions); - Configuration.internalFlashViewer.removeListener(configListenerInternalFlashViewer); + //Configuration.internalFlashViewer.removeListener(configListenerInternalFlashViewer); Configuration.parallelSpeedUp.removeListener(configListenerParallelSpeedUp); Configuration.decompile.removeListener(configListenerDecompile); //Configuration.cacheOnDisk.removeListener(configListenerCacheOnDisk); diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index fdd0a57af..c47032faf 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -3118,8 +3118,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } } - public boolean isInternalFlashViewerSelected() { - return mainMenu.isInternalFlashViewerSelected(); + public boolean isAdobeFlashPlayerEnabled() { + return Configuration.useAdobeFlashPlayerForPreviews.get(); } public static final int VIEW_RESOURCES = 0; @@ -3302,7 +3302,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se previewPanel.showEmpty(); return; } - boolean internalViewer = isInternalFlashViewerSelected(); + boolean internalViewer = !isAdobeFlashPlayerEnabled(); if (treeItem instanceof SWF) { SWF swf = (SWF) treeItem; if (internalViewer) { @@ -3422,7 +3422,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se previewPanel.setImageReplaceButtonVisible(false, false); - boolean internalViewer = isInternalFlashViewerSelected(); + boolean internalViewer = !isAdobeFlashPlayerEnabled(); if (treeItem instanceof ScriptPack) { final ScriptPack scriptLeaf = (ScriptPack) treeItem; diff --git a/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java b/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java index f9cd47076..aae01c9fe 100644 --- a/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java @@ -467,7 +467,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel } private void showFontPage(FontTag fontTag) { - if (mainPanel.isInternalFlashViewerSelected() /*|| ft instanceof GFxDefineCompactedFont*/) { + if (!mainPanel.isAdobeFlashPlayerEnabled() /*|| ft instanceof GFxDefineCompactedFont*/) { showImagePanel(MainPanel.makeTimelined(fontTag), fontTag.getSwf(), fontPageNum); } } @@ -485,7 +485,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel } public void showTextPanel(TextTag textTag) { - if (mainPanel.isInternalFlashViewerSelected() /*|| ft instanceof GFxDefineCompactedFont*/) { + if (!mainPanel.isAdobeFlashPlayerEnabled() /*|| ft instanceof GFxDefineCompactedFont*/) { showImagePanel(MainPanel.makeTimelined(textTag), textTag.getSwf(), 0); } @@ -636,7 +636,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel swf.saveTo(fos, false); } //Inject Loader - if (swf.isAS3() && Configuration.autoOpenLoadedSWFs.get() && !Configuration.internalFlashViewer.get() && !DebuggerTools.hasDebugger(swf)) { + if (swf.isAS3() && Configuration.autoOpenLoadedSWFs.get() && Configuration.useAdobeFlashPlayerForPreviews.get() && !DebuggerTools.hasDebugger(swf)) { SWF instrSWF; try (InputStream fis = new BufferedInputStream(new FileInputStream(tempFile))) { instrSWF = new SWF(fis, false, false); @@ -732,7 +732,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel FontTag fontTag = fontPanel.getFontTag(); int pageCount = getFontPageCount(fontTag); fontPageNum = (fontPageNum + pageCount - 1) % pageCount; - if (mainPanel.isInternalFlashViewerSelected() /*|| ft instanceof GFxDefineCompactedFont*/) { + if (!mainPanel.isAdobeFlashPlayerEnabled() /*|| ft instanceof GFxDefineCompactedFont*/) { imagePanel.setTimelined(MainPanel.makeTimelined(fontTag, fontPageNum), fontTag.getSwf(), 0); } } @@ -741,7 +741,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel FontTag fontTag = fontPanel.getFontTag(); int pageCount = getFontPageCount(fontTag); fontPageNum = (fontPageNum + 1) % pageCount; - if (mainPanel.isInternalFlashViewerSelected() /*|| ft instanceof GFxDefineCompactedFont*/) { + if (!mainPanel.isAdobeFlashPlayerEnabled() /*|| ft instanceof GFxDefineCompactedFont*/) { imagePanel.setTimelined(MainPanel.makeTimelined(fontTag, fontPageNum), fontTag.getSwf(), 0); } } diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index c4723ad01..c462b8998 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -475,4 +475,7 @@ config.name.gui.avm2.splitPane.docs.dividerLocationPercent = (Internal) splitPan config.description.gui.avm2.splitPane.docs.dividerLocationPercent = splitPane docs divider Location Percent config.name.gui.dump.splitPane.dividerLocationPercent = (Internal) dumpsplitPanedividerLocationPercent -config.description.gui.dump.splitPane.dividerLocationPercent = dump splitPane divider Location Percent \ No newline at end of file +config.description.gui.dump.splitPane.dividerLocationPercent = dump splitPane divider Location Percent + +config.name.useAdobeFlashPlayerForPreviews = (Deprecated) Use Adobe Flash player for preview of objects +config.description.useAdobeFlashPlayerForPreviews = Use Adobe Flash player for preview of objects. WARNING: FlashPlayer was discontinued on 2021-01-12