diff --git a/src/com/jpexs/decompiler/flash/SWF.java b/src/com/jpexs/decompiler/flash/SWF.java index 4d105f853..086d40331 100644 --- a/src/com/jpexs/decompiler/flash/SWF.java +++ b/src/com/jpexs/decompiler/flash/SWF.java @@ -848,10 +848,13 @@ public final class SWF implements TreeItem, Timelined { abcTags.add(cnt); } } + + boolean exported = false; + for (int i = 0; i < abcTags.size(); i++) { ABC abc = abcTags.get(i).getABC(); - ScriptPack scr = abc.findScriptPackByPath(className); - if (scr != null) { + List scrs = abc.findScriptPacksByPath(className); + for(ScriptPack scr:scrs) { String cnt = ""; if (abc.script_info.size() > 1) { cnt = "script " + (i + 1) + "/" + abc.script_info.size() + " "; @@ -860,11 +863,11 @@ public final class SWF implements TreeItem, Timelined { informListeners("exporting", exStr); scr.export(outdir, abcTags, exportMode, parallel); exStr = "Exported " + "tag " + (i + 1) + "/" + abcTags.size() + " " + cnt + scr.getPath() + " ..."; - informListeners("exported", exStr); - return true; - } + informListeners("exported", exStr); + exported = true; + } } - return false; + return exported; } private List> uniqueAS3Packs(List> packs) { diff --git a/src/com/jpexs/decompiler/flash/abc/ABC.java b/src/com/jpexs/decompiler/flash/abc/ABC.java index a6f0a00f4..f938c39b3 100644 --- a/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -947,6 +947,37 @@ public class ABC { } return -1; } + + public List findScriptPacksByPath(String name) { + List ret = new ArrayList<>(); + List> allPacks = getScriptPacks(); + if(name.endsWith(".**")||name.equals("**")||name.endsWith(".++") || name.equals("++")){ + name = name.substring(0,name.length()-2); + + for (MyEntry en : allPacks) { + if (en.key.toString().startsWith(name)) { + ret.add(en.value); + } + } + } else if(name.endsWith(".*")||name.equals("*")||name.endsWith(".+")||name.equals("+")){ + name = name.substring(0,name.length()-1); + for (MyEntry en : allPacks) { + if (en.key.toString().startsWith(name)) { + String rem = name.isEmpty()?en.key.toString():en.key.toString().substring(name.length()); + if(!rem.contains(".")){ + ret.add(en.value); + } + } + } + } else { + ScriptPack p = findScriptPackByPath(name); + if(p!=null){ + ret.add(p); + } + } + return ret; + + } public ScriptPack findScriptPackByPath(String name) { List> packs = getScriptPacks();