diff --git a/trunk/src/com/jpexs/decompiler/graph/Graph.java b/trunk/src/com/jpexs/decompiler/graph/Graph.java index 03f1fd061..aa04faaf4 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 (Error ex) { + } catch (Exception | Error ex) { String s = ex.toString(); //ignore } diff --git a/trunk/test/com/jpexs/decompiler/flash/ActionScript2AssemblerTest.java b/trunk/test/com/jpexs/decompiler/flash/ActionScript2AssemblerTest.java index b39d9d037..dd661f979 100644 --- a/trunk/test/com/jpexs/decompiler/flash/ActionScript2AssemblerTest.java +++ b/trunk/test/com/jpexs/decompiler/flash/ActionScript2AssemblerTest.java @@ -3,12 +3,15 @@ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.parser.ParseException; import com.jpexs.decompiler.flash.action.parser.pcode.ASMParser; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.flash.tags.DoActionTag; import com.jpexs.decompiler.graph.ExportMode; import java.io.FileInputStream; import java.io.IOException; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -21,7 +24,7 @@ public class ActionScript2AssemblerTest extends ActionStript2TestBase { @BeforeClass public void init() throws IOException { - Configuration.setConfig("autoDeobfuscate", false); + Configuration.autoDeobfuscate.set(false); swf = new SWF(new FileInputStream("testdata/as2/as2.swf"), false); } @@ -49,7 +52,7 @@ public class ActionScript2AssemblerTest extends ActionStript2TestBase { assertEquals(actualResult.trim(), "ok = false;"); assertTrue(decompiled.contains("Push \"ok\" false")); - } catch (IOException | ParseException ex) { + } catch (IOException | ParseException | InterruptedException ex) { fail(); } } diff --git a/trunk/test/com/jpexs/decompiler/flash/ActionScript2DeobfuscatorTest.java b/trunk/test/com/jpexs/decompiler/flash/ActionScript2DeobfuscatorTest.java index 3134f3cd2..f882fac5c 100644 --- a/trunk/test/com/jpexs/decompiler/flash/ActionScript2DeobfuscatorTest.java +++ b/trunk/test/com/jpexs/decompiler/flash/ActionScript2DeobfuscatorTest.java @@ -19,11 +19,14 @@ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.parser.ParseException; import com.jpexs.decompiler.flash.action.parser.pcode.ASMParser; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.flash.tags.DoActionTag; import java.io.FileInputStream; import java.io.IOException; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -36,7 +39,7 @@ public class ActionScript2DeobfuscatorTest extends ActionStript2TestBase { @BeforeClass public void init() throws IOException { - Configuration.setConfig("autoDeobfuscate", true); + Configuration.autoDeobfuscate.set(true); swf = new SWF(new FileInputStream("testdata/as2/as2.swf"), false); } @@ -79,7 +82,7 @@ public class ActionScript2DeobfuscatorTest extends ActionStript2TestBase { String actualResult = writer.toString(); assertTrue(actualResult.contains("case \"c\":")); - } catch (IOException | ParseException ex) { + } catch (IOException | ParseException | InterruptedException ex) { fail(); } } diff --git a/trunk/test/com/jpexs/decompiler/flash/ActionScript2Test.java b/trunk/test/com/jpexs/decompiler/flash/ActionScript2Test.java index ffcde234a..3b58ff7c9 100644 --- a/trunk/test/com/jpexs/decompiler/flash/ActionScript2Test.java +++ b/trunk/test/com/jpexs/decompiler/flash/ActionScript2Test.java @@ -17,12 +17,15 @@ 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.HilightedTextWriter; import com.jpexs.decompiler.flash.tags.DoActionTag; import com.jpexs.decompiler.flash.tags.ShowFrameTag; import com.jpexs.decompiler.flash.tags.Tag; import java.io.FileInputStream; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; import static org.testng.Assert.*; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -35,7 +38,7 @@ public class ActionScript2Test extends ActionStript2TestBase { @BeforeClass public void init() throws IOException { - Configuration.setConfig("autoDeobfuscate", false); + Configuration.autoDeobfuscate.set(false); swf = new SWF(new FileInputStream("testdata/as2/as2.swf"), false); } @@ -43,7 +46,11 @@ public class ActionScript2Test extends ActionStript2TestBase { DoActionTag doa = getFrameSource(frame); assertNotNull(doa); HilightedTextWriter writer = new HilightedTextWriter(false); - Action.actionsToSource(doa, doa.getActions(swf.version), swf.version, "", writer); + try { + Action.actionsToSource(doa, doa.getActions(swf.version), swf.version, "", writer); + } catch (InterruptedException ex) { + fail(); + } String actualResult = writer.toString().replaceAll("[ \r\n]", ""); expectedResult = expectedResult.replaceAll("[ \r\n]", ""); assertEquals(actualResult, expectedResult); diff --git a/trunk/test/com/jpexs/decompiler/flash/ActionScript3Test.java b/trunk/test/com/jpexs/decompiler/flash/ActionScript3Test.java index 51cfdea45..5dcba8034 100644 --- a/trunk/test/com/jpexs/decompiler/flash/ActionScript3Test.java +++ b/trunk/test/com/jpexs/decompiler/flash/ActionScript3Test.java @@ -1,6 +1,7 @@ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.flash.tags.DoABCDefineTag; import com.jpexs.decompiler.flash.tags.Tag; @@ -38,13 +39,18 @@ public class ActionScript3Test { clsIndex = tag.getABC().findClassByName("classes.Test"); assertTrue(clsIndex > -1); this.abc = tag.getABC(); - Configuration.setConfig("autoDeobfuscate", false); + Configuration.autoDeobfuscate.set(false); } private void decompileMethod(String methodName, String expectedResult, boolean isStatic) { int bodyIndex = abc.findMethodBodyByName(clsIndex, methodName); assertTrue(bodyIndex > -1); - HilightedTextWriter writer = abc.bodies[bodyIndex].toString(methodName, ExportMode.SOURCE, isStatic, -1/*FIX?*/, clsIndex, abc,null, abc.constants, abc.method_info, new Stack(), false, new ArrayList(), abc.instance_info[clsIndex].instance_traits); + HilightedTextWriter writer = null; + try { + writer = abc.bodies[bodyIndex].toString(methodName, ExportMode.SOURCE, isStatic, -1/*FIX?*/, clsIndex, abc,null, abc.constants, abc.method_info, new Stack(), false, new ArrayList(), abc.instance_info[clsIndex].instance_traits); + } catch (InterruptedException ex) { + fail(); + } String actualResult = writer.toString().replaceAll("[ \r\n]", ""); expectedResult = expectedResult.replaceAll("[ \r\n]", ""); assertEquals(actualResult, expectedResult); diff --git a/trunk/test/com/jpexs/decompiler/flash/ExportTest.java b/trunk/test/com/jpexs/decompiler/flash/ExportTest.java index 16e02761e..a791a465d 100644 --- a/trunk/test/com/jpexs/decompiler/flash/ExportTest.java +++ b/trunk/test/com/jpexs/decompiler/flash/ExportTest.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.graph.ExportMode; import java.io.File; import java.io.FileInputStream; @@ -39,7 +40,7 @@ public class ExportTest { @BeforeClass public void addLogger() { - Configuration.setConfig("autoDeobfuscate", true); + Configuration.autoDeobfuscate.set(true); Logger logger = Logger.getLogger(""); logger.addHandler(new Handler() { @Override diff --git a/trunk/test/com/jpexs/decompiler/flash/RecompileTest.java b/trunk/test/com/jpexs/decompiler/flash/RecompileTest.java index da4981161..0962bd39b 100644 --- a/trunk/test/com/jpexs/decompiler/flash/RecompileTest.java +++ b/trunk/test/com/jpexs/decompiler/flash/RecompileTest.java @@ -1,6 +1,7 @@ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.abc.NotSameException; +import com.jpexs.decompiler.flash.configuration.Configuration; import java.io.*; import static org.testng.Assert.*; import org.testng.annotations.Test; diff --git a/trunk/test/com/jpexs/decompiler/flash/generators/AS2Generator.java b/trunk/test/com/jpexs/decompiler/flash/generators/AS2Generator.java index 52aed3b36..96fb874f1 100644 --- a/trunk/test/com/jpexs/decompiler/flash/generators/AS2Generator.java +++ b/trunk/test/com/jpexs/decompiler/flash/generators/AS2Generator.java @@ -1,8 +1,8 @@ package com.jpexs.decompiler.flash.generators; -import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.flash.tags.DoABCDefineTag; import com.jpexs.decompiler.flash.tags.DoActionTag; @@ -20,7 +20,7 @@ import java.io.FileOutputStream; public class AS2Generator { public static void main(String[] args) throws Exception { - Configuration.setConfig("autoDeobfuscate", false); + Configuration.autoDeobfuscate.set(false); SWF swf = new SWF(new FileInputStream("testdata/as2/as2.swf"), false); DoABCDefineTag tag = null; DoActionTag doa = null; diff --git a/trunk/test/com/jpexs/decompiler/flash/generators/AS3Generator.java b/trunk/test/com/jpexs/decompiler/flash/generators/AS3Generator.java index b20d0f6ab..1d3163f24 100644 --- a/trunk/test/com/jpexs/decompiler/flash/generators/AS3Generator.java +++ b/trunk/test/com/jpexs/decompiler/flash/generators/AS3Generator.java @@ -1,10 +1,10 @@ package com.jpexs.decompiler.flash.generators; -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.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; +import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.flash.tags.DoABCDefineTag; import com.jpexs.decompiler.flash.tags.Tag; @@ -24,7 +24,7 @@ import java.util.Stack; public class AS3Generator { public static void main(String[] args) throws Exception { - Configuration.setConfig("autoDeobfuscate", false); + Configuration.autoDeobfuscate.set(false); SWF swf = new SWF(new FileInputStream("testdata/as3/as3.swf"),false); DoABCDefineTag tag = null; for (Tag t : swf.tags) {