diff --git a/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java b/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java index dd33cd89e..d3c9c700b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java +++ b/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java @@ -47,7 +47,7 @@ public class ApplicationInfo { applicationVerName = applicationName + " v." + version; updatePage = updatePageStub + version; shortApplicationVerName = shortApplicationName + " v." + version; - } catch (IOException ex) { + } catch (IOException | NullPointerException ex) { //ignore version = "unknown"; } diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 7c4c23512..3e196bea4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -48,6 +48,7 @@ import com.jpexs.decompiler.flash.action.swf5.ActionNewMethod; import com.jpexs.decompiler.flash.action.swf5.ActionNewObject; import com.jpexs.decompiler.flash.action.swf5.ActionSetMember; import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.flv.AUDIODATA; import com.jpexs.decompiler.flash.flv.FLVOutputStream; @@ -1610,7 +1611,7 @@ public final class SWF { return null; } - private static void getVariables(ConstantPool constantPool, List localData, Stack stack, List output, ActionGraphSource code, int ip, List> variables, List functions, HashMap strings, List visited, HashMap usageTypes, String path) { + private static void getVariables(ConstantPool constantPool, List localData, Stack stack, List output, ActionGraphSource code, int ip, List> variables, List functions, HashMap strings, List visited, HashMap usageTypes, String path) throws InterruptedException { boolean debugMode = false; while ((ip > -1) && ip < code.size()) { if (visited.contains(ip)) { @@ -1715,7 +1716,7 @@ public final class SWF { try { ins.translate(localData, stack, output, staticOperation, path); - } catch (Exception ex) { + } catch (InterruptedException ex) { Logger.getLogger(SWF.class.getName()).log(Level.SEVERE, "Error during getting variables", ex); } if (ins.isExit()) { @@ -1761,16 +1762,12 @@ public final class SWF { }; } - private static void getVariables(List> variables, List functions, HashMap strings, HashMap usageType, ActionGraphSource code, int addr, String path) { + private static void getVariables(List> variables, List functions, HashMap strings, HashMap usageType, ActionGraphSource code, int addr, String path) throws InterruptedException { List localData = Helper.toList(new HashMap(), new HashMap(), new HashMap()); - try { - getVariables(null, localData, new Stack(), new ArrayList(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList(), usageType, path); - } catch (Exception ex) { - Logger.getLogger(SWF.class.getName()).log(Level.SEVERE, "Getting variables error", ex); - } + getVariables(null, localData, new Stack(), new ArrayList(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList(), usageType, path); } - private List> getVariables(List> variables, List functions, HashMap strings, HashMap usageType, ASMSource src, String path) { + private List> getVariables(List> variables, List functions, HashMap strings, HashMap usageType, ASMSource src, String path) throws InterruptedException { List> ret = new ArrayList<>(); List actions = src.getActions(version); actionsMap.put(src, actions); @@ -1779,7 +1776,7 @@ public final class SWF { } private HashMap> actionsMap = new HashMap<>(); - private void getVariables(List objs, String path) { + private void getVariables(List objs, String path) throws InterruptedException { List processed = new ArrayList<>(); for (ContainerItem o : objs) { if (o instanceof ASMSource) { diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index a163a31b3..892e5af83 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.action.swf4.*; import com.jpexs.decompiler.flash.action.swf5.*; import com.jpexs.decompiler.flash.action.swf6.*; import com.jpexs.decompiler.flash.action.swf7.*; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.tags.*; import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; import com.jpexs.decompiler.flash.tags.gfx.DefineExternalGradient; @@ -88,7 +89,7 @@ public class SWFInputStream extends InputStream { private long percentMax; private List buffered = new ArrayList<>(); private ByteArrayOutputStream buffer; - private static boolean DEOBFUSCATION_ALL_CODE_IN_PREVIOUS_TAG = Configuration.getConfig("deobfuscateUsePrevTagOnly"); + private static boolean DEOBFUSCATION_ALL_CODE_IN_PREVIOUS_TAG = Configuration.deobfuscateUsePrevTagOnly.get(); public int getVersion() { return version; @@ -583,11 +584,7 @@ public class SWFInputStream extends InputStream { @Override public Tag call() throws Exception { - try { - return SWFInputStream.resolveTag(swf, tag, version, level, parallel, skipUnusualTags); - } catch (Exception ex) { - return null; - } + return SWFInputStream.resolveTag(swf, tag, version, level, parallel, skipUnusualTags); } } @@ -998,7 +995,7 @@ public class SWFInputStream extends InputStream { default: ret = new Tag(swf, tag.getId(), "Unknown", data, pos); } - } catch (Exception ex) { + } catch (IOException ex) { Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE, "Error during tag reading", ex); ret = new Tag(swf, tag.getId(), "ErrorTag", data, pos); } diff --git a/trunk/src/com/jpexs/decompiler/flash/TagNode.java b/trunk/src/com/jpexs/decompiler/flash/TagNode.java index 2e77ef927..40102d713 100644 --- a/trunk/src/com/jpexs/decompiler/flash/TagNode.java +++ b/trunk/src/com/jpexs/decompiler/flash/TagNode.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.FileTextWriter; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag; @@ -341,6 +342,7 @@ public class TagNode { } ret.add(file); + } catch (InterruptedException ex) { } catch (IOException | OutOfMemoryError | StackOverflowError ex) { Logger.getLogger(TagNode.class.getName()).log(Level.SEVERE, "Decompilation error", ex); if (handler != null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index bf4edbadb..5eb67abd5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -16,11 +16,11 @@ */ package com.jpexs.decompiler.flash.abc; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.abc.types.traits.Trait; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.FileTextWriter; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; @@ -114,7 +114,7 @@ public class ScriptPack { return Helper.joinStrings(pathParts, File.separator); } - public void convert(final NulWriter writer, final List abcList, final Trait[] traits, final ExportMode exportMode, final boolean parallel) { + public void convert(final NulWriter writer, final List abcList, final Trait[] traits, final ExportMode exportMode, final boolean parallel) throws InterruptedException { for (int t : traitIndices) { Trait trait = traits[t]; Multiname name = trait.getName(abc); @@ -127,7 +127,7 @@ public class ScriptPack { } } - public void appendTo(GraphTextWriter writer, List abcList, Trait[] traits, ExportMode exportMode, boolean parallel) { + public void appendTo(GraphTextWriter writer, List abcList, Trait[] traits, ExportMode exportMode, boolean parallel) throws InterruptedException { for (int t : traitIndices) { Trait trait = traits[t]; Multiname name = trait.getName(abc); @@ -140,7 +140,7 @@ public class ScriptPack { } } - public void toSource(GraphTextWriter writer, final List abcList, final Trait[] traits, final ExportMode exportMode, final boolean parallel) { + public void toSource(GraphTextWriter writer, final List abcList, final Trait[] traits, final ExportMode exportMode, final boolean parallel) throws InterruptedException { writer.suspendMeasure(); try { Helper.timedCall(new Callable() { @@ -190,7 +190,11 @@ public class ScriptPack { File file = new File(fileName); try (FileTextWriter writer = new FileTextWriter(new FileOutputStream(file))) { - toSource(writer, abcList, abc.script_info[scriptIndex].traits.traits, exportMode, parallel); + try { + toSource(writer, abcList, abc.script_info[scriptIndex].traits.traits, exportMode, parallel); + } catch (InterruptedException ex) { + Logger.getLogger(ScriptPack.class.getName()).log(Level.SEVERE, null, ex); + } } return file; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 96b55b363..ce8189869 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -1089,7 +1089,7 @@ public class AVM2Code implements Serializable { return pos2adr(fixIPAfterDebugLine(adr2pos(addr))); } - public ConvertOutput toSourceOutput(String path, GraphPart part, boolean processJumps, boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, int start, int end, HashMap localRegNames, List fullyQualifiedNames, boolean[] visited, HashMap localRegAssigmentIps, HashMap> refs) throws ConvertException { + public ConvertOutput toSourceOutput(String path, GraphPart part, boolean processJumps, boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, int start, int end, HashMap localRegNames, List fullyQualifiedNames, boolean[] visited, HashMap localRegAssigmentIps, HashMap> refs) throws ConvertException, InterruptedException { boolean debugMode = DEBUG_MODE; if (debugMode) { System.out.println("OPEN SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString()); @@ -2149,7 +2149,7 @@ public class AVM2Code implements Serializable { } } this.code = acode.code; - } catch (Exception ex) { + } catch (IOException | ParseException ex) { } invalidateCache(); } @@ -2201,7 +2201,7 @@ public class AVM2Code implements Serializable { copy = (AVM2Code) ois.readObject(); } return copy; - } catch (Exception ex) { + } catch (IOException | ClassNotFoundException ex) { Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, "Error during deepCopy", ex); return null; } @@ -2361,6 +2361,9 @@ public class AVM2Code implements Serializable { @SuppressWarnings("unchecked") private static int removeTraps(HashMap> refs, boolean secondPass, boolean indeterminate, List localData, Stack stack, List output, AVM2GraphSource code, int ip, HashMap visited, HashMap> visitedStates, HashMap decisions, String path) throws InterruptedException { + if (Thread.interrupted()) { + throw new InterruptedException(); + } boolean debugMode = false; int ret = 0; iploop: diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java index d13f5684a..8ff31c45e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java @@ -68,7 +68,7 @@ public class AVM2GraphSource extends GraphSource { @Override @SuppressWarnings("unchecked") - public List translatePart(GraphPart part, List localData, Stack stack, int start, int end, int staticOperation, String path) { + public List translatePart(GraphPart part, List localData, Stack stack, int start, int end, int staticOperation, String path) throws InterruptedException { List ret = new ArrayList<>(); Object o = localData.get(AVM2Graph.DATA_SCOPESTACK); Stack newstack = (Stack) o; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java index ee9767126..9608bda2a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java @@ -280,7 +280,7 @@ public class AVM2Instruction implements Serializable, GraphSourceItem { @Override @SuppressWarnings("unchecked") - public void translate(List localData, Stack stack, List output, int staticOperation, String path) { + public void translate(List localData, Stack stack, List output, int staticOperation, String path) throws InterruptedException { definition.translate((Boolean) localData.get(0), (Integer) localData.get(13), (Integer) localData.get(1), diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java index 2a6f7e33c..23619d9ff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java @@ -80,7 +80,7 @@ public class InstructionDefinition implements Serializable { throw new UnsupportedOperationException("Instruction " + instructionName + " not implemented"); } - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { } protected FullMultinameAVM2Item resolveMultiname(Stack stack, ConstantPool constants, int multinameIndex, AVM2Instruction ins) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/SetTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/SetTypeIns.java index e55a190c0..985997eba 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/SetTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/SetTypeIns.java @@ -25,5 +25,5 @@ import java.util.Stack; public interface SetTypeIns { - public abstract String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames); + public abstract String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java index da5c598df..afc39fec8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java @@ -75,7 +75,7 @@ public class ConstructIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java index 20150bba7..79410a976 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java @@ -55,7 +55,7 @@ public class ConstructPropIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java index f22b4a93b..045f2ae90 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java @@ -38,7 +38,7 @@ public class NewClassIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int clsIndex = ins.operands[0]; HilightedTextWriter writer = new HilightedTextWriter(false); stack.pop().toString(writer, LocalData.create(constants, localRegNames, fullyQualifiedNames)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java index 256d1ed9e..8f6ecb0ac 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java @@ -51,7 +51,7 @@ public class SetSuperIns extends InstructionDefinition implements SetTypeIns { } @Override - public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { + public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException { int multinameIndex = ins.operands[0]; String multiname = resolveMultinameNoPop(1, stack, abc.constants, multinameIndex, ins, fullyQualifiedNames); HilightedTextWriter writer = new HilightedTextWriter(false); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java index 807b31868..5d5386284 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java @@ -37,7 +37,7 @@ public abstract class AVM2Item extends GraphTargetItem { return true; } - protected GraphTextWriter formatProperty(GraphTextWriter writer, GraphTargetItem object, GraphTargetItem propertyName, LocalData localData) { + protected GraphTextWriter formatProperty(GraphTextWriter writer, GraphTargetItem object, GraphTargetItem propertyName, LocalData localData) throws InterruptedException { boolean empty = false; if (object instanceof LocalRegAVM2Item) { if (((LocalRegAVM2Item) object).computedValue != null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java index a539f0609..1b2024db3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java @@ -37,7 +37,7 @@ public class AlchemyLoadAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("op_" + name + "("); ofs.toString(writer, localData); return writer.append(") /*Alchemy*/"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java index db3d4a5f3..acf3a24db 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java @@ -36,7 +36,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("op_" + name + "("); value.toString(writer, localData); return writer.append(") /*Alchemy*/"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java index 9aad30a5b..9822c312f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java @@ -38,7 +38,7 @@ public class AlchemyStoreAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("op_" + name + "("); ofs.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java index 0bcf698ab..57fd986c8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ApplyTypeAVM2Item.java @@ -34,7 +34,7 @@ public class ApplyTypeAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); if (!params.isEmpty()) { writer.append(".<"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java index 397c2bfef..5bba9def2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallAVM2Item.java @@ -36,7 +36,7 @@ public class CallAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { /*String recPart = ""; receiver.toString(constants, localRegNames) + writer.append("."); if (receiver instanceof NewActivationAVM2Item) { recPart = ""; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java index f094e9ae7..b2818a8f1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallMethodAVM2Item.java @@ -36,7 +36,7 @@ public class CallMethodAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { receiver.toString(writer, localData); writer.append("."); writer.append(methodName); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java index 9ba5f56ea..873284d9b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallPropertyAVM2Item.java @@ -38,7 +38,7 @@ public class CallPropertyAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { formatProperty(writer, receiver, propertyName, localData); writer.append("("); for (int a = 0; a < arguments.size(); a++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java index 635e43a59..8af0c477a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallStaticAVM2Item.java @@ -36,7 +36,7 @@ public class CallStaticAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { receiver.toString(writer, localData); writer.append("."); writer.append(methodName); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java index 7c470314c..1cfc41bf8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CallSuperAVM2Item.java @@ -38,7 +38,7 @@ public class CallSuperAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!receiver.toString().equals("this")) { receiver.toString(writer, localData); writer.append("."); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java index f2082d462..e6aee8e86 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java @@ -35,7 +35,7 @@ public class CoerceAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { //return hilight("("+type+")", highlight)+ return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java index d89c6f0e2..a068fe962 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructAVM2Item.java @@ -34,7 +34,7 @@ public class ConstructAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (object instanceof NewFunctionAVM2Item) { writer.append("new "); return object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java index df58572fc..93b8b1832 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructPropAVM2Item.java @@ -36,7 +36,7 @@ public class ConstructPropAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("new "); int idx = writer.getLength(); object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java index 220f31f54..1c070141c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConstructSuperAVM2Item.java @@ -34,7 +34,7 @@ public class ConstructSuperAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!object.toString().equals("this")) { object.toString(writer, localData); writer.append("."); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java index 7287baa99..76f0fdde4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java @@ -34,7 +34,7 @@ public class ConvertAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java index c704420f6..7d4b4d556 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java @@ -30,7 +30,7 @@ public class DecrementAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { value.toString(writer, localData); return writer.append("-1"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java index f2792b4a5..c1f65bbe7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/DefaultXMLNamespace.java @@ -35,7 +35,7 @@ public class DefaultXMLNamespace extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("default xml namespace = "); return ns.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java index 48b501267..0026fa7e9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java @@ -33,7 +33,7 @@ public class EscapeXAttrAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("{"); value.toString(writer, localData); return writer.append("}"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java index 7c560acf3..580ffcfab 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java @@ -35,7 +35,7 @@ public class EscapeXElemAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("{"); expression.toString(writer, localData); return writer.append("}"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java index e0c85dfda..300874f72 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FilteredCheckAVM2Item.java @@ -35,7 +35,7 @@ public class FilteredCheckAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return object.toString(writer, localData); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java index 9a9d4a9b0..a04eeff00 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java @@ -56,7 +56,7 @@ public class FullMultinameAVM2Item extends AVM2Item { return (name != null) || (namespace != null); } - public boolean isXML(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public boolean isXML(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException { String cname; if (name != null) { cname = name.toString(LocalData.create(constants, localRegNames, fullyQualifiedNames)); @@ -76,7 +76,7 @@ public class FullMultinameAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (namespace != null) { namespace.toString(writer, localData); writer.append("::"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java index 15b0a46ed..21fa18e20 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetDescendantsAVM2Item.java @@ -33,7 +33,7 @@ public class GetDescendantsAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); writer.append(".."); return multiname.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java index bcf68b085..cb34435d5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetPropertyAVM2Item.java @@ -33,7 +33,7 @@ public class GetPropertyAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return formatProperty(writer, object, propertyName, localData); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java index b46520158..d16d50d5e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/GetSuperAVM2Item.java @@ -33,7 +33,7 @@ public class GetSuperAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!object.toString().equals("this")) { object.toString(writer, localData); writer.append("."); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java index 546174177..bbf56a6fa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/HasNextAVM2Item.java @@ -37,7 +37,7 @@ public class HasNextAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { collection.toString(writer, localData); writer.append(" hasNext "); return object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java index 8f9a9ae13..20a758477 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InAVM2Item.java @@ -33,7 +33,7 @@ public class InAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); writer.append(" in "); return collection.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java index 661a293fc..b50cec264 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java @@ -30,7 +30,7 @@ public class IncrementAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { value.toString(writer, localData); return writer.append("+1"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java index 748fb01a3..b7a5d4b69 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java @@ -36,7 +36,7 @@ public class InitPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, A } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { formatProperty(writer, object, propertyName, localData); writer.append(" = "); return value.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java index 9fba2e576..a041bf281 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java @@ -47,7 +47,7 @@ public class LocalRegAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (computedValue instanceof FilterAVM2Item) { return computedValue.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java index 10741427e..5cb64f32e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java @@ -33,7 +33,7 @@ public class NameValuePair extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { name.toString(writer, localData); writer.append(":"); if (value instanceof TernarOpItem) { //Ternar operator contains ":" diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java index 4b1be77a7..0f2b0665d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewArrayAVM2Item.java @@ -32,7 +32,7 @@ public class NewArrayAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("["); for (int a = 0; a < values.size(); a++) { if (a > 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java index f108b346c..dba69f79e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java @@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewFunctionIns; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -29,8 +28,6 @@ import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; import java.util.List; import java.util.Stack; -import java.util.logging.Level; -import java.util.logging.Logger; public class NewFunctionAVM2Item extends AVM2Item { @@ -60,7 +57,7 @@ public class NewFunctionAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { MethodBody body = abc.findBody(methodIndex); writer.append("function" + (!functionName.isEmpty() ? " " + functionName : "")); writer.startMethod(methodIndex); @@ -72,14 +69,10 @@ public class NewFunctionAVM2Item extends AVM2Item { writer.newLine(); writer.append("{").newLine(); if (body != null) { - try { - if (writer instanceof NulWriter) { - body.convert(path + "/inner", ExportMode.SOURCE, isStatic, scriptIndex, classIndex, abc, null, constants, methodInfo, new Stack()/*scopeStack*/, false, fullyQualifiedNames, null, false); - } else { - body.toString(path + "/inner", ExportMode.SOURCE, isStatic, scriptIndex, classIndex, abc, null, constants, methodInfo, new Stack()/*scopeStack*/, false, writer, fullyQualifiedNames, null); - } - } catch (Exception ex) { - Logger.getLogger(NewFunctionIns.class.getName()).log(Level.SEVERE, "error during newfunction", ex); + if (writer instanceof NulWriter) { + body.convert(path + "/inner", ExportMode.SOURCE, isStatic, scriptIndex, classIndex, abc, null, constants, methodInfo, new Stack()/*scopeStack*/, false, fullyQualifiedNames, null, false); + } else { + body.toString(path + "/inner", ExportMode.SOURCE, isStatic, scriptIndex, classIndex, abc, null, constants, methodInfo, new Stack()/*scopeStack*/, false, writer, fullyQualifiedNames, null); } } writer.append("}"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java index 8f7ee3354..cb95f5416 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java @@ -31,7 +31,7 @@ public class NewObjectAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean singleLine = pairs.size() < 2; if (!singleLine) { writer.newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java index bc48e4837..303edb36a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextNameAVM2Item.java @@ -37,7 +37,7 @@ public class NextNameAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("nextName("); index.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java index 3b778713c..4b0b58099 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/NextValueAVM2Item.java @@ -37,7 +37,7 @@ public class NextValueAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("nextValue("); index.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java index ee476c847..d4297c261 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostDecrementAVM2Item.java @@ -32,7 +32,7 @@ public class PostDecrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append("--"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java index b2a9ea1f5..8154c963b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/PostIncrementAVM2Item.java @@ -32,7 +32,7 @@ public class PostIncrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append("++"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java index b5be6ffdb..7d962cbb2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java @@ -31,7 +31,7 @@ public class ReturnValueAVM2Item extends AVM2Item implements ExitItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("return "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java index be65b22d5..d7d40f88a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java @@ -39,7 +39,7 @@ public class SetGlobalSlotAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("setglobalslot(" + slotId + ","); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java index a58ea1443..c7779475c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java @@ -34,7 +34,7 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append(localRegName(localData.localRegNames, regIndex) + " = "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java index 02baa3db2..f0f0519bd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetPropertyAVM2Item.java @@ -42,7 +42,7 @@ public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, As } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { formatProperty(writer, object, propertyName, localData); writer.append(" = "); return value.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java index 2108280af..2d915773d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java @@ -43,7 +43,7 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { getName(writer, localData); writer.append(" = "); return value.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java index 848e94936..015eef84a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java @@ -41,7 +41,7 @@ public class SetSuperAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!object.toString().equals("this")) { object.toString(writer, localData); writer.append("."); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java index 671fa0574..38d05a11a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java @@ -30,7 +30,7 @@ public class ThrowAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("throw "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java index 7f1da2a7a..b723744e3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/WithAVM2Item.java @@ -41,7 +41,7 @@ public class WithAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("with("); scope.toString(writer, localData); writer.append(")").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java index bae080a13..4306d9e30 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java @@ -36,7 +36,7 @@ public class XMLAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { for (GraphTargetItem part : parts) { if (part instanceof StringAVM2Item) { writer.append(((StringAVM2Item) part).value); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java index f54c970e8..5a72b5b00 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java @@ -45,7 +45,7 @@ public class DeclarationAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (assignment instanceof SetLocalAVM2Item) { SetLocalAVM2Item lti = (SetLocalAVM2Item) assignment; String type = "*"; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java index ac44221ba..6584ccc66 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/FilterAVM2Item.java @@ -38,7 +38,7 @@ public class FilterAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { collection.toString(writer, localData); writer.append(".("); expression.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java index 91059566b..fc0ea6d4e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForEachInAVM2Item.java @@ -72,7 +72,7 @@ public class ForEachInAVM2Item extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter)writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java index 0642766e6..64f78fa9e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/ForInAVM2Item.java @@ -72,7 +72,7 @@ public class ForInAVM2Item extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter)writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java index 6cddefef3..93e98183b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java @@ -51,7 +51,7 @@ public class TryAVM2Item extends AVM2Item implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("try").newLine(); writer.append("{").newLine(); writer.indent(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java index 045057b48..89e52afa5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java @@ -31,7 +31,7 @@ public class AddAVM2Item extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.precedence >= precedence) { //string + vs number + if (leftSide.precedence > precedence) { writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java index d9136dea7..b8ffabfbc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java @@ -35,7 +35,7 @@ public class DeletePropertyAVM2Item extends AVM2Item { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("delete "); object.toString(writer, localData); writer.append("["); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/SubtractAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/SubtractAVM2Item.java index 36db0368e..1a1b78b6c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/SubtractAVM2Item.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/SubtractAVM2Item.java @@ -35,7 +35,7 @@ public class SubtractAVM2Item extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.precedence >= precedence) { // >= add or subtract too if (leftSide.precedence > precedence) { writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java index 28eba2a29..57086094a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; @@ -33,6 +32,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction; import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; +import com.jpexs.decompiler.flash.configuration.Configuration; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/methodinfo_parser/MethodInfoParser.java b/trunk/src/com/jpexs/decompiler/flash/abc/methodinfo_parser/MethodInfoParser.java index 9ad2487d7..189a25402 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/methodinfo_parser/MethodInfoParser.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/methodinfo_parser/MethodInfoParser.java @@ -16,11 +16,11 @@ */ package com.jpexs.decompiler.flash.abc.methodinfo_parser; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.abc.types.ValueKind; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; +import com.jpexs.decompiler.flash.configuration.Configuration; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index c4243ff42..e4c78df9a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -16,13 +16,13 @@ */ package com.jpexs.decompiler.flash.abc.types; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.CodeStats; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.Traits; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; @@ -114,19 +114,19 @@ public class MethodBody implements Cloneable, Serializable { return ret; } - public HilightedTextWriter toString(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack scopeStack, final boolean isStaticInitializer, final List fullyQualifiedNames, final Traits initTraits) { + public HilightedTextWriter toString(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack scopeStack, final boolean isStaticInitializer, final List fullyQualifiedNames, final Traits initTraits) throws InterruptedException { convert(path, exportMode, isStatic, scriptIndex, classIndex, abc, trait, constants, method_info, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits, true); HilightedTextWriter writer = new HilightedTextWriter(false); toString(path, exportMode, isStatic, scriptIndex, classIndex, abc, trait, constants, method_info, scopeStack, isStaticInitializer, writer, fullyQualifiedNames, initTraits); return writer; } - public void convert(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack scopeStack, final boolean isStaticInitializer, final List fullyQualifiedNames, final Traits initTraits, boolean firstLevel) { + public void convert(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack scopeStack, final boolean isStaticInitializer, final List fullyQualifiedNames, final Traits initTraits, boolean firstLevel) throws InterruptedException { if (debugMode) { System.err.println("Decompiling " + path); } if (exportMode == ExportMode.SOURCE) { - int timeout = Configuration.getConfig("decompilationTimeoutSingleMethod"); + int timeout = Configuration.decompilationTimeoutSingleMethod.get(); try { Callable callable = new Callable() { @Override @@ -143,6 +143,8 @@ public class MethodBody implements Cloneable, Serializable { } else { callable.call(); } + } catch (InterruptedException ex) { + throw ex; } catch (Exception ex) { Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", ex); convertException = ex; @@ -153,13 +155,13 @@ public class MethodBody implements Cloneable, Serializable { } } - public GraphTextWriter toString(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List fullyQualifiedNames, final Traits initTraits) { + public GraphTextWriter toString(final String path, ExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final ConstantPool constants, final MethodInfo[] method_info, final Stack scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List fullyQualifiedNames, final Traits initTraits) throws InterruptedException { if (exportMode != ExportMode.SOURCE) { writer.indent(); code.toASMSource(constants, trait, method_info[this.method_info], this, exportMode, writer); writer.unindent(); } else { - if (!Configuration.getConfig("decompile", true)) { + if (!Configuration.decompile.get()) { writer.indent(); writer.startMethod(this.method_info); writer.appendNoHilight("//Decompilation skipped"); @@ -168,7 +170,7 @@ public class MethodBody implements Cloneable, Serializable { return writer; } writer.indent(); - int timeout = Configuration.getConfig("decompilationTimeoutSingleMethod"); + int timeout = Configuration.decompilationTimeoutSingleMethod.get(); if (convertException == null) { HashMap localRegNames = getLocalRegNames(abc); @@ -196,14 +198,14 @@ public class MethodBody implements Cloneable, Serializable { return writer; } - public MethodBody convertMethodBody(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, Trait trait, ConstantPool constants, MethodInfo[] method_info, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) { + public MethodBody convertMethodBody(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, Trait trait, ConstantPool constants, MethodInfo[] method_info, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) throws InterruptedException { MethodBody b = (MethodBody) Helper.deepCopy(this); AVM2Code deobfuscated = b.code; deobfuscated.markMappedOffsets(); - if (Configuration.getConfig("autoDeobfuscate")) { + if (Configuration.autoDeobfuscate.get()) { try { deobfuscated.removeTraps(constants, trait, method_info[this.method_info], b, abc, scriptIndex, classIndex, isStatic, path); - } catch (Exception | StackOverflowError ex) { + } catch (StackOverflowError ex) { Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Error during remove traps in " + path, ex); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java index f359a71fc..7206e6ec5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java @@ -16,9 +16,9 @@ */ package com.jpexs.decompiler.flash.abc.types; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.helpers.Helper; import java.util.HashMap; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java index 262862f42..d0974d141 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java @@ -113,15 +113,15 @@ public abstract class Trait implements Serializable { return abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata); } - public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { writer.appendNoHilight(abc.constants.constant_multiname[name_index].toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata)); return writer; } - public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { } - public GraphTextWriter toStringPackaged(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toStringPackaged(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Namespace ns = abc.constants.constant_multiname[name_index].getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { String nsname = ns.getName(abc.constants); @@ -136,7 +136,7 @@ public abstract class Trait implements Serializable { return writer; } - public void convertPackaged(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convertPackaged(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Namespace ns = abc.constants.constant_multiname[name_index].getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { String nsname = ns.getName(abc.constants); @@ -144,12 +144,12 @@ public abstract class Trait implements Serializable { } } - public GraphTextWriter toStringHeader(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toStringHeader(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { toString(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); return writer; } - public void convertHeader(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convertHeader(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { convert(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index fe8e128b9..b4f6d424d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -336,7 +336,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } @Override - public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { writer.startClass(class_info); String packageName = abc.instance_info[class_info].getName(abc.constants).getNamespace(abc.constants).getName(abc.constants); @@ -498,7 +498,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } @Override - public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { fullyQualifiedNames = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java index 6c1c0403b..d70171fbe 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java @@ -67,7 +67,7 @@ public class TraitFunction extends Trait implements TraitWithSlot { } @Override - public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { toStringHeader(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); if (abc.instance_info[classIndex].isInterface()) { writer.appendNoHilight(";"); @@ -85,7 +85,7 @@ public class TraitFunction extends Trait implements TraitWithSlot { } @Override - public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { convertHeader(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); if (!abc.instance_info[classIndex].isInterface()) { int bodyIndex = abc.findBodyIndex(method_info); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java index 909c5c253..e722b773a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java @@ -71,7 +71,7 @@ public class TraitMethodGetterSetter extends Trait { } @Override - public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames); convertHeader(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); int bodyIndex = abc.findBodyIndex(method_info); @@ -83,7 +83,7 @@ public class TraitMethodGetterSetter extends Trait { } @Override - public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames); toStringHeader(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); int bodyIndex = abc.findBodyIndex(method_info); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java index 544ca0596..444c3d439 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java @@ -86,7 +86,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { return writer; } - public void getValueStr(Trait parent, GraphTextWriter writer, ABC abc, List fullyQualifiedNames) { + public void getValueStr(Trait parent, GraphTextWriter writer, ABC abc, List fullyQualifiedNames) throws InterruptedException { if (assignedValue != null) { if (parent instanceof TraitClass) { TraitClass tc = (TraitClass) parent; @@ -119,7 +119,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { } @Override - public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { String modifier = getModifiers(abcTags, abc, isStatic) + " "; if (modifier.equals(" ")) { modifier = ""; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java index 14e6f31c2..8070c3ce2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java @@ -109,7 +109,7 @@ public class Traits implements Serializable { } @Override - public Void call() { + public Void call() throws InterruptedException { if (makePackages) { trait.convertPackaged(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); } else { @@ -119,7 +119,7 @@ public class Traits implements Serializable { } } - public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toString(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { for (int t = 0; t < traits.length; t++) { if (t > 0) { writer.newLine(); @@ -150,7 +150,7 @@ public class Traits implements Serializable { return writer; } - public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convert(Trait parent, String path, List abcTags, ABC abc, boolean isStatic, ExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { if (!parallel || traits.length < 2) { for (int t = 0; t < traits.length; t++) { TraitConvertTask task = new TraitConvertTask(traits[t], parent, makePackages, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, t, parallel); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java index 8406e3ff3..879d92479 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarMultinameUsage.java @@ -38,7 +38,7 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { NulWriter nulWriter = new NulWriter(); if (parentTraitIndex > -1) { if (isStatic) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarNameMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarNameMultinameUsage.java index 06f638759..0a04eb0b6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarNameMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarNameMultinameUsage.java @@ -32,7 +32,7 @@ public class ConstVarNameMultinameUsage extends ConstVarMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return super.toString(abcTags, abc) + " name"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarTypeMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarTypeMultinameUsage.java index 6aa6fe264..3f50977cc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarTypeMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ConstVarTypeMultinameUsage.java @@ -32,7 +32,7 @@ public class ConstVarTypeMultinameUsage extends ConstVarMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return super.toString(abcTags, abc) + " type"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ExtendsMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ExtendsMultinameUsage.java index d499af18e..b6d21350a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ExtendsMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ExtendsMultinameUsage.java @@ -31,7 +31,7 @@ public class ExtendsMultinameUsage extends InsideClassMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return super.toString(abcTags, abc) + " extends"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ImplementsMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ImplementsMultinameUsage.java index 8224393e2..04ab18b38 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/ImplementsMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/ImplementsMultinameUsage.java @@ -31,7 +31,7 @@ public class ImplementsMultinameUsage extends InsideClassMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return super.toString(abcTags, abc) + " implements"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java index 5a9fd9553..92fbdf73a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java @@ -35,7 +35,7 @@ public abstract class InsideClassMultinameUsage extends MultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return "class " + abc.constants.constant_multiname[abc.instance_info[classIndex].name_index].getNameWithNamespace(abc.constants); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodBodyMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodBodyMultinameUsage.java index f7365a3e3..464f63036 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodBodyMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodBodyMultinameUsage.java @@ -32,7 +32,7 @@ public class MethodBodyMultinameUsage extends MethodMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return super.toString(abcTags, abc) + " body"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java index 1e00e7ee5..e89855f5c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodMultinameUsage.java @@ -44,7 +44,7 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { NulWriter nulWriter = new NulWriter(); if (!isInitializer) { if (parentTraitIndex > -1) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodNameMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodNameMultinameUsage.java index 4bf50f0a2..5307fe2c9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodNameMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodNameMultinameUsage.java @@ -32,7 +32,7 @@ public class MethodNameMultinameUsage extends MethodMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return super.toString(abcTags, abc) + " name"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodParamsMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodParamsMultinameUsage.java index fe5f10fa3..d8c241a6c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodParamsMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodParamsMultinameUsage.java @@ -32,7 +32,7 @@ public class MethodParamsMultinameUsage extends MethodMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return super.toString(abcTags, abc) + " params"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodReturnTypeMultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodReturnTypeMultinameUsage.java index 8d015c0ab..82fe01466 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodReturnTypeMultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MethodReturnTypeMultinameUsage.java @@ -32,7 +32,7 @@ public class MethodReturnTypeMultinameUsage extends MethodMultinameUsage { } @Override - public String toString(List abcTags, ABC abc) { + public String toString(List abcTags, ABC abc) throws InterruptedException { return super.toString(abcTags, abc) + " return type"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MultinameUsage.java b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MultinameUsage.java index 01d39e41a..b8f0a9fa9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/usages/MultinameUsage.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/usages/MultinameUsage.java @@ -26,5 +26,5 @@ import java.util.List; */ public abstract class MultinameUsage { - public abstract String toString(List abcTags, ABC abc); + public abstract String toString(List abcTags, ABC abc) throws InterruptedException; } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index 2e91b7a9f..a4ae0d623 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.action; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; @@ -46,6 +45,7 @@ import com.jpexs.decompiler.flash.action.special.ActionEnd; import com.jpexs.decompiler.flash.action.swf4.*; import com.jpexs.decompiler.flash.action.swf5.*; import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; @@ -697,11 +697,11 @@ public class Action implements GraphSourceItem { * @param version SWF version * @param path */ - public static void actionsToSource(ASMSource asm, final List actions, final int version, final String path, GraphTextWriter writer) { + public static void actionsToSource(ASMSource asm, final List actions, final int version, final String path, GraphTextWriter writer) throws InterruptedException { writer.suspendMeasure(); List tree = null; Throwable convertException = null; - int timeout = Configuration.getConfig("decompilationTimeoutSingleMethod"); + int timeout = Configuration.decompilationTimeoutSingleMethod.get(); try { tree = Helper.timedCall(new Callable>() { @Override @@ -877,7 +877,7 @@ public class Action implements GraphSourceItem { List out; try { out = ActionGraph.translateViaGraph(cnt.getRegNames(), variables2, functions, actions.subList(adr2ip(actions, endAddr, version), adr2ip(actions, endAddr + size, version)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); - } catch (Exception | OutOfMemoryError | StackOverflowError ex2) { + } catch (OutOfMemoryError | StackOverflowError ex2) { Logger.getLogger(Action.class.getName()).log(Level.SEVERE, "Decompilation error", ex2); if (ex2 instanceof OutOfMemoryError) { System.gc(); @@ -1204,7 +1204,7 @@ public class Action implements GraphSourceItem { Action.actionsToString(new ArrayList(), address, ret, null, version, ExportMode.PCODE, writer, swfPos, path); s = writer.toString(); ret = ASMParser.parse(address, swfPos, true, s, SWF.DEFAULT_VERSION, false); - } catch (Exception ex) { + } catch (IOException | ParseException ex) { Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE, "parsing error. path: " + path, ex); } return ret; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/ActionListReader.java b/trunk/src/com/jpexs/decompiler/flash/action/ActionListReader.java index 3319c7c75..07f6f9734 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/ActionListReader.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/ActionListReader.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.action; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.action.model.ConstantPool; @@ -33,6 +32,7 @@ import com.jpexs.decompiler.flash.action.swf5.ActionDefineFunction; import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.graph.ExportMode; @@ -80,7 +80,7 @@ public class ActionListReader { * @throws IOException */ public static List readActionList(List listeners, long containerSWFOffset, ReReadableInputStream rri, int version, int ip, int endIp, String path) throws IOException { - boolean deobfuscate = Configuration.getConfig("autoDeobfuscate"); + boolean deobfuscate = Configuration.autoDeobfuscate.get(); ConstantPool cpool = new ConstantPool(); @@ -229,7 +229,7 @@ public class ActionListReader { } } - if (Configuration.getConfig("removeNops")) { + if (Configuration.removeNops.get()) { ret = Action.removeNops(0, ret, version, 0, path); } List reta = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java index 72d8a23bd..847fd3537 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java @@ -49,7 +49,7 @@ public abstract class ActionItem extends GraphTargetItem implements Serializable return false; } - protected GraphTextWriter stripQuotes(GraphTargetItem target, LocalData localData, GraphTextWriter writer) { + protected GraphTextWriter stripQuotes(GraphTargetItem target, LocalData localData, GraphTextWriter writer) throws InterruptedException { if (target instanceof DirectValueActionItem) { if (((DirectValueActionItem) target).value instanceof String) { return writer.append((String) ((DirectValueActionItem) target).value); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java index e01a7b0f4..faebfbf3b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java @@ -33,7 +33,7 @@ public class AsciiToCharActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("chr("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java index a95b37306..2eebaea71 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java @@ -33,7 +33,7 @@ public class CallActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("call("); stripQuotes(value, localData, writer); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java index a5b0269b4..65cf52f33 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java @@ -43,7 +43,7 @@ public class CallFunctionActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String paramStr = ""; stripQuotes(functionName, localData, writer); writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java index edc8d02f7..d4205474b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java @@ -49,7 +49,7 @@ public class CallMethodActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean blankMethod = false; if (methodName instanceof DirectValueActionItem) { if (((DirectValueActionItem) methodName).value instanceof Undefined) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java index 62919d609..2d4b24588 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java @@ -46,7 +46,7 @@ public class CastOpActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("("); stripQuotes(constructor, localData, writer); writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java index 9ea782984..158e9793f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java @@ -33,7 +33,7 @@ public class CharToAsciiActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("ord("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java index a11837175..b34a1dd12 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java @@ -49,7 +49,7 @@ public class CloneSpriteActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("duplicateMovieClip("); target.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java index 4cee234a1..a2d7563d6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java @@ -44,7 +44,7 @@ public class DecrementActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append(" - 1"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java index a604d586b..67d5af127 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java @@ -70,7 +70,7 @@ public class DefineLocalActionItem extends ActionItem implements SetTypeActionIt } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("var "); stripQuotes(name, localData, writer); if (value == null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java index f3a665493..789d6e126 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java @@ -46,7 +46,7 @@ public class DeleteActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("delete "); if (object == null) { return propertyName.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java index 1e194d873..3c3dbdfed 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java @@ -41,7 +41,7 @@ public class EnumerateActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("enumerate "); return object.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java index ecffdfc4f..1aaedcb31 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java @@ -36,7 +36,7 @@ public class EvalActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("eval("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java index 97d733cb2..6c162ac63 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java @@ -35,7 +35,7 @@ public class ExtendsActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { subclass.toString(writer, localData); writer.append(" extends "); return stripQuotes(superclass, localData, writer); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java index 263241151..982e612e5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java @@ -48,7 +48,7 @@ public class FSCommand2ActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("FSCommand2("); command.toString(writer, localData); for (int t = 0; t < arguments.size(); t++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java index e33217774..1534222f0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java @@ -73,7 +73,7 @@ public class FunctionActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (true) { //return writer.appendNoHilight("") } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java index 280625da7..634c9266a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java @@ -45,7 +45,7 @@ public class GetMemberActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!((memberName instanceof DirectValueActionItem) && (((DirectValueActionItem) memberName).value instanceof String))) { //if(!(functionName instanceof GetVariableActionItem)) object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java index f079b8ae6..8c2947ed1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java @@ -47,7 +47,7 @@ public class GetPropertyActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (isEmptyString(target)) { return writer.append(Action.propertyNames[propertyIndex]); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java index d00eeeac0..b5a64f8aa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java @@ -41,7 +41,7 @@ public class GetURL2ActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (sendVarsMethod == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java index 978e98e8d..38a7be069 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java @@ -48,7 +48,7 @@ public class GetVariableActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return stripQuotes(name, localData, writer); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java index daefcc4e9..d699f7c12 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java @@ -49,7 +49,7 @@ public class GotoFrame2ActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String prefix = "gotoAndStop"; if (playFlag) { prefix = "gotoAndPlay"; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java index 4a81b136a..c1102df12 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java @@ -35,7 +35,7 @@ public class ImplementsOpActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { subclass.toString(writer, localData); writer.append(" implements "); for (int i = 0; i < superclasses.size(); i++) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java index a922c74a1..d414b31d5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java @@ -44,7 +44,7 @@ public class IncrementActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append(" + 1"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java index 04fc4750c..d9b608b63 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java @@ -43,7 +43,7 @@ public class InitArrayActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("["); for (int i = 0; i < values.size(); i++) { if (i > 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java index c6c92efa1..ebd145ba1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java @@ -47,7 +47,7 @@ public class InitObjectActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("{"); for (int i = 0; i < values.size(); i++) { if (i > 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java index 08a155dd9..8c43141d6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java @@ -51,7 +51,7 @@ public class LoadMovieActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java index 716e48f73..560e58002 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java @@ -53,7 +53,7 @@ public class LoadMovieNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java index 36317327c..ea606df75 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java @@ -51,7 +51,7 @@ public class LoadVariablesActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java index ad112b10d..8b83d5a30 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java @@ -53,7 +53,7 @@ public class LoadVariablesNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { String methodStr = ""; if (method == 1) { methodStr = ",\"GET\""; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java index ca8ed4a55..a75b18853 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java @@ -33,7 +33,7 @@ public class MBAsciiToCharActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("mbchr("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java index eadcf5b03..54fac62cc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java @@ -33,7 +33,7 @@ public class MBCharToAsciiActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("mbord("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java index 8d190f61e..5ea93166a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java @@ -49,7 +49,7 @@ public class MBStringExtractActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("mbsubstring("); value.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java index 6534ee525..9db260cea 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java @@ -34,7 +34,7 @@ public class MBStringLengthActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("mblength("); if (value.precedence > precedence) { writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java index 805930e52..20b1f857f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java @@ -49,7 +49,7 @@ public class NewMethodActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean blankMethod = false; if (methodName instanceof DirectValueActionItem) { if (((DirectValueActionItem) methodName).value instanceof Undefined) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java index 4aeb7c15b..e8b2fd956 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java @@ -46,7 +46,7 @@ public class NewObjectActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("new "); stripQuotes(objectName, localData, writer); writer.append("("); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java index 02dd73e0e..e0a2968d7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java @@ -51,7 +51,7 @@ public class PostDecrementActionItem extends ActionItem implements SetTypeAction } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append("--"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java index 44a8fb3e5..c4c1025e2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java @@ -51,7 +51,7 @@ public class PostIncrementActionItem extends ActionItem implements SetTypeAction } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { object.toString(writer, localData); return writer.append("++"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java index e6f204c54..71cb291e0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java @@ -51,7 +51,7 @@ public class PrintActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("print("); target.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java index c8f9ee556..a05d129b4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java @@ -51,7 +51,7 @@ public class PrintAsBitmapActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("printAsBitmap("); target.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java index e74d7e4e9..3fc7401ff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java @@ -51,7 +51,7 @@ public class PrintAsBitmapNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("printAsBitmapNum("); num.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java index 968c84f5b..2e825fac9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java @@ -51,7 +51,7 @@ public class PrintNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("printNum("); num.toString(writer, localData); writer.append(","); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java index 1dd2c4403..e550471d3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java @@ -33,7 +33,7 @@ public class RandomNumberActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("random("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java index 342331cd8..b8e68f371 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java @@ -33,7 +33,7 @@ public class RemoveSpriteActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("removeMovieClip("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java index eb5855a7f..e7765f258 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java @@ -45,7 +45,7 @@ public class ReturnActionItem extends ActionItem implements ExitItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("return "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java index 5a90b1d4c..f7d08920d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java @@ -79,7 +79,7 @@ public class SetMemberActionItem extends ActionItem implements SetTypeActionItem } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (!((objectName instanceof DirectValueActionItem) && (((DirectValueActionItem) objectName).value instanceof String))) { //if(!(functionName instanceof GetVariableActionItem)) object.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java index c26c1ba5e..fadb8d85f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java @@ -71,7 +71,7 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (isEmptyString(target)) { writer.append(Action.propertyNames[propertyIndex] + " = "); return value.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java index b894e6504..1a71bb13c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java @@ -34,7 +34,7 @@ public class SetTarget2ActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("tellTarget("); target.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java index e0bbb9909..22f203214 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java @@ -68,7 +68,7 @@ public class SetVariableActionItem extends ActionItem implements SetTypeActionIt } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (name instanceof DirectValueActionItem || name instanceof GetVariableActionItem) { stripQuotes(name, localData, writer); writer.append(" = "); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java index 47f478e03..59da34ded 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java @@ -48,7 +48,7 @@ public class StartDragActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean hasConstrains = true; if (constrain instanceof DirectValueActionItem) { if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java index 0769b18de..d62550457 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java @@ -68,7 +68,7 @@ public class StoreRegisterActionItem extends ActionItem implements SetTypeAction } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (temporary) { value.toString(writer, localData); } else { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java index 012fb9ada..e8ecbfde0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java @@ -39,7 +39,7 @@ public class StringExtractActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { value.toString(writer, localData); writer.append(".substr("); index.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java index 3f8b971ae..f08a6b0c9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java @@ -33,7 +33,7 @@ public class StringLengthActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("length("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java index 93f01df72..ec6e88eff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java @@ -33,7 +33,7 @@ public class TargetPathActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("targetPath("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java index 753935138..c8031f08b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java @@ -46,7 +46,7 @@ public class TemporaryRegister extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java index f896bcc9e..4d838f116 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java @@ -33,7 +33,7 @@ public class ThrowActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("throw "); return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java index 1a4b47a47..9190c918a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java @@ -33,7 +33,7 @@ public class ToIntegerActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("int("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java index c316b7c66..f624ce5fa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java @@ -33,7 +33,7 @@ public class ToNumberActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("Number("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java index a5966fc34..32c0a65aa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java @@ -33,7 +33,7 @@ public class ToStringActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("String("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java index ffbc173bf..2fc8ece08 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java @@ -33,7 +33,7 @@ public class TraceActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("trace("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java index 75371ecf0..e6ba6bf57 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java @@ -35,7 +35,7 @@ public class TypeOfActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("typeof("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java index 6273eb2f9..a8ede4e78 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java @@ -47,7 +47,7 @@ public class UnLoadMovieActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("unloadMovie("); targetString.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java index 4c9fd63e5..aa3c36ed3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java @@ -49,7 +49,7 @@ public class UnLoadMovieNumActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("unloadMovieNum("); num.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java index 89d9c5d2e..65bf18d90 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java @@ -155,7 +155,7 @@ public class ClassActionItem extends ActionItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("class "); className.toStringNoQuotes(writer, localData); if (extendsOp != null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java index 2a774f876..ceece2755 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java @@ -71,7 +71,7 @@ public class ForInActionItem extends LoopActionItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter)writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java index 52eb1746f..390e5fa11 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java @@ -45,7 +45,7 @@ public class IfFrameLoadedActionItem extends ActionItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("ifFrameLoaded("); frame.toString(writer, localData); writer.append(")").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java index 48a85774c..ca05416d5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java @@ -43,7 +43,7 @@ public class InterfaceActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("interface "); name.toStringNoQuotes(writer, localData); boolean first = true; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java index 33b30f54c..4b687efb7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java @@ -40,7 +40,7 @@ public class TellTargetActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("tellTarget("); target.toString(writer, localData); writer.append(")").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java index 7e8eff0ec..2a122e230 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java @@ -58,7 +58,7 @@ public class TryActionItem extends ActionItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("try").newLine(); writer.append("{").newLine(); writer.indent(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java index de8de6b95..e2e5ef64a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java @@ -46,7 +46,7 @@ public class WithActionItem extends ActionItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("with("); scope.toString(writer, localData); writer.append(")").newLine(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java index b3a87c2de..a5aa8488c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java @@ -37,7 +37,7 @@ public class AddActionItem extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.precedence >= precedence) { //string + vs number + String ret = ""; if (leftSide.precedence > precedence) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java index 83262dfa4..a97f20ac7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java @@ -38,7 +38,7 @@ public class SubtractActionItem extends BinaryOpItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (rightSide.precedence >= precedence) { // >= add or subtract too String ret = ""; if (leftSide.precedence > precedence) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ConstantIndex.java b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ConstantIndex.java index 901c47c1e..1b9ee883b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf4/ConstantIndex.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf4/ConstantIndex.java @@ -16,7 +16,7 @@ */ package com.jpexs.decompiler.flash.action.swf4; -import com.jpexs.decompiler.flash.Configuration; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.helpers.Helper; import java.io.Serializable; import java.util.ArrayList; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java b/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java index 4747f2fbf..df70b7ed2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java @@ -269,7 +269,7 @@ public class ActionTry extends Action implements GraphSourceItemContainer { } else { lexer.yypushback(lexer.yylength()); } - } catch (Exception ex) { + } catch (IOException | ParseException ex) { } if (finallyBlockFlag) { diff --git a/trunk/src/com/jpexs/decompiler/flash/Configuration.java b/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java similarity index 62% rename from trunk/src/com/jpexs/decompiler/flash/Configuration.java rename to trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 6e2b7de80..f70eea67d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/Configuration.java +++ b/trunk/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -14,15 +14,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash; +package com.jpexs.decompiler.flash.configuration; +import com.jpexs.decompiler.flash.ApplicationInfo; import com.jpexs.proxy.Replacement; import java.io.*; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; +import java.util.Calendar; import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; @@ -69,11 +75,10 @@ public class Configuration { public static final int DECOMPILATION_TIMEOUT_FILE = 5 * 60; //using parameter names in decompiling may cause problems because official programs like Flash CS 5.5 inserts wrong parameter names indices public static final boolean PARAM_NAMES_ENABLE = false; - private static HashMap config = new HashMap<>(); /** * List of replacements */ - public static java.util.List replacements = new ArrayList<>(); + private static java.util.List replacements = new ArrayList<>(); private static HashMap configDefaults = new HashMap() { { put("decompile", true); @@ -98,6 +103,44 @@ public class Configuration { } }; + public static final ConfigurationItem decompile = null; + public static final ConfigurationItem parallelSpeedUp = null; + public static final ConfigurationItem autoDeobfuscate = null; + public static final ConfigurationItem cacheOnDisk = null; + public static final ConfigurationItem internalFlashViewer = null; + public static final ConfigurationItem gotoMainClassOnStartup = null; + public static final ConfigurationItem deobfuscateUsePrevTagOnly = null; + public static final ConfigurationItem offeredAssociation = null; + public static final ConfigurationItem removeNops = null; + + public static final ConfigurationItem decompilationTimeoutSingleMethod = null; + public static final ConfigurationItem xxx = null; + public static final ConfigurationItem lastRenameType = null; + + public static final ConfigurationItem lastSaveDir = null; + public static final ConfigurationItem lastOpenDir = null; + public static final ConfigurationItem lastExportDir = null; + public static final ConfigurationItem locale = null; + + public static final ConfigurationItem lastUpdatesCheckDate = null; + + @ConfigurationName(name = "gui.window.width") + public static final ConfigurationItem guiWindowWidth = null; + @ConfigurationName(name = "gui.window.height") + public static final ConfigurationItem guiWindowHeight = null; + @ConfigurationName(name = "gui.window.maximized.horizontal") + public static final ConfigurationItem guiWindowMaximizedHorizontal = null; + @ConfigurationName(name = "gui.window.maximized.vertical") + public static final ConfigurationItem guiWindowMaximizedVertical = null; + @ConfigurationName(name = "gui.avm2.splitPane.dividerLocation") + public static final ConfigurationItem guiAvm2SplitPaneDividerLocation = null; + @ConfigurationName(name = "guiActionSplitPaneDividerLocation") + public static final ConfigurationItem guiActionSplitPaneDividerLocation = null; + @ConfigurationName(name = "gui.splitPane1.dividerLocation") + public static final ConfigurationItem guiSplitPane1DividerLocation = null; + @ConfigurationName(name = "gui.splitPane2.dividerLocation") + public static final ConfigurationItem guiSplitPane2DividerLocation = null; + private enum OSId { WINDOWS, OSX, UNIX @@ -219,38 +262,6 @@ public class Configuration { } } - public static boolean containsConfig(String cfg) { - return config.containsKey(cfg); - } - - public static T getConfig(String cfg) { - T defaultValue = null; - if (configDefaults.containsKey(cfg)) { - @SuppressWarnings("unchecked") - T def = (T) configDefaults.get(cfg); - defaultValue = def; - } - return getConfig(cfg, defaultValue); - } - - public static T getConfig(String cfg, T defaultValue) { - if (!config.containsKey(cfg)) { - return defaultValue; - } - @SuppressWarnings("unchecked") - T result = (T) config.get(cfg); - return result; - } - - public static T setConfig(String cfg, T value) { - if (cfg.equals("paralelSpeedUp")) { - cfg = "parallelSpeedUp"; - } - @SuppressWarnings("unchecked") - T result = (T) config.put(cfg, value); - return result; - } - private static String getReplacementsFile() throws IOException { return getFFDecHome() + REPLACEMENTS_NAME; } @@ -259,11 +270,13 @@ public class Configuration { return getFFDecHome() + CONFIG_NAME; } - @SuppressWarnings("unchecked") - public static void loadFromFile(String file, String replacementsFile) { + private static HashMap loadFromFile(String file, String replacementsFile) { + HashMap config = new HashMap<>(); try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file))) { - config = (HashMap) ois.readObject(); + @SuppressWarnings("unchecked") + HashMap cfg = (HashMap) ois.readObject(); + config = cfg; } catch (FileNotFoundException ex) { } catch (ClassNotFoundException cnf) { } catch (IOException ex) { @@ -271,13 +284,27 @@ public class Configuration { if (replacementsFile != null) { loadReplacements(replacementsFile); } - if (containsConfig("paralelSpeedUp")) { - setConfig("parallelSpeedUp", getConfig("paralelSpeedUp")); + if (config.containsKey("paralelSpeedUp")) { + config.put("parallelSpeedUp", config.get("paralelSpeedUp")); config.remove("paralelSpeedUp"); } + return config; } - private static void saveToFile(String file, String replacementsFile) { + private static void saveToFile(String file, String replacementsFile) { + HashMap config = new HashMap<>(); + for (Entry entry : getConfigurationFields().entrySet()) { + try { + String name = entry.getKey(); + Field field = entry.getValue(); + ConfigurationItem item = (ConfigurationItem) field.get(null); + if (item.hasValue) { + config.put(name, item.get()); + } + } catch (IllegalArgumentException | IllegalAccessException ex) { + Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex); + } + } try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file))) { oos.writeObject(config); } catch (IOException ex) { @@ -293,10 +320,6 @@ public class Configuration { return replacements; } - public static void loadConfig() throws IOException { - loadFromFile(getConfigFile(), getReplacementsFile()); - } - public static void saveConfig() { try { saveToFile(getConfigFile(), getReplacementsFile()); @@ -304,4 +327,46 @@ public class Configuration { Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex); } } + + static { + setConfigurationFields(); + } + + @SuppressWarnings("unchecked") + public static void setConfigurationFields() { + try { + HashMap config = loadFromFile(getConfigFile(), getReplacementsFile()); + for (Entry entry : getConfigurationFields().entrySet()) { + String name = entry.getKey(); + Field field = entry.getValue(); + // remove final modifier from field + Field modifiersField = field.getClass().getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + + Object defaultValue = configDefaults.get(name); + + if (config.containsKey(name)) { + field.set(null, new ConfigurationItem(field.getName(), defaultValue, config.get(name))); + } else { + field.set(null, new ConfigurationItem(field.getName(), defaultValue)); + } + } + } catch (IOException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException ex) { + Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex); + } + } + + public static Map getConfigurationFields() { + Field[] fields = Configuration.class.getFields(); + Map result = new HashMap<>(); + for (Field field : fields) { + if (ConfigurationItem.class.isAssignableFrom(field.getType())) { + ConfigurationName annotation = (ConfigurationName) field.getAnnotation(ConfigurationName.class); + String name = annotation == null ? field.getName() : annotation.name(); + result.put(name, field); + } + } + return result; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/configuration/ConfigurationItem.java b/trunk/src/com/jpexs/decompiler/flash/configuration/ConfigurationItem.java new file mode 100644 index 000000000..36bef4809 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/configuration/ConfigurationItem.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.configuration; + +/** + * + * @author JPEXS + */ +public class ConfigurationItem { + + private String name; + protected boolean hasValue; + + private T value; + private T defaultValue; + private boolean modified; + + public ConfigurationItem(String name) { + this.name = name; + } + + public ConfigurationItem(String name, T defaultValue) { + this.defaultValue = defaultValue; + } + + public ConfigurationItem(String name, T defaultValue, T value) { + hasValue = true; + this.defaultValue = defaultValue; + this.value = value; + } + + public String getName() { + return name; + } + + public T get() { + if (!hasValue) { + return defaultValue; + } + return value; + } + + public T get(T defaultValue) { + if (!hasValue) { + return defaultValue; + } + return value; + } + + public void set(T value) { + hasValue = true; + modified = true; + this.value = value; + } + + public void unset() { + hasValue = false; + modified = true; + this.value = null; + } + + public boolean hasValue() { + return hasValue; + } + + public boolean isModified() { + return modified; + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/configuration/ConfigurationName.java b/trunk/src/com/jpexs/decompiler/flash/configuration/ConfigurationName.java new file mode 100644 index 000000000..f9bca8639 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/configuration/ConfigurationName.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2010-2013 JPEXS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.jpexs.decompiler.flash.configuration; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * + * @author JPEXS + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface ConfigurationName { + + String name(); + +} \ No newline at end of file diff --git a/trunk/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/trunk/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 1f55dada2..0ba953dc8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/trunk/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -18,10 +18,11 @@ package com.jpexs.decompiler.flash.console; import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; import com.jpexs.decompiler.flash.ApplicationInfo; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.ConsoleAbortRetryIgnoreHandler; import com.jpexs.decompiler.flash.EventListener; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.configuration.ConfigurationItem; import com.jpexs.decompiler.flash.gui.Main; import com.jpexs.decompiler.flash.gui.View; import com.jpexs.decompiler.flash.gui.proxy.ProxyFrame; @@ -48,12 +49,14 @@ public class CommandLineArgumentParser { private static boolean commandLineMode = false; - private static String[] commandlineConfigBoolean = new String[]{ - "decompile", - "parallelSpeedUp", - "internalFlashViewer", - "autoDeobfuscate", - "cacheOnDisk"}; + @SuppressWarnings("unchecked") + private static ConfigurationItem[] commandlineConfigBoolean = new ConfigurationItem[]{ + Configuration.decompile, + Configuration.parallelSpeedUp, + Configuration.internalFlashViewer, + Configuration.autoDeobfuscate, + Configuration.cacheOnDisk + }; public static boolean isCommandLineMode() { return commandLineMode; @@ -78,8 +81,8 @@ public class CommandLineArgumentParser { System.out.println(" ...Decompress infile and save it to outfile"); System.out.println(" 8) -config key=value[,key2=value2][,key3=value3...] [other parameters]"); System.out.print(" ...Sets configuration values. Available keys[current setting]:"); - for (String key : commandlineConfigBoolean) { - System.out.print(" " + key + "[" + Configuration.getConfig(key) + "]"); + for (ConfigurationItem item : commandlineConfigBoolean) { + System.out.print(" " + item + "[" + item.get() + "]"); } System.out.println(""); System.out.println(" Values are boolean, you can use 0/1, true/false, on/off or yes/no."); @@ -174,8 +177,8 @@ public class CommandLineArgumentParser { printHeader(); printCmdLineUsage(); System.exit(0); - } else if (args.size() == 1) { - return args.remove(); + } else if (args.isEmpty()) { + return nextParam; } else { badArguments(); } @@ -217,12 +220,12 @@ public class CommandLineArgumentParser { if (key.toLowerCase().equals("paralelSpeedUp".toLowerCase())) { key = "parallelSpeedUp"; } - for (String bk : commandlineConfigBoolean) { - if (key.toLowerCase().equals(bk.toLowerCase())) { + for (ConfigurationItem item : commandlineConfigBoolean) { + if (key.toLowerCase().equals(item.getName().toLowerCase())) { Boolean bValue = parseBooleanConfigValue(value); if (bValue != null) { - System.out.println("Config " + bk + " set to " + bValue); - Configuration.setConfig(bk, bValue); + System.out.println("Config " + item + " set to " + bValue); + item.set(bValue); } } } @@ -307,7 +310,7 @@ public class CommandLineArgumentParser { } try { int timeout = Integer.parseInt(args.remove()); - Configuration.setConfig("decompilationTimeoutSingleMethod", timeout); + Configuration.decompilationTimeoutSingleMethod.set(timeout); } catch (NumberFormatException nex) { System.err.println("Bad timeout value"); } @@ -430,7 +433,7 @@ public class CommandLineArgumentParser { boolean exportOK; try { printHeader(); - SWF exfile = new SWF(new FileInputStream(inFile), Configuration.getConfig("parallelSpeedUp", true)); + SWF exfile = new SWF(new FileInputStream(inFile), Configuration.parallelSpeedUp.get()); final Level level = traceLevel; exfile.addEventListener(new EventListener() { @Override @@ -456,7 +459,7 @@ public class CommandLineArgumentParser { System.out.println("Exporting shapes..."); exfile.exportShapes(handler, outDir.getAbsolutePath() + File.separator + "shapes"); System.out.println("Exporting scripts..."); - exfile.exportActionScript(handler, outDir.getAbsolutePath() + File.separator + "scripts", allExportMode, Configuration.getConfig("parallelSpeedUp", true)); + exfile.exportActionScript(handler, outDir.getAbsolutePath() + File.separator + "scripts", allExportMode, Configuration.parallelSpeedUp.get()); System.out.println("Exporting movies..."); exfile.exportMovies(handler, outDir.getAbsolutePath() + File.separator + "movies"); System.out.println("Exporting sounds..."); @@ -480,7 +483,7 @@ public class CommandLineArgumentParser { case "pcodehex": case "hex": ExportMode exportMode = strToExportFormat(exportFormat); - boolean parallel = Configuration.getConfig("parallelSpeedUp", true); + boolean parallel = Configuration.parallelSpeedUp.get(); if (!args.isEmpty() && args.peek().equals("-selectas3class")) { args.remove(); exportOK = true; @@ -512,11 +515,11 @@ public class CommandLineArgumentParser { exportOK = true; break; case "fla": - exfile.exportFla(handler, outDir.getAbsolutePath(), inFile.getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.getConfig("parallelSpeedUp", true)); + exfile.exportFla(handler, outDir.getAbsolutePath(), inFile.getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get()); exportOK = true; break; case "xfl": - exfile.exportXfl(handler, outDir.getAbsolutePath(), inFile.getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.getConfig("parallelSpeedUp", true)); + exfile.exportXfl(handler, outDir.getAbsolutePath(), inFile.getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get()); exportOK = true; break; default: @@ -572,7 +575,7 @@ public class CommandLineArgumentParser { } try { Configuration.dump_tags = true; - Configuration.setConfig("parallelSpeedUp", false); + Configuration.parallelSpeedUp.set(false); SWF swf = Main.parseSWF(args.remove()); } catch (Exception ex) { Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/LinkLabel.java b/trunk/src/com/jpexs/decompiler/flash/gui/LinkLabel.java index 12046f776..4bab5db5b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/LinkLabel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/LinkLabel.java @@ -18,6 +18,8 @@ package com.jpexs.decompiler.flash.gui; import java.awt.Cursor; import java.awt.event.MouseEvent; +import java.io.IOException; +import java.net.URISyntaxException; import javax.swing.JLabel; /** @@ -78,7 +80,7 @@ public class LinkLabel extends JLabel { try { java.net.URI uri = new java.net.URI(getNormalText()); desktop.browse(uri); - } catch (Exception e) { + } catch (URISyntaxException | IOException e) { System.err.println(e.getMessage()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/LoadFromCacheFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/LoadFromCacheFrame.java index 6e1cdbe51..009cda1cd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/LoadFromCacheFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/LoadFromCacheFrame.java @@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.browsers.cache.CacheEntry; import com.jpexs.browsers.cache.CacheImplementation; import com.jpexs.browsers.cache.CacheReader; -import com.jpexs.decompiler.flash.Configuration; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.helpers.Helper; import com.jpexs.helpers.ReReadableInputStream; import java.awt.BorderLayout; @@ -238,11 +238,11 @@ public class LoadFromCacheFrame extends AppFrame implements ActionListener { List selected = list.getSelectedValuesList(); if (!selected.isEmpty()) { JFileChooser fc = new JFileChooser(); - fc.setCurrentDirectory(new File(Configuration.getConfig("lastSaveDir", "."))); + fc.setCurrentDirectory(new File(Configuration.lastSaveDir.get())); if (selected.size() > 1) { fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); } else { - fc.setSelectedFile(new File(Configuration.getConfig("lastSaveDir", "."), entryToFileName(selected.get(0)))); + fc.setSelectedFile(new File(Configuration.lastSaveDir.get(), entryToFileName(selected.get(0)))); fc.setFileFilter(new FileFilter() { @Override public boolean accept(File f) { @@ -269,7 +269,7 @@ public class LoadFromCacheFrame extends AppFrame implements ActionListener { Helper.saveStream(sel.getResponseDataStream(), new File(file, entryToFileName(sel))); } } - Configuration.setConfig("lastSaveDir", file.getParentFile().getAbsolutePath()); + Configuration.lastSaveDir.set(file.getParentFile().getAbsolutePath()); } catch (IOException ex) { View.showMessageDialog(null, translate("error.file.write")); } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java index 8d4329eb8..475fbf138 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java @@ -1,7 +1,7 @@ package com.jpexs.decompiler.flash.gui; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.helpers.Helper; import com.jpexs.helpers.LimitedInputStream; import com.jpexs.helpers.PosMarkedInputStream; @@ -31,6 +31,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ExecutionException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.BoxLayout; @@ -180,7 +181,7 @@ public class LoadFromMemoryFrame extends AppFrame implements ActionListener { if (((StateValue) evt.getNewValue()) == StateValue.DONE) { try { foundIs = wrk.get(); - } catch (Exception ex) { + } catch (InterruptedException | ExecutionException ex) { Logger.getLogger(LoadFromMemoryFrame.class.getName()).log(Level.SEVERE, null, ex); } if (foundIs == null) { @@ -335,11 +336,11 @@ public class LoadFromMemoryFrame extends AppFrame implements ActionListener { int[] selected = listRes.getSelectedIndices(); if (selected.length > 0) { JFileChooser fc = new JFileChooser(); - fc.setCurrentDirectory(new File(Configuration.getConfig("lastSaveDir", "."))); + fc.setCurrentDirectory(new File(Configuration.lastSaveDir.get())); if (selected.length > 1) { fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); } else { - fc.setSelectedFile(new File(Configuration.getConfig("lastSaveDir", "."), "movie.swf")); + fc.setSelectedFile(new File(Configuration.lastSaveDir.get(), "movie.swf")); fc.setFileFilter(new FileFilter() { @Override public boolean accept(File f) { @@ -370,7 +371,7 @@ public class LoadFromMemoryFrame extends AppFrame implements ActionListener { Helper.saveStream(bis, new File(file, "movie" + sel + ".swf")); } } - Configuration.setConfig("lastSaveDir", file.getParentFile().getAbsolutePath()); + Configuration.lastSaveDir.set(file.getParentFile().getAbsolutePath()); } catch (IOException ex) { View.showMessageDialog(null, translate("error.file.write")); } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java index 60a863ddc..0700cd782 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.decompiler.flash.ApplicationInfo; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.EventListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.Version; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.console.CommandLineArgumentParser; import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel; import com.jpexs.decompiler.flash.gui.proxy.ProxyFrame; @@ -50,7 +50,6 @@ import java.net.URLDecoder; import java.util.ArrayList; import java.util.Calendar; import java.util.Locale; -import java.util.Properties; import java.util.logging.ConsoleHandler; import java.util.logging.FileHandler; import java.util.logging.Handler; @@ -200,7 +199,7 @@ public class Main { public void progress(int p) { startWork(AppStrings.translate("work.reading.swf"), p); } - }, Configuration.getConfig("parallelSpeedUp", true)); + }, Configuration.parallelSpeedUp.get()); locswf.addEventListener(new EventListener() { @Override public void handleEvent(String event, Object data) { @@ -391,7 +390,7 @@ public class Main { public static boolean saveFileDialog() { JFileChooser fc = new JFileChooser(); - fc.setCurrentDirectory(new File(Configuration.getConfig("lastSaveDir", "."))); + fc.setCurrentDirectory(new File(Configuration.lastSaveDir.get())); FileFilter swfFilter = new FileFilter() { @Override public boolean accept(File f) { @@ -446,7 +445,7 @@ public class Main { swf.gfx = true; } Main.saveFile(fileName); - Configuration.setConfig("lastSaveDir", file.getParentFile().getAbsolutePath()); + Configuration.lastSaveDir.set(file.getParentFile().getAbsolutePath()); fileTitle = null; readOnly = false; return true; @@ -460,7 +459,7 @@ public class Main { public static boolean openFileDialog() { fileTitle = null; JFileChooser fc = new JFileChooser(); - fc.setCurrentDirectory(new File(Configuration.getConfig("lastOpenDir", "."))); + fc.setCurrentDirectory(new File(Configuration.lastOpenDir.get())); FileFilter allSupportedFilter = new FileFilter() { @Override public boolean accept(File f) { @@ -504,7 +503,7 @@ public class Main { View.setWindowIcon(f); int returnVal = fc.showOpenDialog(f); if (returnVal == JFileChooser.APPROVE_OPTION) { - Configuration.setConfig("lastOpenDir", Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath()); + Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath()); File selfile = Helper.fixDialogFile(fc.getSelectedFile()); Main.openFile(selfile.getAbsolutePath()); return true; @@ -657,7 +656,7 @@ public class Main { } private static void offerAssociation() { - boolean offered = Configuration.getConfig("offeredAssociation"); + boolean offered = Configuration.offeredAssociation.get(); if (!offered) { if (Platform.isWindows()) { if ((!isAddedToContextMenu()) && View.showConfirmDialog(null, "Do you want to add FFDec to context menu of SWF files?\n(Can be changed later from main menu)", "Context menu", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { @@ -665,11 +664,11 @@ public class Main { } } } - Configuration.setConfig("offeredAssociation", true); + Configuration.offeredAssociation.set(true); } public static void initLang() { - Locale.setDefault(Locale.forLanguageTag(Configuration.getConfig("locale", "en"))); + Locale.setDefault(Locale.forLanguageTag(Configuration.locale.get())); UIManager.put("OptionPane.okButtonText", AppStrings.translate("button.ok")); UIManager.put("OptionPane.yesButtonText", AppStrings.translate("button.yes")); UIManager.put("OptionPane.noButtonText", AppStrings.translate("button.no")); @@ -787,14 +786,13 @@ public class Main { */ public static void main(String[] args) throws IOException { startFreeMemThread(); - Configuration.loadConfig(); initLogging(Configuration.debugMode); initLang(); View.setLookAndFeel(); - if (Configuration.getConfig("cacheOnDisk", true)) { + if (Configuration.cacheOnDisk.get()) { Cache.setStorageType(Cache.STORAGE_FILES); } else { Cache.setStorageType(Cache.STORAGE_MEMORY); @@ -924,7 +922,7 @@ public class Main { } public static void autoCheckForUpdates() { - Calendar lastUpdatesCheckDate = Configuration.getConfig("lastUpdatesCheckDate", null); + Calendar lastUpdatesCheckDate = Configuration.lastUpdatesCheckDate.get(); if ((lastUpdatesCheckDate == null) || (lastUpdatesCheckDate.getTime().getTime() < Calendar.getInstance().getTime().getTime() - 1000 * 60 * 60 * 24)) { checkForUpdates(); } @@ -1014,13 +1012,13 @@ public class Main { if (!versions.isEmpty()) { NewVersionDialog newVersionDialog = new NewVersionDialog(versions); newVersionDialog.setVisible(true); - Configuration.setConfig("lastUpdatesCheckDate", Calendar.getInstance()); + Configuration.lastUpdatesCheckDate.set(Calendar.getInstance()); return true; } - } catch (Exception ex) { + } catch (IOException | NumberFormatException ex) { return false; } - Configuration.setConfig("lastUpdatesCheckDate", Calendar.getInstance()); + Configuration.lastUpdatesCheckDate.set(Calendar.getInstance()); return false; } private static FileHandler fileTxt; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 31eeecfa7..c55de9db9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; import com.jpexs.decompiler.flash.ApplicationInfo; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.FrameNode; import com.jpexs.decompiler.flash.PackageNode; import com.jpexs.decompiler.flash.SWF; @@ -31,6 +30,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitClass; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.parser.pcode.ASMParser; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.abc.ABCPanel; import com.jpexs.decompiler.flash.gui.abc.ClassesListTreeModel; import com.jpexs.decompiler.flash.gui.abc.DeobfuscationDialog; @@ -149,6 +149,7 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -556,10 +557,8 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T mainMenu.addMenuSeparator(); rib.setApplicationMenu(mainMenu); - - int w = Configuration.getConfig("gui.window.width", 1000); - - int h = Configuration.getConfig("gui.window.height", 700); + int w = Configuration.guiWindowWidth.get(); + int h = Configuration.guiWindowHeight.get(); Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); if (w > dim.width) { w = dim.width; @@ -569,8 +568,8 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T } setSize(w, h); - boolean maximizedHorizontal = Configuration.getConfig("gui.window.maximized.horizontal", false); - boolean maximizedVertical = Configuration.getConfig("gui.window.maximized.vertical", false); + boolean maximizedHorizontal = Configuration.guiWindowMaximizedHorizontal.get(); + boolean maximizedVertical = Configuration.guiWindowMaximizedVertical.get(); int state = 0; if (maximizedHorizontal) { @@ -586,8 +585,8 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T @Override public void windowStateChanged(WindowEvent e) { int state = e.getNewState(); - Configuration.setConfig("gui.window.maximized.horizontal", (state & JFrame.MAXIMIZED_HORIZ) == JFrame.MAXIMIZED_HORIZ); - Configuration.setConfig("gui.window.maximized.vertical", (state & JFrame.MAXIMIZED_VERT) == JFrame.MAXIMIZED_VERT); + Configuration.guiWindowMaximizedHorizontal.set((state & JFrame.MAXIMIZED_HORIZ) == JFrame.MAXIMIZED_HORIZ); + Configuration.guiWindowMaximizedVertical.set((state & JFrame.MAXIMIZED_VERT) == JFrame.MAXIMIZED_VERT); } }); addComponentListener(new ComponentAdapter() { @@ -595,10 +594,10 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T public void componentResized(ComponentEvent e) { int state = getExtendedState(); if ((state & JFrame.MAXIMIZED_HORIZ) == 0) { - Configuration.setConfig("gui.window.width", getWidth()); + Configuration.guiWindowWidth.set(getWidth()); } if ((state & JFrame.MAXIMIZED_VERT) == 0) { - Configuration.setConfig("gui.window.height", getHeight()); + Configuration.guiWindowHeight.set(getHeight()); } } }); @@ -683,7 +682,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T miDeobfuscation.addActionListener(this); //autoDeobfuscateMenuItem = new JCheckBoxMenuItem(translate("menu.settings.autodeobfuscation")); - miAutoDeobfuscation.setSelected(Configuration.getConfig("autoDeobfuscate", true)); + miAutoDeobfuscation.setSelected(Configuration.autoDeobfuscate.get()); miAutoDeobfuscation.addActionListener(this); miAutoDeobfuscation.setActionCommand("AUTODEOBFUSCATE"); @@ -714,7 +713,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T //miInternalViewer = new JCheckBox(translate("menu.settings.internalflashviewer")); boolean externalFlashPlayerUnavailable = flashPanel == null; - miInternalViewer.setSelected(Configuration.getConfig("internalFlashViewer", false) || externalFlashPlayerUnavailable); + miInternalViewer.setSelected(Configuration.internalFlashViewer.get() || externalFlashPlayerUnavailable); if (externalFlashPlayerUnavailable) { miInternalViewer.setEnabled(false); } @@ -722,7 +721,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T miInternalViewer.addActionListener(this); //miParallelSpeedUp = new JCheckBox(translate("menu.settings.parallelspeedup")); - miParallelSpeedUp.setSelected(Configuration.getConfig("parallelSpeedUp", true)); + miParallelSpeedUp.setSelected(Configuration.parallelSpeedUp.get()); miParallelSpeedUp.setActionCommand("PARALLELSPEEDUP"); miParallelSpeedUp.addActionListener(this); @@ -738,18 +737,18 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T menuBar.add(menuTools); //miDecompile = new JCheckBox(translate("menu.settings.disabledecompilation")); - miDecompile.setSelected(!Configuration.getConfig("decompile", true)); + miDecompile.setSelected(!Configuration.decompile.get()); miDecompile.setActionCommand("DISABLEDECOMPILATION"); miDecompile.addActionListener(this); //miCacheDisk = new JCheckBox(translate("menu.settings.cacheOnDisk")); - miCacheDisk.setSelected(Configuration.getConfig("cacheOnDisk", true)); + miCacheDisk.setSelected(Configuration.cacheOnDisk.get()); miCacheDisk.setActionCommand("CACHEONDISK"); miCacheDisk.addActionListener(this); // miGotoMainClassOnStartup = new JCheckBox(translate("menu.settings.gotoMainClassOnStartup")); - miGotoMainClassOnStartup.setSelected(Configuration.getConfig("gotoMainClassOnStartup", false)); + miGotoMainClassOnStartup.setSelected(Configuration.gotoMainClassOnStartup.get()); miGotoMainClassOnStartup.setActionCommand("GOTODOCUMENTCLASSONSTARTUP"); miGotoMainClassOnStartup.addActionListener(this); @@ -1476,7 +1475,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T @Override public void propertyChange(PropertyChangeEvent pce) { if (splitsInited) { - Configuration.setConfig("gui.splitPane1.dividerLocation", pce.getNewValue()); + Configuration.guiSplitPane1DividerLocation.set((int) pce.getNewValue()); } } }); @@ -1485,7 +1484,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T @Override public void propertyChange(PropertyChangeEvent pce) { if (detailPanel.isVisible()) { - Configuration.setConfig("gui.splitPane2.dividerLocation", pce.getNewValue()); + Configuration.guiSplitPane2DividerLocation.set((int) pce.getNewValue()); } } }); @@ -1518,7 +1517,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T if (!droppedFiles.isEmpty()) { Main.openFile(droppedFiles.get(0).getAbsolutePath()); } - } catch (Exception ex) { + } catch (UnsupportedFlavorException | IOException ex) { } } }); @@ -1632,8 +1631,8 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T mui.setNormalIcon(View.getResizableIcon("buttonicon_256")); mui.setClickIcon(View.getResizableIcon("buttonicon_down_256")); } - splitPane1.setDividerLocation(Configuration.getConfig("gui.splitPane1.dividerLocation", getWidth() / 3)); - int confDivLoc = Configuration.getConfig("gui.splitPane2.dividerLocation", splitPane2.getHeight() * 3 / 5); + splitPane1.setDividerLocation(Configuration.guiSplitPane1DividerLocation.get(getWidth() / 3)); + int confDivLoc = Configuration.guiSplitPane2DividerLocation.get(splitPane2.getHeight() * 3 / 5); if (confDivLoc > splitPane2.getHeight() - 10) { //In older releases, divider location was saved when detailPanel was invisible too confDivLoc = splitPane2.getHeight() * 3 / 5; } @@ -2192,7 +2191,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T for (int i = 0; i < tlsList.size(); i++) { ScriptPack tls = tlsList.get(i); Main.startWork(translate("work.exporting") + " " + (i + 1) + "/" + tlsList.size() + " " + tls.getPath() + " ..."); - ret.add(tls.export(selFile, abcList, exportMode, Configuration.getConfig("parallelSpeedUp", true))); + ret.add(tls.export(selFile, abcList, exportMode, Configuration.parallelSpeedUp.get())); } } else { List allNodes = new ArrayList<>(); @@ -2342,10 +2341,10 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T } break; case "GOTODOCUMENTCLASSONSTARTUP": - Configuration.setConfig("gotoMainClassOnStartup", miGotoMainClassOnStartup.isSelected()); + Configuration.gotoMainClassOnStartup.set(miGotoMainClassOnStartup.isSelected()); break; case "CACHEONDISK": - Configuration.setConfig("cacheOnDisk", miCacheDisk.isSelected()); + Configuration.cacheOnDisk.set(miCacheDisk.isSelected()); if (miCacheDisk.isSelected()) { Cache.setStorageType(Cache.STORAGE_FILES); } else { @@ -2356,7 +2355,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T new SelectLanguageDialog().display(); break; case "DISABLEDECOMPILATION": - Configuration.setConfig("decompile", !miDecompile.isSelected()); + Configuration.decompile.set(!miDecompile.isSelected()); clearCache(); if (abcPanel != null) { abcPanel.reload(); @@ -2389,13 +2388,13 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T confStr += " " + translate("message.confirm.off"); } if (View.showConfirmDialog(null, confStr, translate("message.parallel"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { - Configuration.setConfig("parallelSpeedUp", (Boolean) miParallelSpeedUp.isSelected()); + Configuration.parallelSpeedUp.set((Boolean) miParallelSpeedUp.isSelected()); } else { miParallelSpeedUp.setSelected(!miParallelSpeedUp.isSelected()); } break; case "INTERNALVIEWERSWITCH": - Configuration.setConfig("internalFlashViewer", miInternalViewer.isSelected()); + Configuration.internalFlashViewer.set(miInternalViewer.isSelected()); reload(true); break; case "SEARCHAS": @@ -2456,7 +2455,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T ImageTag it = (ImageTag) tagObj; if (it.importSupported()) { JFileChooser fc = new JFileChooser(); - fc.setCurrentDirectory(new File(Configuration.getConfig("lastOpenDir", "."))); + fc.setCurrentDirectory(new File(Configuration.lastOpenDir.get())); fc.setFileFilter(new FileFilter() { @Override public boolean accept(File f) { @@ -2476,7 +2475,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T View.setWindowIcon(f); int returnVal = fc.showOpenDialog(f); if (returnVal == JFileChooser.APPROVE_OPTION) { - Configuration.setConfig("lastOpenDir", Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath()); + Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath()); File selfile = Helper.fixDialogFile(fc.getSelectedFile()); byte[] data = Helper.readFile(selfile.getAbsolutePath()); try { @@ -2559,7 +2558,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T case "AUTODEOBFUSCATE": if (View.showConfirmDialog(this, translate("message.confirm.autodeobfuscate") + "\r\n" + (miAutoDeobfuscation.isSelected() ? translate("message.confirm.on") : translate("message.confirm.off")), translate("message.confirm"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { - Configuration.setConfig("autoDeobfuscate", miAutoDeobfuscation.isSelected()); + Configuration.autoDeobfuscate.set(miAutoDeobfuscation.isSelected()); clearCache(); if (abcPanel != null) { abcPanel.reload(); @@ -2656,7 +2655,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T break; case "EXPORTFLA": JFileChooser fc = new JFileChooser(); - String selDir = Configuration.getConfig("lastOpenDir", "."); + String selDir = Configuration.lastOpenDir.get(); fc.setCurrentDirectory(new File(selDir)); if (!selDir.endsWith(File.separator)) { selDir += File.separator; @@ -2693,7 +2692,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T View.setWindowIcon(f); int returnVal = fc.showSaveDialog(f); if (returnVal == JFileChooser.APPROVE_OPTION) { - Configuration.setConfig("lastOpenDir", Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath()); + Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath()); File sf = Helper.fixDialogFile(fc.getSelectedFile()); Main.startWork(translate("work.exporting.fla") + "..."); @@ -2710,9 +2709,9 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T Helper.freeMem(); try { if (compressed) { - swf.exportFla(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.getConfig("parallelSpeedUp", true)); + swf.exportFla(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get()); } else { - swf.exportXfl(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.getConfig("parallelSpeedUp", true)); + swf.exportXfl(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), ApplicationInfo.applicationName, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get()); } } catch (IOException ex) { View.showMessageDialog(null, translate("error.export") + ": " + ex.getLocalizedMessage(), translate("error"), JOptionPane.ERROR_MESSAGE); @@ -2729,7 +2728,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T export.setVisible(true); if (!export.cancelled) { JFileChooser chooser = new JFileChooser(); - chooser.setCurrentDirectory(new File(Configuration.getConfig("lastExportDir", "."))); + chooser.setCurrentDirectory(new File(Configuration.lastExportDir.get())); chooser.setDialogTitle(translate("export.select.directory")); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); @@ -2737,7 +2736,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T final long timeBefore = System.currentTimeMillis(); Main.startWork(translate("work.exporting") + "..."); final String selFile = Helper.fixDialogFile(chooser.getSelectedFile()).getAbsolutePath(); - Configuration.setConfig("lastExportDir", Helper.fixDialogFile(chooser.getSelectedFile()).getAbsolutePath()); + Configuration.lastExportDir.set(Helper.fixDialogFile(chooser.getSelectedFile()).getAbsolutePath()); final ExportMode exportMode = ExportMode.get(export.getOption(ExportDialog.OPTION_ACTIONSCRIPT)); final boolean isMp3OrWav = export.getOption(ExportDialog.OPTION_SOUNDS) == 0; final boolean isFormatted = export.getOption(ExportDialog.OPTION_TEXTS) == 1; @@ -2755,7 +2754,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T swf.exportMovies(errorHandler, selFile + File.separator + "movies"); swf.exportSounds(errorHandler, selFile + File.separator + "sounds", isMp3OrWav, isMp3OrWav); swf.exportBinaryData(errorHandler, selFile + File.separator + "binaryData"); - swf.exportActionScript(errorHandler, selFile, exportMode, Configuration.getConfig("parallelSpeedUp", true)); + swf.exportActionScript(errorHandler, selFile, exportMode, Configuration.parallelSpeedUp.get()); } } catch (Exception ex) { Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, "Error during export", ex); @@ -2786,7 +2785,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T try { java.net.URI uri = new java.net.URI(helpUsURL); desktop.browse(uri); - } catch (Exception ex) { + } catch (URISyntaxException | IOException ex) { } } else { View.showMessageDialog(null, translate("message.helpus").replace("%url%", helpUsURL)); @@ -2800,7 +2799,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T try { java.net.URI uri = new java.net.URI(homePageURL); desktop.browse(uri); - } catch (Exception ex) { + } catch (URISyntaxException | IOException ex) { } } else { View.showMessageDialog(null, translate("message.homepage").replace("%url%", homePageURL)); @@ -3485,7 +3484,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T } } - } catch (Exception ex) { + } catch (IOException | com.jpexs.decompiler.flash.action.parser.ParseException ex) { Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/NewVersionDialog.java b/trunk/src/com/jpexs/decompiler/flash/gui/NewVersionDialog.java index 11b778bc2..bdfe17126 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/NewVersionDialog.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/NewVersionDialog.java @@ -23,6 +23,8 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.IOException; +import java.net.URISyntaxException; import java.util.List; import javax.swing.BoxLayout; import javax.swing.JButton; @@ -120,7 +122,7 @@ public class NewVersionDialog extends AppDialog implements ActionListener { desktop.browse(uri); } Main.exit(); - } catch (Exception ex) { + } catch (URISyntaxException | IOException ex) { } } else { desktop = null; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/RenameDialog.java b/trunk/src/com/jpexs/decompiler/flash/gui/RenameDialog.java index fe56dede3..89eb7491d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/RenameDialog.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/RenameDialog.java @@ -16,8 +16,8 @@ */ package com.jpexs.decompiler.flash.gui; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.abc.RenameType; +import com.jpexs.decompiler.flash.configuration.Configuration; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.ActionEvent; @@ -55,7 +55,7 @@ public class RenameDialog extends AppDialog implements ActionListener { public RenameDialog() { setSize(300, 150); setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); - int renameType = Configuration.getConfig("lastRenameType", 1); + int renameType = Configuration.lastRenameType.get(); ButtonGroup group = new ButtonGroup(); group.add(typeNumberRadioButton); group.add(randomWordRadioButton); @@ -97,7 +97,7 @@ public class RenameDialog extends AppDialog implements ActionListener { switch (e.getActionCommand()) { case "OK": confirmed = true; - Configuration.setConfig("lastRenameType", (Integer) (getRenameType() == RenameType.TYPENUMBER ? 1 : 2)); + Configuration.lastRenameType.set((Integer) (getRenameType() == RenameType.TYPENUMBER ? 1 : 2)); setVisible(false); break; case "CANCEL": diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java b/trunk/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java index da3db55e5..7c51da21b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/SelectLanguageDialog.java @@ -16,7 +16,7 @@ */ package com.jpexs.decompiler.flash.gui; -import com.jpexs.decompiler.flash.Configuration; +import com.jpexs.decompiler.flash.configuration.Configuration; import java.awt.BorderLayout; import java.awt.Container; import java.awt.FlowLayout; @@ -50,7 +50,7 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener { cnt1.add(cnt, BorderLayout.CENTER); - String currentLanguage = Configuration.getConfig("locale", Locale.getDefault().getLanguage()); + String currentLanguage = Configuration.locale.get(Locale.getDefault().getLanguage()); boolean found = false; int enIndex = 0; for (String code : languages) { @@ -111,7 +111,7 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener { if (newLanguage.equals("en")) { newLanguage = ""; } - Configuration.setConfig("locale", newLanguage); + Configuration.locale.set(newLanguage); Locale.setDefault(Locale.forLanguageTag(newLanguage)); updateLanguage(); setVisible(false); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 04d3a40d3..7da993471 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.gui.abc; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.ClassPath; @@ -36,6 +35,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.abc.types.traits.Traits; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.gui.Freed; import com.jpexs.decompiler.flash.gui.HeaderLabel; @@ -64,6 +64,10 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; +import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; @@ -115,25 +119,45 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Fr ClassesListTreeModel clModel = (ClassesListTreeModel) classTree.getModel(); List> allpacks = clModel.getList(); found = new ArrayList<>(); - Pattern pat = null; - if (regexp) { - pat = Pattern.compile(txt, ignoreCase ? Pattern.CASE_INSENSITIVE : 0); - } else { - pat = Pattern.compile(Pattern.quote(txt), ignoreCase ? Pattern.CASE_INSENSITIVE : 0); - } + final Pattern pat = regexp ? + Pattern.compile(txt, ignoreCase ? Pattern.CASE_INSENSITIVE : 0) : + Pattern.compile(Pattern.quote(txt), ignoreCase ? Pattern.CASE_INSENSITIVE : 0); int pos = 0; - for (MyEntry item : allpacks) { + for (final MyEntry item : allpacks) { pos++; String workText = AppStrings.translate("work.searching"); String decAdd = ""; if (!decompiledTextArea.isCached(item.value)) { decAdd = ", " + AppStrings.translate("work.decompiling"); } - Main.startWork(workText + " \"" + txt + "\"" + decAdd + " - (" + pos + "/" + allpacks.size() + ") " + item.key.toString() + "... "); - decompiledTextArea.cacheScriptPack(item.value, list); - if (pat.matcher(decompiledTextArea.getCachedText(item.value)).find()) { - found.add(item.value); - foundPath.add(item.key); + + final AtomicReference> taskRef = new AtomicReference<>(); + Main.startWork(workText + " \"" + txt + "\"" + decAdd + " - (" + pos + "/" + allpacks.size() + ") " + item.key.toString() + "... ", new Runnable() { + + @Override + public void run() { + FutureTask task = taskRef.get(); + if (task != null) { + task.cancel(true); + } + } + }); + try { + Helper.cancellableCall(new Callable() { + @Override + public Void call() throws Exception { + decompiledTextArea.cacheScriptPack(item.value, list); + if (pat.matcher(decompiledTextArea.getCachedText(item.value)).find()) { + found.add(item.value); + foundPath.add(item.key); + } + return null; + } + }, taskRef); + } catch (InterruptedException ex) { + break; + } catch (ExecutionException ex) { + Logger.getLogger(ABCPanel.class.getName()).log(Level.SEVERE, null, ex); } } @@ -269,7 +293,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Fr } - splitPane.setDividerLocation(Configuration.getConfig("gui.avm2.splitPane.dividerLocation", splitPane.getWidth() * 1 / 2)); + splitPane.setDividerLocation(Configuration.guiAvm2SplitPaneDividerLocation.get(splitPane.getWidth() * 1 / 2)); } @@ -340,7 +364,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Fr splitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent pce) { - Configuration.setConfig("gui.avm2.splitPane.dividerLocation", pce.getNewValue()); + Configuration.guiAvm2SplitPaneDividerLocation.set((int) pce.getNewValue()); } }); decompiledTextArea.setContentType("text/actionscript"); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 4b0cd08d6..a2531cc04 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.gui.abc; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.ScriptPack; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; @@ -26,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction; import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.gui.View; import com.jpexs.decompiler.flash.helpers.HilightedText; @@ -38,6 +38,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.TimerTask; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.SwingUtilities; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; @@ -380,14 +382,14 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL return cache.contains(pack); } - private CachedDecompilation getCached(ScriptPack pack) { + private CachedDecompilation getCached(ScriptPack pack) throws InterruptedException { if (!cache.contains(pack)) { cacheScriptPack(pack, abcList); } return (CachedDecompilation) cache.get(pack); } - public String getCachedText(ScriptPack pack) { + public String getCachedText(ScriptPack pack) throws InterruptedException { return getCached(pack).text; } @@ -442,7 +444,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL cache.clear(); } - public void cacheScriptPack(ScriptPack scriptLeaf, List abcList) { + public void cacheScriptPack(ScriptPack scriptLeaf, List abcList) throws InterruptedException { int maxCacheSize = 50; int scriptIndex = scriptLeaf.scriptIndex; HilightedText hilightedCode = null; @@ -452,7 +454,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL script = abc.script_info[scriptIndex]; } if (!cache.contains(scriptLeaf)) { - boolean parallel = Configuration.getConfig("parallelSpeedUp", true); + boolean parallel = Configuration.parallelSpeedUp.get(); HilightedTextWriter writer = new HilightedTextWriter(true); scriptLeaf.toSource(writer, abcList, script.traits.traits, ExportMode.SOURCE, parallel); hilightedCode = new HilightedText(writer); @@ -481,21 +483,27 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL this.abc = abc; this.abcList = abcList; this.script = scriptLeaf; - - cacheScriptPack(scriptLeaf, abcList); - CachedDecompilation cd = getCached(scriptLeaf); - final String hilightedCode = cd.text; - highlights = cd.getInstructionHighlights(); - specialHighlights = cd.getSpecialHighligths(); - traitHighlights = cd.getTraitHighlights(); - methodHighlights = cd.getMethodHighlights(); - classHighlights = cd.getClassHighlights(); - if (hilightedCode.length() > 1024 * 1024 * 2/*2MB*/) { - setContentType("text/plain"); - } else { - setContentType("text/actionscript"); + CachedDecompilation cd = null; + try { + cacheScriptPack(scriptLeaf, abcList); + cd = getCached(scriptLeaf); + } catch (InterruptedException ex) { + Logger.getLogger(DecompiledEditorPane.class.getName()).log(Level.SEVERE, null, ex); + } + if (cd != null) { + final String hilightedCode = cd.text; + highlights = cd.getInstructionHighlights(); + specialHighlights = cd.getSpecialHighligths(); + traitHighlights = cd.getTraitHighlights(); + methodHighlights = cd.getMethodHighlights(); + classHighlights = cd.getClassHighlights(); + if (hilightedCode.length() > 1024 * 1024 * 2/*2MB*/) { + setContentType("text/plain"); + } else { + setContentType("text/actionscript"); + } + setText(hilightedCode); } - setText(hilightedCode); } public void reloadClass() { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java index c6085b0af..fb1c11ac8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java @@ -11,6 +11,8 @@ import com.jpexs.decompiler.flash.tags.ABCContainerTag; import com.jpexs.decompiler.graph.ExportMode; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @@ -68,20 +70,24 @@ public class TraitsListItem { @Override public String toString() { String s = ""; - if ((type != Type.INITIALIZER) && isStatic) { - abc.class_info[classIndex].static_traits.traits[index].convertHeader(null, "", abcTags, abc, true, ExportMode.SOURCE, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); - HilightedTextWriter writer = new HilightedTextWriter(false); - abc.class_info[classIndex].static_traits.traits[index].toStringHeader(null, "", abcTags, abc, true, ExportMode.SOURCE, scriptIndex, classIndex, writer, new ArrayList(), false); - s = writer.toString(); - } else if ((type != Type.INITIALIZER) && (!isStatic)) { - abc.instance_info[classIndex].instance_traits.traits[index].convertHeader(null, "", abcTags, abc, false, ExportMode.SOURCE, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); - HilightedTextWriter writer = new HilightedTextWriter(false); - abc.instance_info[classIndex].instance_traits.traits[index].toStringHeader(null, "", abcTags, abc, false, ExportMode.SOURCE, scriptIndex, classIndex, writer, new ArrayList(), false); - s = writer.toString(); - } else if (!isStatic) { - s = STR_INSTANCE_INITIALIZER; - } else { - s = STR_CLASS_INITIALIZER; + try { + if ((type != Type.INITIALIZER) && isStatic) { + abc.class_info[classIndex].static_traits.traits[index].convertHeader(null, "", abcTags, abc, true, ExportMode.SOURCE, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); + HilightedTextWriter writer = new HilightedTextWriter(false); + abc.class_info[classIndex].static_traits.traits[index].toStringHeader(null, "", abcTags, abc, true, ExportMode.SOURCE, scriptIndex, classIndex, writer, new ArrayList(), false); + s = writer.toString(); + } else if ((type != Type.INITIALIZER) && (!isStatic)) { + abc.instance_info[classIndex].instance_traits.traits[index].convertHeader(null, "", abcTags, abc, false, ExportMode.SOURCE, scriptIndex, classIndex, new NulWriter(), new ArrayList(), false); + HilightedTextWriter writer = new HilightedTextWriter(false); + abc.instance_info[classIndex].instance_traits.traits[index].toStringHeader(null, "", abcTags, abc, false, ExportMode.SOURCE, scriptIndex, classIndex, writer, new ArrayList(), false); + s = writer.toString(); + } else if (!isStatic) { + s = STR_INSTANCE_INITIALIZER; + } else { + s = STR_CLASS_INITIALIZER; + } + } catch (InterruptedException ex) { + Logger.getLogger(TraitsListItem.class.getName()).log(Level.SEVERE, null, ex); } s = s.replaceAll("[ \r\n]+", " "); return s; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java index fd2a73d60..cc4039807 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java @@ -20,6 +20,8 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.usages.MultinameUsage; import com.jpexs.decompiler.flash.tags.ABCContainerTag; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.DefaultListModel; /** @@ -39,13 +41,23 @@ public class UsageListModel extends DefaultListModel { @Override @SuppressWarnings("unchecked") public Object get(int index) { - return ((MultinameUsage) super.get(index)).toString(abcTags, abc); + try { + return ((MultinameUsage) super.get(index)).toString(abcTags, abc); + } catch (InterruptedException ex) { + Logger.getLogger(UsageListModel.class.getName()).log(Level.SEVERE, null, ex); + } + return null; } @Override @SuppressWarnings("unchecked") public Object getElementAt(int index) { - return ((MultinameUsage) super.getElementAt(index)).toString(abcTags, abc); + try { + return ((MultinameUsage) super.getElementAt(index)).toString(abcTags, abc); + } catch (InterruptedException ex) { + Logger.getLogger(UsageListModel.class.getName()).log(Level.SEVERE, null, ex); + } + return null; } @SuppressWarnings("unchecked") diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index af8c4f48d..dabd5f320 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.gui.action; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.TagNode; @@ -27,6 +26,7 @@ import com.jpexs.decompiler.flash.action.parser.pcode.ASMParser; import com.jpexs.decompiler.flash.action.parser.script.ActionScriptParser; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.gui.GraphFrame; import com.jpexs.decompiler.flash.gui.HeaderLabel; @@ -172,7 +172,7 @@ public class ActionPanel extends JPanel implements ActionListener { return cache.contains(src); } - private void cacheScript(ASMSource src, List actions) { + private void cacheScript(ASMSource src, List actions) throws InterruptedException { if (!cache.contains(src)) { if (actions == null) { actions = src.getActions(SWF.DEFAULT_VERSION); @@ -227,8 +227,11 @@ public class ActionPanel extends JPanel implements ActionListener { decAdd = ", " + AppStrings.translate("work.decompiling"); } Main.startWork(workText + " \"" + txt + "\"" + decAdd + " - (" + pos + "/" + asms.size() + ") " + item.getKey() + "... "); - - cacheScript(item.getValue(), null); + try { + cacheScript(item.getValue(), null); + } catch (InterruptedException ex) { + break; + } if (pat.matcher(getCached(item.getValue()).text).find()) { found.add(item.getValue()); } @@ -356,7 +359,7 @@ public class ActionPanel extends JPanel implements ActionListener { @Override public Void call() throws Exception { editor.setText("; " + AppStrings.translate("work.disassembling") + "..."); - if (Configuration.getConfig("decompile", true)) { + if (Configuration.decompile.get()) { decompiledEditor.setText("//" + AppStrings.translate("work.waitingfordissasembly") + "..."); } DisassemblyListener listener = getDisassemblyListener(); @@ -368,7 +371,7 @@ public class ActionPanel extends JPanel implements ActionListener { srcNoHex = null; srcHexOnly = null; setHex(getExportMode()); - if (Configuration.getConfig("decompile", true)) { + if (Configuration.decompile.get()) { decompiledEditor.setText("//" + AppStrings.translate("work.decompiling") + "..."); if (!useCache) { uncache(asm); @@ -538,7 +541,7 @@ public class ActionPanel extends JPanel implements ActionListener { splitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent pce) { - Configuration.setConfig("gui.action.splitPane.dividerLocation", pce.getNewValue()); + Configuration.guiActionSplitPaneDividerLocation.set((int) pce.getNewValue()); } }); editor.setContentType("text/flasm"); @@ -604,7 +607,7 @@ public class ActionPanel extends JPanel implements ActionListener { } public void initSplits() { - int split = Configuration.getConfig("gui.action.splitPane.dividerLocation", getWidth() / 2); + int split = Configuration.guiActionSplitPaneDividerLocation.get(getWidth() / 2); if (split == 0) { split = getWidth() / 2; } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/proxy/ProxyFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/proxy/ProxyFrame.java index bb3a31bab..a714bcbf3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/proxy/ProxyFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/proxy/ProxyFrame.java @@ -16,7 +16,7 @@ */ package com.jpexs.decompiler.flash.gui.proxy; -import com.jpexs.decompiler.flash.Configuration; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.AppFrame; import com.jpexs.decompiler.flash.gui.Main; import com.jpexs.decompiler.flash.gui.View; diff --git a/trunk/src/com/jpexs/decompiler/flash/helpers/HilightedTextWriter.java b/trunk/src/com/jpexs/decompiler/flash/helpers/HilightedTextWriter.java index 49cfacb95..24bf393e4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/helpers/HilightedTextWriter.java +++ b/trunk/src/com/jpexs/decompiler/flash/helpers/HilightedTextWriter.java @@ -16,7 +16,7 @@ */ package com.jpexs.decompiler.flash.helpers; -import com.jpexs.decompiler.flash.Configuration; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.helpers.Helper; diff --git a/trunk/src/com/jpexs/decompiler/flash/helpers/hilight/Highlighting.java b/trunk/src/com/jpexs/decompiler/flash/helpers/hilight/Highlighting.java index 3e8741941..b569d7f4b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/helpers/hilight/Highlighting.java +++ b/trunk/src/com/jpexs/decompiler/flash/helpers/hilight/Highlighting.java @@ -16,7 +16,7 @@ */ package com.jpexs.decompiler.flash.helpers.hilight; -import com.jpexs.decompiler.flash.Configuration; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.HilightType; import java.io.Serializable; import java.util.List; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java index b6e210000..44a5d5157 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java @@ -16,12 +16,12 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.Layer; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.CopyOutputStream; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.ButtonTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index a14f6bd5d..57af72f96 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.Layer; import com.jpexs.decompiler.flash.SWF; @@ -25,6 +24,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.ActionListReader; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.BoundedTag; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java index 310098c2f..587f8012c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java @@ -16,11 +16,11 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.CopyOutputStream; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.types.KERNINGRECORD; import com.jpexs.decompiler.flash.types.LANGCODE; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index c9cb4ec97..97d29fd9c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -16,11 +16,11 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.CopyOutputStream; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.Container; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java index adc6a9e4c..5ddc42991 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java @@ -16,12 +16,12 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.CopyOutputStream; +import com.jpexs.decompiler.flash.configuration.Configuration; import java.io.*; import java.util.List; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java index 9a991f8f3..3329cf7fb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java @@ -16,11 +16,11 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.CopyOutputStream; +import com.jpexs.decompiler.flash.configuration.Configuration; import java.io.*; import java.util.List; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java index eff0597a7..435241247 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java @@ -16,11 +16,11 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.CopyOutputStream; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; import com.jpexs.decompiler.flash.tags.base.Container; import com.jpexs.decompiler.flash.tags.base.ContainerItem; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java index 171cb3123..b69e71fa1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java @@ -16,12 +16,12 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.EndOfStreamException; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.CopyOutputStream; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; import com.jpexs.decompiler.flash.tags.base.Container; import com.jpexs.decompiler.flash.tags.base.ContainerItem; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java index c4ff203b7..29c594468 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java @@ -16,12 +16,12 @@ */ package com.jpexs.decompiler.flash.tags; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.EndOfStreamException; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.CopyOutputStream; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; import com.jpexs.decompiler.flash.tags.base.Container; import com.jpexs.decompiler.flash.tags.base.ContainerItem; diff --git a/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index 58d44346f..8d3256b74 100644 --- a/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/trunk/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -120,7 +120,9 @@ import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.OutputKeys; import javax.xml.transform.Source; import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import org.xml.sax.Attributes; @@ -1113,7 +1115,11 @@ public class XFLConverter { private static String convertActionScript(ASMSource as) { HilightedTextWriter writer = new HilightedTextWriter(false); - Action.actionsToSource(as, as.getActions(SWF.DEFAULT_VERSION), SWF.DEFAULT_VERSION, as.toString(), writer); + try { + Action.actionsToSource(as, as.getActions(SWF.DEFAULT_VERSION), SWF.DEFAULT_VERSION, as.toString(), writer); + } catch (InterruptedException ex) { + Logger.getLogger(XFLConverter.class.getName()).log(Level.SEVERE, null, ex); + } return writer.toString(); } @@ -1570,7 +1576,7 @@ public class XFLConverter { transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); transformer.transform(xmlInput, xmlOutput); return xmlOutput.getWriter().toString(); - } catch (Exception e) { + } catch (TransformerFactoryConfigurationError | IllegalArgumentException | TransformerException e) { System.err.println(input); Logger.getLogger(XFLConverter.class.getName()).log(Level.SEVERE, "Pretty print error", e); return input; @@ -3032,7 +3038,7 @@ public class XFLConverter { html = "" + html + ""; reader.parse(new InputSource(new InputStreamReader(new ByteArrayInputStream(html.getBytes("UTF-8")), "UTF-8")));*/ - } catch (Exception e) { + } catch (SAXException | IOException e) { Logger.getLogger(XFLConverter.class.getName()).log(Level.SEVERE, "Error while converting HTML", e); } return tparser.result; diff --git a/trunk/src/com/jpexs/decompiler/graph/Graph.java b/trunk/src/com/jpexs/decompiler/graph/Graph.java index 58feca16a..03f1fd061 100644 --- a/trunk/src/com/jpexs/decompiler/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/graph/Graph.java @@ -96,7 +96,7 @@ public class Graph { } } catch (InterruptedException ex) { throw ex; - } catch (Exception | Error ex) { + } catch (Error ex) { String s = ex.toString(); //ignore } @@ -1353,6 +1353,9 @@ public class Graph { } protected List printGraph(List visited, List localData, Stack stack, List allParts, GraphPart parent, GraphPart part, List stopPart, List loops, List ret, int staticOperation, String path) throws InterruptedException { + if (Thread.interrupted()) { + throw new InterruptedException(); + } if (stopPart == null) { stopPart = new ArrayList<>(); } @@ -2149,7 +2152,7 @@ public class Graph { * @param localData * @return String */ - public static GraphTextWriter graphToString(List tree, GraphTextWriter writer, LocalData localData) { + public static GraphTextWriter graphToString(List tree, GraphTextWriter writer, LocalData localData) throws InterruptedException { for (GraphTargetItem ti : tree) { if (!ti.isEmpty()) { ti.toStringSemicoloned(writer, localData).newLine(); diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphPart.java b/trunk/src/com/jpexs/decompiler/graph/GraphPart.java index a21275278..6f05914ca 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphPart.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphPart.java @@ -61,7 +61,7 @@ public class GraphPart implements Serializable { } private boolean leadsTo(List localData, Graph gr, GraphSource code, GraphPart part, List visited, List loops) throws InterruptedException { - if (Thread.currentThread().isInterrupted()) { + if (Thread.interrupted()) { throw new InterruptedException(); } diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java index 9b01c7c05..410c1736b 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -84,7 +84,7 @@ public abstract class GraphTargetItem implements Serializable { return ret; } - public GraphTextWriter toStringSemicoloned(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter toStringSemicoloned(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.startOffset(src, pos); appendTo(writer, localData); if (needsSemicolon()) { @@ -103,16 +103,16 @@ public abstract class GraphTargetItem implements Serializable { return this.getClass().getName(); } - public GraphTextWriter toString(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter toString(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.startOffset(src, pos); appendTo(writer, localData); writer.endOffset(); return writer; } - protected abstract GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData); + protected abstract GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException; - public String toString(LocalData localData) { + public String toString(LocalData localData) throws InterruptedException { HilightedTextWriter writer = new HilightedTextWriter(false); toString(writer, localData); return writer.toString(); @@ -149,14 +149,14 @@ public abstract class GraphTargetItem implements Serializable { return toString(); } - public GraphTextWriter toStringNoQuotes(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter toStringNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.startOffset(src, pos); appendToNoQuotes(writer, localData); writer.endOffset(); return writer; } - protected GraphTextWriter appendToNoQuotes(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendToNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { return toString(writer, localData); } @@ -172,7 +172,7 @@ public abstract class GraphTargetItem implements Serializable { return false; } - public GraphTextWriter toStringNL(GraphTextWriter writer, LocalData localData) { + public GraphTextWriter toStringNL(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.startOffset(src, pos); appendTo(writer, localData); if (needsNewLine()) { diff --git a/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java b/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java index f5e17c1fd..08cb226c6 100644 --- a/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/NotCompileTimeItem.java @@ -46,7 +46,7 @@ public class NotCompileTimeItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return object.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java index e3f45b7b0..61ace8ac9 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java @@ -47,7 +47,7 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (leftSide.getPrecedence() > precedence) { writer.append("("); leftSide.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java index 983844baf..07c8fd43b 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java @@ -37,7 +37,7 @@ public class BlockItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("{").newLine(); writer.indent(); Graph.graphToString(commands, writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java b/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java index b9d3e3bca..b6baecea6 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java @@ -36,7 +36,7 @@ public class CommaExpressionItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { boolean first = true; for (GraphTargetItem t : commands) { if (!first) { diff --git a/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java b/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java index 1ab5d0523..44924dfcd 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java @@ -52,7 +52,7 @@ public class DoWhileItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter)writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java b/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java index 3f9f7b779..a4f40c514 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java @@ -39,7 +39,7 @@ public class DuplicateItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { return value.toString(writer, localData); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java index fa17d6322..6cc017ae0 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java @@ -53,7 +53,7 @@ public class ForItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter)writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java b/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java index 5d9ac8210..bb1e6ebbe 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java @@ -51,7 +51,7 @@ public class IfItem extends GraphTargetItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { GraphTargetItem expr = expression; List ifBranch = onTrue; List elseBranch = onFalse; diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java index 33217e10f..e3c7b9a5d 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java @@ -34,7 +34,7 @@ public class ParenthesisItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append("("); value.toString(writer, localData); return writer.append(")"); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java b/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java index 5831aec68..4e7dd3f3c 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java @@ -59,7 +59,7 @@ public class SwitchItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter)writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_SWITCH); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java index 17169ce26..bfa19e136 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java @@ -36,7 +36,7 @@ public class TernarOpItem extends GraphTargetItem { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { expression.toString(writer, localData); writer.append("?"); onTrue.toString(writer, localData); diff --git a/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java index 6b5f723a4..9b2651739 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java @@ -34,7 +34,7 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { writer.append(operator); if (value != null) { if (value.precedence > precedence) { diff --git a/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java b/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java index a8364e3e9..71b85754e 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/UniversalLoopItem.java @@ -45,7 +45,7 @@ public class UniversalLoopItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter)writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java b/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java index d93312855..324115466 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java @@ -47,7 +47,7 @@ public class WhileItem extends LoopItem implements Block { } @Override - protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { + protected GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { if (writer instanceof NulWriter) { ((NulWriter)writer).startLoop(loop.id, LoopWithType.LOOP_TYPE_LOOP); } diff --git a/trunk/src/com/jpexs/helpers/Helper.java b/trunk/src/com/jpexs/helpers/Helper.java index 2e50e2288..545f25c4d 100644 --- a/trunk/src/com/jpexs/helpers/Helper.java +++ b/trunk/src/com/jpexs/helpers/Helper.java @@ -41,12 +41,14 @@ import java.util.List; import java.util.Scanner; import java.util.Stack; import java.util.concurrent.Callable; +import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.FutureTask; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; @@ -346,7 +348,7 @@ public class Helper { copy = ois.readObject(); } return copy; - } catch (Exception ex) { + } catch (IOException | ClassNotFoundException ex) { Logger.getLogger(Helper.class.getName()).log(Level.SEVERE, "Copy error", ex); return null; } @@ -404,7 +406,7 @@ public class Helper { // return str.replaceAll("([^\r\n]*)(\r?\n)", "; $1$2"); //} - public static String stackToString(Stack stack, LocalData localData) { + public static String stackToString(Stack stack, LocalData localData) throws InterruptedException { String ret = "["; for (int i = stack.size() - 1; i >= 0; i--) { if (i < stack.size() - 1) { @@ -513,13 +515,15 @@ public class Helper { ((Collection) v).clear(); } if (v instanceof Component) { - ((Component) v).getParent().remove((Component) v); + if (((Component) v).getParent() != null) { + ((Component) v).getParent().remove((Component) v); + } } if (v instanceof Freed) { ((Freed) v).free(); } f.set(obj, null); - } catch (Exception ex) { + } catch (SecurityException | IllegalArgumentException | IllegalAccessException ex) { } } } @@ -660,6 +664,24 @@ public class Helper { return task; } + public static T cancellableCall(final Callable c, final AtomicReference> cancellation) throws InterruptedException, ExecutionException { + FutureTask task = new FutureTask<>(new Callable() { + + @Override + public T call() throws Exception { + T t = c.call(); + return t; + } + }); + cancellation.set(task); + THREAD_POOL.execute(task); + try { + return task.get(); + } catch (CancellationException ex) { + throw new InterruptedException(); + } + } + public static boolean contains(int[] array, int value) { for (int i : array) { if (i == value) { @@ -679,8 +701,4 @@ public class Helper { } } } - - public static List timedCall(Callable> callable, int DECOMPILATION_TIMEOUT) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } }