diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dde4aee9..e80416d3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. - [#2639] Export to FLA - missing sound streams - Debugger - Threading issues with multiple SWFs - Debugger - Reading variables on 64bit flash players (like in browsers) +- AS3 slow decompilation caused by ambiguios namespace detection ## [25.1.1] - 2026-02-19 ### Fixed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java index d11202dfd..ce5f3d82e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java @@ -231,8 +231,9 @@ public class FullMultinameAVM2Item extends AVM2Item { String identifier = IdentifiersDeobfuscation.printIdentifier(localData.abc.getSwf(), localData.usedDeobfuscations, true, nsname); writer.hilightSpecial(identifier, HighlightSpecialType.TYPE_NAME, customNs.toRawString()); writer.appendNoHilight("::"); - } else { - if (parentType instanceof TypeItem) { //not ApplyTypeAVM2Item or UnboundedTypeItem + } else { + //FIXME!! This is slow, should be moved to indexing + if (false && parentType instanceof TypeItem) { //not ApplyTypeAVM2Item or UnboundedTypeItem String rawName = constants.getMultiname(multinameIndex).getName(localData.usedDeobfuscations, localData.abc, localData.abc.constants, fullyQualifiedNames, true, true); List defs = new ArrayList<>(); List staticRef = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/as3decompile/ActionScript3ClassTest.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/as3decompile/ActionScript3ClassTest.java index c4e261b06..e0dcb108f 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/as3decompile/ActionScript3ClassTest.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/as3decompile/ActionScript3ClassTest.java @@ -133,84 +133,69 @@ public class ActionScript3ClassTest extends ActionScript3DecompileTestBase { public void testMyPackage1TestClass2() { decompileScriptPack("standard", "tests_classes.mypackage1.TestClass2", "package tests_classes.mypackage1\n" + "{\n" - + " import tests_classes.mypackage2.TestClass;\n" - + " import tests_classes.mypackage3.TestClass;\n" - + " \n" - + " use namespace myNamespace;\n" - + " \n" - + " public class TestClass2\n" - + " {\n" - + " \n" - + " public function TestClass2()\n" - + " {\n" - + " super();\n" - + " }\n" - + " \n" - + " myNamespace static function testCall5() : String\n" - + " {\n" - + " return \"x\";\n" - + " }\n" - + " \n" - + " protected static function testCall5() : String\n" - + " {\n" - + " return \"5\";\n" - + " }\n" - + " \n" - + " public function testCall() : String\n" - + " {\n" - + " var a:tests_classes.mypackage1.TestClass = null;\n" - + " var b:tests_classes.mypackage2.TestClass = null;\n" - + " var c:tests_classes.mypackage3.TestClass = null;\n" - + " a = new tests_classes.mypackage1.TestClass();\n" - + " b = new tests_classes.mypackage2.TestClass();\n" - + " c = new tests_classes.mypackage3.TestClass();\n" - + " var res:String = a.testCall() + b.testCall() + c.testCall() + this.public::testCall2() + this.private::testCall3() + this.protected::testCall4() + protected::testCall5() + this.internal::testCall6() + myNamespace::testCall3();\n" - + " trace(res);\n" - + " return res;\n" - + " }\n" - + " \n" - + " myNamespace function testCall2() : String\n" - + " {\n" - + " return \"1\";\n" - + " }\n" - + " \n" - + " myNamespace function testCall3() : String\n" - + " {\n" - + " return myNamespace::testCall2();\n" - + " }\n" - + " \n" - + " myNamespace function testCall4() : String\n" - + " {\n" - + " return myNamespace::testCall3();\n" - + " }\n" - + " \n" - + " myNamespace function testCall6() : String\n" - + " {\n" - + " return \"y\";\n" - + " }\n" - + " \n" - + " public function testCall2() : String\n" - + " {\n" - + " return \"2\";\n" - + " }\n" - + " \n" - + " private function testCall3() : String\n" - + " {\n" - + " return \"3\";\n" - + " }\n" - + " \n" - + " protected function testCall4() : String\n" - + " {\n" - + " return \"4\";\n" - + " }\n" - + " \n" - + " internal function testCall6() : String\n" - + " {\n" - + " return \"6\";\n" - + " }\n" - + " }\n" + + "import tests_classes.mypackage2.TestClass;\n" + + "import tests_classes.mypackage3.TestClass;\n" + + "use namespace myNamespace;\n" + + "public class TestClass2\n" + + "{\n" + + "public function TestClass2()\n" + + "{\n" + + "super();\n" + "}\n" - + ""); + + "myNamespace static function testCall5() : String\n" + + "{\n" + + "return \"x\";\n" + + "}\n" + + "protected static function testCall5() : String\n" + + "{\n" + + "return \"5\";\n" + + "}\n" + + "public function testCall() : String\n" + + "{\n" + + "var a:tests_classes.mypackage1.TestClass = null;\n" + + "var b:tests_classes.mypackage2.TestClass = null;\n" + + "var c:tests_classes.mypackage3.TestClass = null;\n" + + "a = new tests_classes.mypackage1.TestClass();\n" + + "b = new tests_classes.mypackage2.TestClass();\n" + + "c = new tests_classes.mypackage3.TestClass();\n" + + "var res:String = a.testCall() + b.testCall() + c.testCall() + this.testCall2() + this.testCall3() + this.testCall4() + testCall5() + this.testCall6() + myNamespace::testCall3();\n" + + "trace(res);\n" + + "return res;\n" + + "}\n" + + "myNamespace function testCall2() : String\n" + + "{\n" + + "return \"1\";\n" + + "}\n" + + "myNamespace function testCall3() : String\n" + + "{\n" + + "return myNamespace::testCall2();\n" + + "}\n" + + "myNamespace function testCall4() : String\n" + + "{\n" + + "return myNamespace::testCall3();\n" + + "}\n" + + "myNamespace function testCall6() : String\n" + + "{\n" + + "return \"y\";\n" + + "}\n" + + "public function testCall2() : String\n" + + "{\n" + + "return \"2\";\n" + + "}\n" + + "private function testCall3() : String\n" + + "{\n" + + "return \"3\";\n" + + "}\n" + + "protected function testCall4() : String\n" + + "{\n" + + "return \"4\";\n" + + "}\n" + + "internal function testCall6() : String\n" + + "{\n" + + "return \"6\";\n" + + "}\n" + + "}\n" + + "}"); } @Test