diff --git a/CHANGELOG.md b/CHANGELOG.md index 929b2d086..230393ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ All notable changes to this project will be documented in this file. - Commandline replacing sound stream block ranges - [#1625] Error log frame - Save all to file button - [#2467] Show ImportAssets name/characterId in the title when there is only single one item +- [#2468] Option for `-dumpas2` CLI command to use export names (`-exportNames` option) ### Changed - AS1/2 - Single DoAction tag inside frame is now displayed directly as frame node @@ -3861,6 +3862,7 @@ Major version of SWF to XML export changed to 2. [#2451]: https://www.free-decompiler.com/flash/issues/2451 [#1625]: https://www.free-decompiler.com/flash/issues/1625 [#2467]: https://www.free-decompiler.com/flash/issues/2467 +[#2468]: https://www.free-decompiler.com/flash/issues/2468 [#2456]: https://www.free-decompiler.com/flash/issues/2456 [#2459]: https://www.free-decompiler.com/flash/issues/2459 [#2460]: https://www.free-decompiler.com/flash/issues/2460 diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 76d1d1e63..dc0421a59 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -4382,6 +4382,16 @@ public class CommandLineArgumentParser { } private static void parseDumpAS2(Stack args, String charset) { + if (args.isEmpty()) { + badArguments("dumpas2"); + } + boolean useExportNames = false; + String exportNamesParam = args.pop(); + if (exportNamesParam.toLowerCase(Locale.ENGLISH).equals("-exportnames")) { + useExportNames = true; + } else { + args.push(exportNamesParam); + } if (args.isEmpty()) { badArguments("dumpas2"); } @@ -4389,7 +4399,7 @@ public class CommandLineArgumentParser { try { try (StdInAwareFileInputStream is = new StdInAwareFileInputStream(file)) { SWF swf = new SWF(is, Configuration.parallelSpeedUp.get(), charset); - Map asms = swf.getASMs(false); + Map asms = swf.getASMs(useExportNames); for (String as2 : asms.keySet()) { System.out.println(as2); } diff --git a/src/com/jpexs/decompiler/flash/console/help.txt b/src/com/jpexs/decompiler/flash/console/help.txt index a6db42ca7..ee4106806 100644 --- a/src/com/jpexs/decompiler/flash/console/help.txt +++ b/src/com/jpexs/decompiler/flash/console/help.txt @@ -46,8 +46,10 @@ alias /? -dumpSWF Dump list of SWF tags to console. --dumpAS2 +-dumpAS2 [-exportNames] Dump list of AS1/2 scripts to console. + Use -exportNames option to print names in export format + (used in -replace command etc.) -dumpAS3 Dump list of AS3 scripts to console.