diff --git a/CHANGELOG.md b/CHANGELOG.md index b5146aac3..29c7c1f97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Fixed +- [#1914] DropShadow filter +- [#1916] Translation tool did not load up ## [18.1.0] - 2022-12-23 ### Added @@ -42,7 +45,6 @@ All notable changes to this project will be documented in this file. - [#1858] PDF export - Applying same color multiple times - [#1907] Crashing on memory search - [#1906] Memory search - byte align opens wrong SWFs -- [#1914] DropShadow filter ### Changed - Warning before switching deobfuscation is now optional @@ -2788,6 +2790,8 @@ All notable changes to this project will be documented in this file. [alpha 9]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha8...alpha9 [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 +[#1914]: https://www.free-decompiler.com/flash/issues/1914 +[#1916]: https://www.free-decompiler.com/flash/issues/1916 [#1231]: https://www.free-decompiler.com/flash/issues/1231 [#1690]: https://www.free-decompiler.com/flash/issues/1690 [#1460]: https://www.free-decompiler.com/flash/issues/1460 @@ -2802,7 +2806,6 @@ All notable changes to this project will be documented in this file. [#1908]: https://www.free-decompiler.com/flash/issues/1908 [#1907]: https://www.free-decompiler.com/flash/issues/1907 [#1906]: https://www.free-decompiler.com/flash/issues/1906 -[#1914]: https://www.free-decompiler.com/flash/issues/1914 [#1898]: https://www.free-decompiler.com/flash/issues/1898 [#1511]: https://www.free-decompiler.com/flash/issues/1511 [#1765]: https://www.free-decompiler.com/flash/issues/1765 diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 704823773..451c78559 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -976,6 +976,7 @@ public class CommandLineArgumentParser { parseProxy(args); } else if (command.equals("export")) { parseExport(selectionClasses, selection, selectionIds, args, handler, traceLevel, format, zoom, charset); + System.exit(0); } else if (command.equals("compress")) { parseCompress(args); } else if (command.equals("decompress")) { @@ -1026,10 +1027,13 @@ public class CommandLineArgumentParser { parseImportShapes(args, charset); } else if (command.equals("importimages")) { parseImportImages(args, charset); + System.exit(0); } else if (command.equals("importtext")) { parseImportText(args, charset); + System.exit(0); } else if (command.equals("importscript")) { parseImportScript(args, charset, air); + System.exit(0); } else if (command.equals("as3compiler")) { ActionScript3Parser.compile(null /*?*/, args.pop(), args.pop(), 0, 0); } else if (nextParam.equals("--debugtool")) { diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 4ceea7301..07bc6cdf7 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -2628,8 +2628,6 @@ public class Main { } } }); - } else { - System.exit(0); } } } diff --git a/src/com/jpexs/decompiler/flash/gui/translator/Translator.java b/src/com/jpexs/decompiler/flash/gui/translator/Translator.java index 6ad1a3628..53cc35b74 100644 --- a/src/com/jpexs/decompiler/flash/gui/translator/Translator.java +++ b/src/com/jpexs/decompiler/flash/gui/translator/Translator.java @@ -201,7 +201,7 @@ public class Translator extends JFrame implements ItemListener { if (s.type == SymbolType.COMMENT) { if (((String) s.value).trim().equals(DO_NOT_EDIT)) { hidden = true; - } + } if (comment.isEmpty()) { comment = (String) s.value; } else { @@ -309,10 +309,10 @@ public class Translator extends JFrame implements ItemListener { public Translator() throws IOException, FileNotFoundException, URISyntaxException { loadItems(); - + setDefaultCloseOperation(EXIT_ON_CLOSE); Container cnt = getContentPane(); - + addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { @@ -740,16 +740,8 @@ public class Translator extends JFrame implements ItemListener { updateRowHeights(table); View.centerScreen(this); - /*List images = new ArrayList<>(); - images.add(View.loadImage("icon16")); - images.add(View.loadImage("icon32")); - images.add(View.loadImage("icon48")); - images.add(View.loadImage("icon256")); - setIconImages(images);*/ load(); - loadWindow(); - - //saveAll(); + loadWindow(); } private void updateCounts() { @@ -916,87 +908,91 @@ public class Translator extends JFrame implements ItemListener { private void load() throws IOException { newValues.clear(); - ZipInputStream zis = new ZipInputStream(new FileInputStream(getStorageFile())); - ZipEntry zipEntry = zis.getNextEntry(); - Pattern pat = Pattern.compile("(?(.*/)?[^/_]+)(_(?[^/\\.]+))?\\.properties"); - while (zipEntry != null) { - if (!zipEntry.isDirectory()) { - String name = zipEntry.getName(); - Matcher m = pat.matcher(name); - if (m.matches()) { - String resource = m.group("resource"); - resource = resource.replace(".jar/", ".jar: "); - String locale = m.group("locale"); - if (locale == null) { - locale = "en"; - } - locales.add(locale); - if (!newValues.containsKey(resource)) { - newValues.put(resource, new LinkedHashMap<>()); - } - if (!newValues.get(resource).containsKey(locale)) { - newValues.get(resource).put(locale, new LinkedHashMap<>()); - } - resourceLocales.get(resource).add(locale); - locales.add(locale); - String propertiesData = readStreamAsString(zis); - PropertiesLexer lexer = new PropertiesLexer(propertiesData); - try { - ParsedSymbol s = lexer.lex(); - boolean hidden = false; - while (s.type != SymbolType.EOF) { - if (s.type == SymbolType.COMMENT) { - if (((String) s.value).trim().equals(DO_NOT_EDIT)) { - hidden = true; - } - s = lexer.lex(); - continue; - } - if (s.type == SymbolType.EMPTY_LINE) { - s = lexer.lex(); - continue; - } - //System.out.println(s); - if (s.type == SymbolType.EOF) { - break; - } - if (s.type != SymbolType.KEY) { - throw new RuntimeException("KEY EXPECTED"); - //break; - } - String key = (String) s.value; - s = lexer.lex(); + File storageFile = new File(getStorageFile()); + if (storageFile.exists()) { + ZipInputStream zis = new ZipInputStream(new FileInputStream(storageFile)); + ZipEntry zipEntry = zis.getNextEntry(); + Pattern pat = Pattern.compile("(?(.*/)?[^/_]+)(_(?[^/\\.]+))?\\.properties"); - if (s.type != SymbolType.VALUE) { - throw new RuntimeException("VALUE EXPECTED"); - //break; - } - String value = (String) s.value; - if (!hidden) { - if (resourceValues.containsKey(resource) - && resourceValues.get(resource).containsKey(locale) - && resourceValues.get(resource).get(locale).containsKey(key) - && Objects.equals(resourceValues.get(resource).get(locale).get(key), value)) { - //same, ignore - } else { - newValues.get(resource).get(locale).put(key, value); - } - } - //System.out.println(resource+": locale="+locale+" key="+key+" value="+value); - s = lexer.lex(); + while (zipEntry != null) { + if (!zipEntry.isDirectory()) { + String name = zipEntry.getName(); + Matcher m = pat.matcher(name); + if (m.matches()) { + String resource = m.group("resource"); + resource = resource.replace(".jar/", ".jar: "); + String locale = m.group("locale"); + if (locale == null) { + locale = "en"; } - //System.exit(0); - } catch (PropertiesParseException ex) { - Logger.getLogger(Translator.class.getName()).log(Level.SEVERE, null, ex); - } + locales.add(locale); + if (!newValues.containsKey(resource)) { + newValues.put(resource, new LinkedHashMap<>()); + } + if (!newValues.get(resource).containsKey(locale)) { + newValues.get(resource).put(locale, new LinkedHashMap<>()); + } + resourceLocales.get(resource).add(locale); + locales.add(locale); + String propertiesData = readStreamAsString(zis); + PropertiesLexer lexer = new PropertiesLexer(propertiesData); + try { + ParsedSymbol s = lexer.lex(); + boolean hidden = false; + while (s.type != SymbolType.EOF) { + if (s.type == SymbolType.COMMENT) { + if (((String) s.value).trim().equals(DO_NOT_EDIT)) { + hidden = true; + } + s = lexer.lex(); + continue; + } + if (s.type == SymbolType.EMPTY_LINE) { + s = lexer.lex(); + continue; + } + //System.out.println(s); + if (s.type == SymbolType.EOF) { + break; + } + if (s.type != SymbolType.KEY) { + throw new RuntimeException("KEY EXPECTED"); + //break; + } + String key = (String) s.value; + s = lexer.lex(); + if (s.type != SymbolType.VALUE) { + throw new RuntimeException("VALUE EXPECTED"); + //break; + } + String value = (String) s.value; + if (!hidden) { + if (resourceValues.containsKey(resource) + && resourceValues.get(resource).containsKey(locale) + && resourceValues.get(resource).get(locale).containsKey(key) + && Objects.equals(resourceValues.get(resource).get(locale).get(key), value)) { + //same, ignore + } else { + newValues.get(resource).get(locale).put(key, value); + } + } + //System.out.println(resource+": locale="+locale+" key="+key+" value="+value); + s = lexer.lex(); + } + //System.exit(0); + } catch (PropertiesParseException ex) { + Logger.getLogger(Translator.class.getName()).log(Level.SEVERE, null, ex); + } + + } } + zipEntry = zis.getNextEntry(); } - zipEntry = zis.getNextEntry(); + zis.closeEntry(); + zis.close(); } - zis.closeEntry(); - zis.close(); List localeItems = new ArrayList(); for (String locale : locales) {