diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java index 405fda48b..cf9a1d99f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java @@ -93,7 +93,7 @@ import java.util.logging.Logger; * Represents one ACTIONRECORD, also has some static method to work with Actions */ public class Action implements GraphSourceItem { - + private boolean ignored = false; /** * Action type identifier @@ -880,6 +880,7 @@ public class Action implements GraphSourceItem { "", " * " + AppResources.translate("decompilationError"), " * " + AppResources.translate("decompilationError.obfuscated"), + Helper.decompilationErrorAdd==null?null:" * "+Helper.decompilationErrorAdd, " * " + AppResources.translate("decompilationError.errorType") + ": " + ex2.getClass().getSimpleName(), ""})); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/CommentItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/CommentItem.java index 35e8e3ee7..aa2e8e25d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/CommentItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/CommentItem.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph.model; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -41,6 +42,9 @@ public class CommentItem extends GraphTargetItem { public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { writer.append("/* "); for (int i = 0; i < commentLines.length; i++) { + if(commentLines[i]==null){ + continue; + } writer.append(commentLines[i]); if (i != commentLines.length - 1) { writer.newLine(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java index 3e5de7968..527477637 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java @@ -59,6 +59,8 @@ import java.util.regex.Pattern; public class Helper { public static String newLine = System.getProperty("line.separator"); + public static String decompilationErrorAdd = null; + /** * Converts array of int values to string @@ -807,6 +809,9 @@ public class Helper { writer.appendNoHilight("/*").newLine(); writer.appendNoHilight(" * ").appendNoHilight(AppResources.translate("decompilationError")).newLine(); writer.appendNoHilight(" * ").appendNoHilight(AppResources.translate("decompilationError.obfuscated")).newLine(); + if(decompilationErrorAdd!=null){ + writer.appendNoHilight(" * ").appendNoHilight(decompilationErrorAdd).newLine(); + } writer.appendNoHilight(" * ").appendNoHilight(AppResources.translate("decompilationError.errorType")). appendNoHilight(": " + ex.getClass().getSimpleName()).newLine(); writer.appendNoHilight(" */").newLine(); diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index a9cef121e..918f48589 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -919,6 +919,8 @@ public class Main { UIManager.put("ColorChooser.swatchesNameText", AppStrings.translate("ColorChooser.swatchesNameText")); UIManager.put("ColorChooser.swatchesRecentText", AppStrings.translate("ColorChooser.swatchesRecentText")); UIManager.put("ColorChooser.sampleText", AppStrings.translate("ColorChooser.sampleText")); + + Helper.decompilationErrorAdd = AppStrings.translate(Configuration.autoDeobfuscate.get()?"deobfuscation.comment.failed":"deobfuscation.comment.tryenable"); } /** diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index e4a88f7ce..87228fcb5 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -1314,6 +1314,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } public void autoDeobfuscateChanged() { + Helper.decompilationErrorAdd = AppStrings.translate(Configuration.autoDeobfuscate.get()?"deobfuscation.comment.failed":"deobfuscation.comment.tryenable"); clearCache(); if (abcPanel != null) { abcPanel.reload(); diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index 924152e51..1e21013bf 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -524,3 +524,7 @@ menu.debugger.showlog = Show Log message.debugger = This SWF Debugger can only be used to print messages to log window, browser console or alerts.\r\nIt is NOT designed for features like step code, breakpoints etc. contextmenu.addTag = Add tag + +deobfuscation.comment.tryenable = Tip: You can try enabling "Automatic deobfucation" in Settings +deobfuscation.comment.failed = Deobfuscation is activated but decompilation still failed. If the file is NOT obfuscated, disable "Automatic deobfucation" for better results. +