mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 09:10:48 +00:00
Print SafeStr list at the bottom (AS3)
This commit is contained in:
@@ -231,6 +231,7 @@ import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -4354,9 +4355,9 @@ public class CommandLineArgumentParser {
|
||||
if (dcs != null) {
|
||||
if (dcs.contains(".")) {
|
||||
DottedChain dc = DottedChain.parseWithSuffix(dcs);
|
||||
pw.println("documentClass=" + dc.toPrintableString(swf, true));
|
||||
pw.println("documentClass=" + dc.toPrintableString(new LinkedHashSet<>(), swf, true));
|
||||
} else {
|
||||
pw.println("documentClass=" + IdentifiersDeobfuscation.printIdentifier(swf, true, dcs));
|
||||
pw.println("documentClass=" + IdentifiersDeobfuscation.printIdentifier(swf, new LinkedHashSet<>(), true, dcs));
|
||||
}
|
||||
} else {
|
||||
pw.println("documentClass=");
|
||||
|
||||
@@ -41,6 +41,7 @@ import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import javax.swing.JLabel;
|
||||
@@ -397,7 +398,7 @@ public class LibraryTreeTable extends JTreeTable {
|
||||
if (!classNames.isEmpty()) {
|
||||
List<String> escapedList = new ArrayList<>();
|
||||
for (String className : classNames) {
|
||||
escapedList.add(DottedChain.parseNoSuffix(className).toPrintableString(ct.getSwf(), true));
|
||||
escapedList.add(DottedChain.parseNoSuffix(className).toPrintableString(new LinkedHashSet<>(), ct.getSwf(), true));
|
||||
}
|
||||
return String.join(", ", escapedList);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -755,7 +756,7 @@ public class DebuggerHandler implements DebugConnectionListener {
|
||||
pkg = pkg.substring(pkg.indexOf(":") + 1);
|
||||
}
|
||||
|
||||
name = swfHash + ":" + DottedChain.parseWithSuffix(pkg).addWithSuffix(clsNameWithSuffix).toPrintableString(Main.getRunningSWF()/*???*/, con.isAS3);
|
||||
name = swfHash + ":" + DottedChain.parseWithSuffix(pkg).addWithSuffix(clsNameWithSuffix).toPrintableString(new LinkedHashSet<>(), Main.getRunningSWF()/*???*/, con.isAS3);
|
||||
}
|
||||
} else {
|
||||
if (name.contains(":")) {
|
||||
|
||||
@@ -37,6 +37,7 @@ import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -258,7 +259,7 @@ public class FolderListPanel extends JPanel {
|
||||
if (expName != null && !expName.isEmpty()) {
|
||||
String[] pathParts = expName.contains(".") ? expName.split("\\.") : new String[]{expName};
|
||||
if (expName.startsWith("__Packages.")) {
|
||||
s = IdentifiersDeobfuscation.printIdentifier(tag.getSwf(), false, pathParts[pathParts.length - 1]);
|
||||
s = IdentifiersDeobfuscation.printIdentifier(tag.getSwf(), new LinkedHashSet<>(), false, pathParts[pathParts.length - 1]);
|
||||
} else {
|
||||
s = Helper.escapeExportname(tag.getSwf(), expName, false);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EventObject;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -916,7 +917,7 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
if (di.exportName()) {
|
||||
valStr += " = " + escapeHtml(Helper.escapeExportname(swf, val.toString(), true));
|
||||
} else {
|
||||
valStr += " = " + escapeHtml(DottedChain.parseNoSuffix(val.toString()).toPrintableString(swf, di.as3()));
|
||||
valStr += " = " + escapeHtml(DottedChain.parseNoSuffix(val.toString()).toPrintableString(new LinkedHashSet<>(), swf, di.as3()));
|
||||
}
|
||||
} else if (val instanceof byte[]) {
|
||||
valStr += " = " + ((byte[]) val).length + " byte";
|
||||
|
||||
@@ -2010,7 +2010,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
if (!oldName.equals(newName)) {
|
||||
|
||||
if (oldName.equals(abcPanel.decompiledTextArea.getScriptLeaf().getClassPath().className)) {
|
||||
scriptName = abcPanel.decompiledTextArea.getScriptLeaf().getClassPath().packageStr.add(newName, "").toPrintableString(swf, true);
|
||||
scriptName = abcPanel.decompiledTextArea.getScriptLeaf().getClassPath().packageStr.add(newName, "").toPrintableString(new LinkedHashSet<>(), swf, true);
|
||||
}
|
||||
|
||||
final String fScriptName = scriptName;
|
||||
@@ -2849,7 +2849,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
|
||||
String documentClass = swf.getDocumentClass();
|
||||
if (documentClass != null && currentView != VIEW_DUMP) {
|
||||
String documentClassPrintable = DottedChain.parseNoSuffix(documentClass).toPrintableString(swf, true);
|
||||
String documentClassPrintable = DottedChain.parseNoSuffix(documentClass).toPrintableString(new LinkedHashSet<>(), swf, true);
|
||||
List<ABCContainerTag> abcList = swf.getAbcList();
|
||||
if (!abcList.isEmpty()) {
|
||||
ABCPanel abcPanel = getABCPanel();
|
||||
|
||||
@@ -82,6 +82,7 @@ import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -965,11 +966,11 @@ public class ABCExplorerDialog extends AppDialog {
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
DottedChain scriptNameDc = abc.script_info.get(scriptIndex).getSimplePackName(abc);
|
||||
DottedChain scriptNameDc = abc.script_info.get(scriptIndex).getSimplePackName(abc, new LinkedHashSet<>());
|
||||
if (scriptNameDc == null && scriptTraitIndex > -1) {
|
||||
scriptNameDc = abc.script_info.get(scriptIndex).traits.traits.get(scriptTraitIndex).getName(abc).getNameWithNamespace(abc, abc.constants, false);
|
||||
scriptNameDc = abc.script_info.get(scriptIndex).traits.traits.get(scriptTraitIndex).getName(abc).getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, false);
|
||||
}
|
||||
String scriptName = (scriptNameDc == null ? "script_" + scriptIndex : scriptNameDc.toPrintableString(abc.getSwf(), true));
|
||||
String scriptName = (scriptNameDc == null ? "script_" + scriptIndex : scriptNameDc.toPrintableString(new LinkedHashSet<>(), abc.getSwf(), true));
|
||||
//mainPanel.gotoScriptTrait(abc.getSwf(), scriptName, classIndex, globalTraitIndex);
|
||||
mainPanel.gotoScriptMethod(abc.getSwf(), scriptName, searchMethodInfo);
|
||||
}
|
||||
@@ -999,8 +1000,8 @@ public class ABCExplorerDialog extends AppDialog {
|
||||
switch (vwi.type) {
|
||||
case SCRIPT_INFO:
|
||||
scriptIndex = vwi.getIndex();
|
||||
DottedChain scriptNameDc = abc.script_info.get(scriptIndex).getSimplePackName(abc);
|
||||
String scriptName = (scriptNameDc == null ? "script_" + scriptIndex : scriptNameDc.toPrintableString(abc.getSwf(), true));
|
||||
DottedChain scriptNameDc = abc.script_info.get(scriptIndex).getSimplePackName(abc, new LinkedHashSet<>());
|
||||
String scriptName = (scriptNameDc == null ? "script_" + scriptIndex : scriptNameDc.toPrintableString(new LinkedHashSet<>(), abc.getSwf(), true));
|
||||
mainPanel.gotoScriptName(abc.getSwf(), scriptName);
|
||||
break;
|
||||
case METHOD_BODY:
|
||||
@@ -1031,11 +1032,11 @@ public class ABCExplorerDialog extends AppDialog {
|
||||
}
|
||||
}
|
||||
if (scriptIndex != -1) {
|
||||
DottedChain scriptNameDc2 = abc.script_info.get(scriptIndex).getSimplePackName(abc);
|
||||
DottedChain scriptNameDc2 = abc.script_info.get(scriptIndex).getSimplePackName(abc, new LinkedHashSet<>());
|
||||
if (scriptNameDc2 == null && scriptTraitIndex != -1) {
|
||||
scriptNameDc2 = abc.script_info.get(scriptIndex).traits.traits.get(scriptTraitIndex).getName(abc).getNameWithNamespace(abc, abc.constants, false);
|
||||
scriptNameDc2 = abc.script_info.get(scriptIndex).traits.traits.get(scriptTraitIndex).getName(abc).getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, false);
|
||||
}
|
||||
String scriptName2 = (scriptNameDc2 == null ? "script_" + scriptIndex : scriptNameDc2.toPrintableString(abc.getSwf(), true));
|
||||
String scriptName2 = (scriptNameDc2 == null ? "script_" + scriptIndex : scriptNameDc2.toPrintableString(new LinkedHashSet<>(), abc.getSwf(), true));
|
||||
mainPanel.gotoScriptTrait(abc.getSwf(), scriptName2, classIndex, GraphTextWriter.TRAIT_CLASS_INITIALIZER);
|
||||
}
|
||||
break;
|
||||
@@ -1084,12 +1085,12 @@ public class ABCExplorerDialog extends AppDialog {
|
||||
}
|
||||
|
||||
if (scriptIndex != -1) {
|
||||
DottedChain scriptNameDc = abc.script_info.get(scriptIndex).getSimplePackName(abc);
|
||||
DottedChain scriptNameDc = abc.script_info.get(scriptIndex).getSimplePackName(abc, new LinkedHashSet<>());
|
||||
if (scriptNameDc == null && scriptTraitIndex != -1) {
|
||||
scriptNameDc = abc.script_info.get(scriptIndex).traits.traits.get(scriptTraitIndex).getName(abc).getNameWithNamespace(abc, abc.constants, false);
|
||||
scriptNameDc = abc.script_info.get(scriptIndex).traits.traits.get(scriptTraitIndex).getName(abc).getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, false);
|
||||
}
|
||||
|
||||
String scriptName = (scriptNameDc == null ? "script_" + scriptIndex : scriptNameDc.toPrintableString(abc.getSwf(), true));
|
||||
String scriptName = (scriptNameDc == null ? "script_" + scriptIndex : scriptNameDc.toPrintableString(new LinkedHashSet<>(), abc.getSwf(), true));
|
||||
mainPanel.gotoScriptTrait(abc.getSwf(), scriptName, classIndex, globalTraitIndex);
|
||||
}
|
||||
|
||||
@@ -1654,7 +1655,7 @@ public class ABCExplorerDialog extends AppDialog {
|
||||
StringBuilder miStrSb = new StringBuilder();
|
||||
miStrSb.append("(");
|
||||
StringBuilderTextWriter miParamStrSbW = new StringBuilderTextWriter(new CodeFormatting(), miStrSb);
|
||||
mi.getParamStr(miParamStrSbW, abc.constants, null, abc, new ArrayList<>());
|
||||
mi.getParamStr(miParamStrSbW, abc.constants, null, abc, new ArrayList<>(), new LinkedHashSet<>());
|
||||
miStrSb.append("): ");
|
||||
String miReturnType = mi.getReturnTypeRaw(abc, abc.constants, new ArrayList<>());
|
||||
miStrSb.append(miReturnType);
|
||||
@@ -1678,7 +1679,7 @@ public class ABCExplorerDialog extends AppDialog {
|
||||
if (ii.name_index >= abc.constants.getMultinameCount() || ii.getName(abc.constants).namespace_index >= abc.constants.getNamespaceCount()) {
|
||||
iiName = "";
|
||||
} else {
|
||||
iiName = "\"" + Helper.escapePCodeString(ii.getName(abc.constants).getNameWithNamespace(abc, abc.constants, false).toRawString()) + "\"";
|
||||
iiName = "\"" + Helper.escapePCodeString(ii.getName(abc.constants).getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, false).toRawString()) + "\"";
|
||||
}
|
||||
return new ValueWithIndex(parent, currentLevelIndex, index, TreeType.INSTANCE_INFO, ii, iiName + (ii.instance_traits.traits.isEmpty() ? "" : ", " + ii.instance_traits.traits.size() + " traits"), title);
|
||||
case CLASS_INFO:
|
||||
@@ -1694,7 +1695,7 @@ public class ABCExplorerDialog extends AppDialog {
|
||||
ScriptInfo si = abc.script_info.get(index);
|
||||
String siName = "";
|
||||
try {
|
||||
DottedChain simplePackName = si.getSimplePackName(abc);
|
||||
DottedChain simplePackName = si.getSimplePackName(abc, new LinkedHashSet<>());
|
||||
if (simplePackName != null) {
|
||||
siName = " (\"" + Helper.escapePCodeString(simplePackName.toRawString()) + "\")";
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -936,9 +937,9 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
||||
decompiledTextArea.addScriptListener(setTrait);
|
||||
String scriptName;
|
||||
if (classIndex > -1) {
|
||||
scriptName = newAbc.instance_info.get(classIndex).getName(newAbc.constants).getNameWithNamespace(newAbc, newAbc.constants, true).toPrintableString(newAbc.getSwf(), true);
|
||||
scriptName = newAbc.instance_info.get(classIndex).getName(newAbc.constants).getNameWithNamespace(new LinkedHashSet<>(), newAbc, newAbc.constants, true).toPrintableString(new LinkedHashSet<>(), newAbc.getSwf(), true);
|
||||
} else if (scriptIndex > -1) {
|
||||
scriptName = newAbc.script_info.get(classIndex).getSimplePackName(newAbc).toPrintableString(newAbc.getSwf(), true);
|
||||
scriptName = newAbc.script_info.get(classIndex).getSimplePackName(newAbc, new LinkedHashSet<>()).toPrintableString(new LinkedHashSet<>(), newAbc.getSwf(), true);
|
||||
} else {
|
||||
scriptName = "";
|
||||
}
|
||||
@@ -1011,7 +1012,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
||||
swfRef.setVal(ci.abc.getSwf());
|
||||
}
|
||||
|
||||
String scriptNamePrintable = DottedChain.parseWithSuffix(scriptName.toString()).toPrintableString(ci.abc.getSwf(), true);
|
||||
String scriptNamePrintable = DottedChain.parseWithSuffix(scriptName.toString()).toPrintableString(new LinkedHashSet<>(), ci.abc.getSwf(), true);
|
||||
|
||||
if (swfRef.getVal() == abc.getSwf()) {
|
||||
hilightScript(getOpenable(), scriptNamePrintable);
|
||||
@@ -1147,7 +1148,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
||||
public List<com.jpexs.decompiler.flash.simpleparser.Variable> getClassTraits(Path className, boolean getStatic, boolean getInstance, boolean getInheritance) {
|
||||
List<AbcIndexing.PropertyDef> propertyDefList = new ArrayList<>();
|
||||
List<Boolean> isStaticList = new ArrayList<>();
|
||||
abc.getSwf().getAbcIndex().getClassTraits(new TypeItem(className.toString()), abc, decompiledTextArea.getScriptIndex(), getStatic, getInstance, getInheritance, propertyDefList, isStaticList);
|
||||
abc.getSwf().getAbcIndex().getClassTraits(new LinkedHashSet<>(), new TypeItem(className.toString()), abc, decompiledTextArea.getScriptIndex(), getStatic, getInstance, getInheritance, propertyDefList, isStaticList);
|
||||
List<com.jpexs.decompiler.flash.simpleparser.Variable> ret = new ArrayList<>();
|
||||
for (int i = 0; i < propertyDefList.size(); i++) {
|
||||
AbcIndexing.PropertyDef def = propertyDefList.get(i);
|
||||
@@ -1166,7 +1167,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
||||
if (tmgs.kindType == Trait.TRAIT_SETTER) {
|
||||
int[] paramTypes = ti.abc.method_info.get(tmgs.method_info).param_types;
|
||||
if (paramTypes.length == 1) {
|
||||
type = new Path(ti.abc.constants.getMultiname(paramTypes[0]).getNameWithNamespace(ti.abc, ti.abc.constants, false).getStringParts());
|
||||
type = new Path(ti.abc.constants.getMultiname(paramTypes[0]).getNameWithNamespace(new LinkedHashSet<>(), ti.abc, ti.abc.constants, false).getStringParts());
|
||||
callType = null;
|
||||
} else {
|
||||
continue;
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem;
|
||||
import com.jpexs.decompiler.flash.treeitems.Openable;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import javax.swing.event.TreeModelEvent;
|
||||
@@ -156,7 +157,7 @@ public class ClassesListTreeModel extends AS3ClassTreeItem implements TreeModel
|
||||
}
|
||||
|
||||
if (flat) {
|
||||
String fullName = packageStr.toPrintableString(abc.getSwf(), true);
|
||||
String fullName = packageStr.toPrintableString(new LinkedHashSet<>(), abc.getSwf(), true);
|
||||
boolean defaultPackage = false;
|
||||
if (fullName.length() == 0) {
|
||||
fullName = AppResources.translate("package.default");
|
||||
|
||||
@@ -53,6 +53,7 @@ import com.jpexs.helpers.Reference;
|
||||
import java.awt.Point;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
@@ -314,7 +315,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
Highlighting ch = Highlighting.searchPos(highlightedText.getClassHighlights(), pos);
|
||||
int cindex = (int) ch.getProperties().index;
|
||||
ABC abc = getABC();
|
||||
type.setVal(abc.instance_info.get(cindex).getName(abc.constants).getNameWithNamespace(abc, abc.constants, true));
|
||||
type.setVal(abc.instance_info.get(cindex).getName(abc.constants).getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, true));
|
||||
linkTypeRef.setVal(LinkType.LINK_THIS_SCRIPT);
|
||||
return ch.startPos;
|
||||
}
|
||||
@@ -599,7 +600,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
for (int i = 1; i < abc.constants.getMultinameCount(); i++) {
|
||||
Multiname m = abc.constants.getMultiname(i);
|
||||
if (m != null) {
|
||||
if (typeName.equals(m.getNameWithNamespace(abc, abc.constants, true).toRawString())) {
|
||||
if (typeName.equals(m.getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, true).toRawString())) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -660,7 +661,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
if (tm != null) {
|
||||
String name = "";
|
||||
if (classIndex > -1) {
|
||||
name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc, abc.constants, true).toPrintableString(abc.getSwf(), true);
|
||||
name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, true).toPrintableString(new LinkedHashSet<>(), abc.getSwf(), true);
|
||||
}
|
||||
|
||||
Trait currentTrait = null;
|
||||
@@ -671,7 +672,7 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
currentTrait = getCurrentTrait();
|
||||
isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex);
|
||||
if (currentTrait != null) {
|
||||
name += ":" + currentTrait.getName(abc).getName(abc, abc.constants, null, false, true);
|
||||
name += ":" + currentTrait.getName(abc).getName(new LinkedHashSet<>(), abc, abc.constants, null, false, true);
|
||||
}
|
||||
|
||||
if (currentTrait instanceof TraitSlotConst) {
|
||||
@@ -729,14 +730,14 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
}
|
||||
currentMethodHighlight = null;
|
||||
//currentTrait = null;
|
||||
String name = classIndex == -1 ? "" : abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc, abc.constants, true).toPrintableString(abc.getSwf(), true);
|
||||
String name = classIndex == -1 ? "" : abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, true).toPrintableString(new LinkedHashSet<>(), abc.getSwf(), true);
|
||||
currentTrait = getCurrentTrait();
|
||||
isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex);
|
||||
if (currentTrait != null) {
|
||||
if (!name.isEmpty()) {
|
||||
name += ":";
|
||||
}
|
||||
name += currentTrait.getName(abc).getName(abc, abc.constants, null, false, true);
|
||||
name += currentTrait.getName(abc).getName(new LinkedHashSet<>(), abc, abc.constants, null, false, true);
|
||||
}
|
||||
|
||||
int methodId;
|
||||
|
||||
@@ -35,6 +35,7 @@ import java.awt.FlowLayout;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
@@ -303,7 +304,7 @@ public class DetailPanel extends JPanel implements TagEditorPanel {
|
||||
traitNameLabel.setText("-");
|
||||
} else if (abcPanel != null) {
|
||||
Multiname traitName = trait.getName(abc);
|
||||
String traitNameStr = traitName == null ? "" : traitName.getName(abc, abc.constants, null, false, true);
|
||||
String traitNameStr = traitName == null ? "" : traitName.getName(new LinkedHashSet<>(), abc, abc.constants, null, false, true);
|
||||
traitNameLabel.setText(traitNameStr);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.search.ABCSearchResult;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@@ -80,9 +81,9 @@ public class TraitsListItem {
|
||||
return "__" + STR_SCRIPT_INITIALIZER;
|
||||
}
|
||||
if (isStatic) {
|
||||
return abc.class_info.get(classIndex).static_traits.traits.get(index).getName(abc).getName(abc, abc.constants, null, false, true);
|
||||
return abc.class_info.get(classIndex).static_traits.traits.get(index).getName(abc).getName(new LinkedHashSet<>(), abc, abc.constants, null, false, true);
|
||||
} else {
|
||||
return abc.instance_info.get(classIndex).instance_traits.traits.get(index).getName(abc).getName(abc, abc.constants, null, false, true);
|
||||
return abc.instance_info.get(classIndex).instance_traits.traits.get(index).getName(abc).getName(new LinkedHashSet<>(), abc, abc.constants, null, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,13 +106,13 @@ public class TraitsListItem {
|
||||
return "";
|
||||
}
|
||||
Trait trait = traits.get(index);
|
||||
trait.convertHeader(-1, null, convertData, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<>(), false);
|
||||
trait.convertHeader(new LinkedHashSet<>(), -1, null, convertData, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<>(), false);
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
boolean insideInterface = false;
|
||||
if (classIndex > -1) {
|
||||
insideInterface = abc.instance_info.get(classIndex).isInterface();
|
||||
}
|
||||
trait.toStringHeader(-1, null, DottedChain.EMPTY /*??*/, convertData, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<>(), false, insideInterface);
|
||||
trait.toStringHeader(new LinkedHashSet<>(), -1, null, DottedChain.EMPTY /*??*/, convertData, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<>(), false, insideInterface);
|
||||
writer.finishHilights();
|
||||
s = writer.toString();
|
||||
} else {
|
||||
@@ -121,13 +122,13 @@ public class TraitsListItem {
|
||||
return "";
|
||||
}
|
||||
Trait trait = traits.get(index);
|
||||
trait.convertHeader(-1, null, convertData, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<>(), false);
|
||||
trait.convertHeader(new LinkedHashSet<>(), -1, null, convertData, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<>(), false);
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
boolean insideInterface = false;
|
||||
if (classIndex > -1) {
|
||||
insideInterface = abc.instance_info.get(classIndex).isInterface();
|
||||
}
|
||||
trait.toStringHeader(-1, null, DottedChain.EMPTY /*??*/, convertData, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<>(), false, insideInterface);
|
||||
trait.toStringHeader(new LinkedHashSet<>(), -1, null, DottedChain.EMPTY /*??*/, convertData, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<>(), false, insideInterface);
|
||||
writer.finishHilights();
|
||||
s = writer.toString();
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
@@ -106,7 +107,7 @@ public class UsageFrame extends AppDialog implements MouseListener {
|
||||
cont.add(new FasterScrollPane(usageList), BorderLayout.CENTER);
|
||||
cont.add(buttonsPanel, BorderLayout.SOUTH);
|
||||
setSize(400, 300);
|
||||
setTitle((definitions ? translate("dialog.title.declaration") : translate("dialog.title")) + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(abc, abc.constants, true).toPrintableString(abc.getSwf(), true));
|
||||
setTitle((definitions ? translate("dialog.title.declaration") : translate("dialog.title")) + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(new LinkedHashSet<>(), abc, abc.constants, true).toPrintableString(new LinkedHashSet<>(), abc.getSwf(), true));
|
||||
View.centerScreen(this);
|
||||
View.setWindowIcon(this);
|
||||
}
|
||||
@@ -164,9 +165,9 @@ public class UsageFrame extends AppDialog implements MouseListener {
|
||||
decompiledTextArea.addScriptListener(setTrait);
|
||||
String scriptName;
|
||||
if (icu.getClassIndex() > -1) {
|
||||
scriptName = icu.getAbc().instance_info.get(icu.getClassIndex()).getName(icu.getAbc().constants).getNameWithNamespace(icu.getAbc(), icu.getAbc().constants, true).toPrintableString(icu.getAbc().getSwf(), true);
|
||||
scriptName = icu.getAbc().instance_info.get(icu.getClassIndex()).getName(icu.getAbc().constants).getNameWithNamespace(new LinkedHashSet<>(), icu.getAbc(), icu.getAbc().constants, true).toPrintableString(new LinkedHashSet<>(), icu.getAbc().getSwf(), true);
|
||||
} else if (icu.getScriptIndex() > -1) {
|
||||
scriptName = icu.getAbc().script_info.get(icu.getScriptIndex()).getSimplePackName(icu.getAbc()).toPrintableString(icu.getAbc().getSwf(), true);
|
||||
scriptName = icu.getAbc().script_info.get(icu.getScriptIndex()).getSimplePackName(icu.getAbc(), new LinkedHashSet<>()).toPrintableString(new LinkedHashSet<>(), icu.getAbc().getSwf(), true);
|
||||
} else {
|
||||
scriptName = "";
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.gui.abc.tablemodels;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import java.util.LinkedHashSet;
|
||||
import javax.swing.event.TableModelListener;
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
@@ -130,7 +131,7 @@ public class MultinameTableModel implements TableModel {
|
||||
if (abc.constants.getMultiname(rowIndex).name_index == -1) {
|
||||
return "";
|
||||
}
|
||||
return abc.constants.getMultiname(rowIndex).getName(abc, abc.constants, null, true, true);
|
||||
return abc.constants.getMultiname(rowIndex).getName(new LinkedHashSet<>(), abc, abc.constants, null, true, true);
|
||||
case 3:
|
||||
if (rowIndex == 0) {
|
||||
return "";
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
@@ -106,9 +107,9 @@ public class DebuggerTools {
|
||||
int debuggerNs = a.constants.getNamespaceId(Namespace.KIND_PACKAGE, debuggerPkg, 0, true);
|
||||
for (int i = 1; i < a.constants.getMultinameCount(); i++) {
|
||||
Multiname m = a.constants.getMultiname(i);
|
||||
String rawNsName = m.getNameWithNamespace(a, a.constants, true).toRawString();
|
||||
String rawNsName = m.getNameWithNamespace(new LinkedHashSet<>(), a, a.constants, true).toRawString();
|
||||
if (m.kind == Multiname.MULTINAME) {
|
||||
String simpleName = m.getName(a, a.constants, new ArrayList<>(), true, false);
|
||||
String simpleName = m.getName(new LinkedHashSet<>(), a, a.constants, new ArrayList<>(), true, false);
|
||||
String nsToSearch;
|
||||
if (displayTypes.contains(simpleName)) {
|
||||
nsToSearch = "flash.display";
|
||||
@@ -132,7 +133,7 @@ public class DebuggerTools {
|
||||
m.kind = Multiname.QNAME;
|
||||
m.namespace_index = nsFoundId;
|
||||
m.namespace_set_index = 0;
|
||||
rawNsName = m.getNameWithNamespace(a, a.constants, true).toRawString();
|
||||
rawNsName = m.getNameWithNamespace(new LinkedHashSet<>(), a, a.constants, true).toRawString();
|
||||
}
|
||||
}
|
||||
if (null != rawNsName) {
|
||||
@@ -177,7 +178,7 @@ public class DebuggerTools {
|
||||
ABC a = ct.getABC();
|
||||
for (int i = 1; i < a.constants.getMultinameCount(); i++) {
|
||||
Multiname m = a.constants.getMultiname(i);
|
||||
if ("trace".equals(m.getNameWithNamespace(a, a.constants, true).toRawString())) {
|
||||
if ("trace".equals(m.getNameWithNamespace(new LinkedHashSet<>(), a, a.constants, true).toRawString())) {
|
||||
m.namespace_index = a.constants.getNamespaceId(Namespace.KIND_PACKAGE, debuggerPkg, 0, true);
|
||||
m.name_index = a.constants.getStringId(fname, true);
|
||||
((Tag) ct).setModified(true);
|
||||
@@ -200,7 +201,7 @@ public class DebuggerTools {
|
||||
ABC a = ct.getABC();
|
||||
for (int i = 1; i < a.constants.getMultinameCount(); i++) {
|
||||
Multiname m = a.constants.getMultiname(i);
|
||||
String packageStr = m.getNameWithNamespace(a, a.constants, true).toString();
|
||||
String packageStr = m.getNameWithNamespace(new LinkedHashSet<>(), a, a.constants, true).toString();
|
||||
if (isDebuggerClass(packageStr, "debugTrace")
|
||||
|| isDebuggerClass(packageStr, "debugAlert")
|
||||
|| isDebuggerClass(packageStr, "debugSocket")
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.awt.Dimension;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Objects;
|
||||
import javax.swing.JTextArea;
|
||||
|
||||
@@ -95,7 +96,7 @@ public class StringEditor extends JTextArea implements GenericTagEditor {
|
||||
if (di.exportName()) {
|
||||
newValue = Helper.escapeExportname(swf, newValue, false);
|
||||
} else {
|
||||
newValue = DottedChain.parseNoSuffix(newValue).toPrintableString(swf, di.as3());
|
||||
newValue = DottedChain.parseNoSuffix(newValue).toPrintableString(new LinkedHashSet<>(), swf, di.as3());
|
||||
}
|
||||
}
|
||||
setText(newValue);
|
||||
|
||||
@@ -99,6 +99,7 @@ import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -352,7 +353,7 @@ public class TagTree extends AbstractTagTree {
|
||||
if (expName != null && !expName.isEmpty()) {
|
||||
String[] pathParts = expName.contains(".") ? expName.split("\\.") : new String[]{expName};
|
||||
if (expName.startsWith("__Packages.")) {
|
||||
return IdentifiersDeobfuscation.printIdentifier(tag.getSwf(), false, pathParts[pathParts.length - 1]);
|
||||
return IdentifiersDeobfuscation.printIdentifier(tag.getSwf(), new LinkedHashSet<>(), false, pathParts[pathParts.length - 1]);
|
||||
} else {
|
||||
return Helper.escapeExportname(tag.getSwf(), expName, false);
|
||||
}
|
||||
|
||||
@@ -3071,7 +3071,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
DottedChain classDottedChain = new DottedChain(parts);
|
||||
|
||||
try {
|
||||
List<Action> regActions = regParser.actionsFromString("Object.registerClass(\"" + Helper.escapePCodeString(identifier) + "\"," + classDottedChain.toPrintableString(swf, false) + ");", swf.getCharset());
|
||||
List<Action> regActions = regParser.actionsFromString("Object.registerClass(\"" + Helper.escapePCodeString(identifier) + "\"," + classDottedChain.toPrintableString(new LinkedHashSet<>(), swf, false) + ");", swf.getCharset());
|
||||
regDoInit.setActions(regActions);
|
||||
} catch (ActionParseException | IOException | CompilationException | InterruptedException ex) {
|
||||
//ignore
|
||||
@@ -3116,7 +3116,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
DottedChain dcParent = new DottedChain(partsParent);
|
||||
|
||||
try {
|
||||
List<Action> actions = parser.actionsFromString("class " + classDottedChain.toPrintableString(swf, false) + (classParent.isEmpty() ? "" : " extends " + dcParent.toPrintableString(swf, false)) + "{}", swf.getCharset());
|
||||
List<Action> actions = parser.actionsFromString("class " + classDottedChain.toPrintableString(new LinkedHashSet<>(), swf, false) + (classParent.isEmpty() ? "" : " extends " + dcParent.toPrintableString(new LinkedHashSet<>(), swf, false)) + "{}", swf.getCharset());
|
||||
classDoInit.setActions(actions);
|
||||
} catch (ActionParseException | IOException | CompilationException | InterruptedException ex) {
|
||||
//ignore
|
||||
@@ -3259,9 +3259,9 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
ActionScript3Parser parser = new ActionScript3Parser(abcIndex);
|
||||
|
||||
DottedChain dc = new DottedChain(pkgParts);
|
||||
String script = "package " + dc.toPrintableString(swf, true) + " {"
|
||||
String script = "package " + dc.toPrintableString(new LinkedHashSet<>(), swf, true) + " {"
|
||||
+ (parentClassName.isEmpty() ? "" : "import " + parentClassName + ";")
|
||||
+ "public class " + IdentifiersDeobfuscation.printIdentifier(swf, true, classSimpleName) + (parentClassName.isEmpty() ? "" : " extends " + parentClassName) + " {"
|
||||
+ "public class " + IdentifiersDeobfuscation.printIdentifier(swf, new LinkedHashSet<>(), true, classSimpleName) + (parentClassName.isEmpty() ? "" : " extends " + parentClassName) + " {"
|
||||
+ " }"
|
||||
+ "}";
|
||||
parser.addScript(script, fileName, 0, 0, swf.getDocumentClass(), selectedAbcContainer.getABC());
|
||||
@@ -3361,7 +3361,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
while (it instanceof AS2Package) {
|
||||
pkg = (AS2Package) it;
|
||||
if (!pkg.isDefaultPackage()) {
|
||||
pkgParts.add(0, DottedChain.parseNoSuffix(pkg.getName()).toPrintableString(swf, false));
|
||||
pkgParts.add(0, DottedChain.parseNoSuffix(pkg.getName()).toPrintableString(new LinkedHashSet<>(), swf, false));
|
||||
}
|
||||
it = model.getParent(it);
|
||||
}
|
||||
@@ -3489,8 +3489,8 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
ActionScript3Parser parser = new ActionScript3Parser(abcIndex);
|
||||
|
||||
DottedChain dc = new DottedChain(pkgParts);
|
||||
String script = "package " + dc.toPrintableString(doAbc.getSwf(), true) + " {"
|
||||
+ "public class " + IdentifiersDeobfuscation.printIdentifier(swf, true, classSimpleName) + " {"
|
||||
String script = "package " + dc.toPrintableString(new LinkedHashSet<>(), doAbc.getSwf(), true) + " {"
|
||||
+ "public class " + IdentifiersDeobfuscation.printIdentifier(swf, new LinkedHashSet<>(), true, classSimpleName) + " {"
|
||||
+ " }"
|
||||
+ "}";
|
||||
parser.addScript(script, fileName, 0, 0, swf.getDocumentClass(), doAbc.getABC());
|
||||
@@ -3946,7 +3946,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
DottedChain dc = new DottedChain(parts);
|
||||
|
||||
try {
|
||||
List<Action> actions = parser.actionsFromString("class " + dc.toPrintableString(swf, false) + "{}", swf.getCharset());
|
||||
List<Action> actions = parser.actionsFromString("class " + dc.toPrintableString(new LinkedHashSet<>(), swf, false) + "{}", swf.getCharset());
|
||||
doInit.setActions(actions);
|
||||
} catch (ActionParseException | IOException | CompilationException
|
||||
| InterruptedException ex) {
|
||||
|
||||
Reference in New Issue
Block a user