mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-19 12:28:29 +00:00
removed some unnecesary fields/parameters
This commit is contained in:
@@ -974,7 +974,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
String exStr = "Exporting " + "tag " + (i + 1) + "/" + abcList.size() + " " + cnt + scr.getPath() + " ...";
|
||||
informListeners("exporting", exStr);
|
||||
scr.export(outdir, abcList, exportMode, parallel);
|
||||
scr.export(outdir, exportMode, parallel);
|
||||
exStr = "Exported " + "tag " + (i + 1) + "/" + abcList.size() + " " + cnt + scr.getPath() + " ...";
|
||||
informListeners("exported", exStr);
|
||||
exported = true;
|
||||
@@ -1014,7 +1014,6 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
|
||||
ScriptPack pack;
|
||||
String directory;
|
||||
List<ABCContainerTag> abcList;
|
||||
ScriptExportMode exportMode;
|
||||
ClassPath path;
|
||||
AtomicInteger index;
|
||||
@@ -1024,10 +1023,9 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
long startTime;
|
||||
long stopTime;
|
||||
|
||||
public ExportPackTask(AbortRetryIgnoreHandler handler, AtomicInteger index, int count, ClassPath path, ScriptPack pack, String directory, List<ABCContainerTag> abcList, ScriptExportMode exportMode, boolean parallel) {
|
||||
public ExportPackTask(AbortRetryIgnoreHandler handler, AtomicInteger index, int count, ClassPath path, ScriptPack pack, String directory, ScriptExportMode exportMode, boolean parallel) {
|
||||
this.pack = pack;
|
||||
this.directory = directory;
|
||||
this.abcList = abcList;
|
||||
this.exportMode = exportMode;
|
||||
this.path = path;
|
||||
this.index = index;
|
||||
@@ -1042,7 +1040,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
startTime = System.currentTimeMillis();
|
||||
this.result = pack.export(directory, abcList, exportMode, parallel);
|
||||
this.result = pack.export(directory, exportMode, parallel);
|
||||
stopTime = System.currentTimeMillis();
|
||||
}
|
||||
};
|
||||
@@ -1083,7 +1081,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
for (MyEntry<ClassPath, ScriptPack> item : packs) {
|
||||
ExportPackTask task = new ExportPackTask(handler, cnt, packs.size(), item.getKey(), item.getValue(), outdir, getAbcList(), exportMode, parallel);
|
||||
ExportPackTask task = new ExportPackTask(handler, cnt, packs.size(), item.getKey(), item.getValue(), outdir, exportMode, parallel);
|
||||
ret.add(task.call());
|
||||
}
|
||||
return null;
|
||||
@@ -1098,7 +1096,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
ExecutorService executor = Executors.newFixedThreadPool(Configuration.parallelThreadCount.get());
|
||||
List<Future<File>> futureResults = new ArrayList<>();
|
||||
for (MyEntry<ClassPath, ScriptPack> item : packs) {
|
||||
Future<File> future = executor.submit(new ExportPackTask(handler, cnt, packs.size(), item.getKey(), item.getValue(), outdir, getAbcList(), exportMode, parallel));
|
||||
Future<File> future = executor.submit(new ExportPackTask(handler, cnt, packs.size(), item.getKey(), item.getValue(), outdir, exportMode, parallel));
|
||||
futureResults.add(future);
|
||||
}
|
||||
|
||||
@@ -2278,7 +2276,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
boolean parallel = Configuration.parallelSpeedUp.get();
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), true);
|
||||
pack.toSource(writer, swf.getAbcList(), script.traits.traits, ScriptExportMode.AS, parallel);
|
||||
pack.toSource(writer, script.traits.traits, ScriptExportMode.AS, parallel);
|
||||
HighlightedText hilightedCode = new HighlightedText(writer);
|
||||
CachedDecompilation res = new CachedDecompilation(hilightedCode);
|
||||
swf.as3Cache.put(pack, res);
|
||||
|
||||
@@ -110,6 +110,11 @@ public class ABC {
|
||||
return parentTag.getSwf();
|
||||
}
|
||||
|
||||
|
||||
public List<ABCContainerTag> getAbcTags() {
|
||||
return getSwf().getAbcList();
|
||||
}
|
||||
|
||||
public int addMethodBody(MethodBody body) {
|
||||
bodies.add(body);
|
||||
bodyIdxFromMethodIdx = null;
|
||||
@@ -875,22 +880,22 @@ public class ABC {
|
||||
}
|
||||
}
|
||||
|
||||
private void checkMultinameUsedInMethod(List<ABCContainerTag> abcTags, int multinameIndex, int methodInfo, List<MultinameUsage> ret, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
private void checkMultinameUsedInMethod(int multinameIndex, int methodInfo, List<MultinameUsage> ret, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
for (int p = 0; p < method_info.get(methodInfo).param_types.length; p++) {
|
||||
if (method_info.get(methodInfo).param_types[p] == multinameIndex) {
|
||||
ret.add(new MethodParamsMultinameUsage(abcTags, this, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex));
|
||||
ret.add(new MethodParamsMultinameUsage(this, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (method_info.get(methodInfo).ret_type == multinameIndex) {
|
||||
ret.add(new MethodReturnTypeMultinameUsage(abcTags, this, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex));
|
||||
ret.add(new MethodReturnTypeMultinameUsage(this, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex));
|
||||
}
|
||||
MethodBody body = findBody(methodInfo);
|
||||
if (body != null) {
|
||||
findMultinameUsageInTraits(abcTags, body.traits, multinameIndex, isStatic, classIndex, ret, traitIndex);
|
||||
findMultinameUsageInTraits(body.traits, multinameIndex, isStatic, classIndex, ret, traitIndex);
|
||||
for (ABCException e : body.exceptions) {
|
||||
if ((e.name_index == multinameIndex) || (e.type_index == multinameIndex)) {
|
||||
ret.add(new MethodBodyMultinameUsage(abcTags, this, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex));
|
||||
ret.add(new MethodBodyMultinameUsage(this, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -898,7 +903,7 @@ public class ABC {
|
||||
for (int o = 0; o < ins.definition.operands.length; o++) {
|
||||
if (ins.definition.operands[o] == AVM2Code.DAT_MULTINAME_INDEX) {
|
||||
if (ins.operands[o] == multinameIndex) {
|
||||
ret.add(new MethodBodyMultinameUsage(abcTags, this, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex));
|
||||
ret.add(new MethodBodyMultinameUsage(this, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -907,29 +912,29 @@ public class ABC {
|
||||
}
|
||||
}
|
||||
|
||||
private void findMultinameUsageInTraits(List<ABCContainerTag> abcTags, Traits traits, int multinameIndex, boolean isStatic, int classIndex, List<MultinameUsage> ret, int parentTraitIndex) {
|
||||
private void findMultinameUsageInTraits(Traits traits, int multinameIndex, boolean isStatic, int classIndex, List<MultinameUsage> ret, int parentTraitIndex) {
|
||||
for (int t = 0; t < traits.traits.size(); t++) {
|
||||
if (traits.traits.get(t) instanceof TraitSlotConst) {
|
||||
TraitSlotConst tsc = (TraitSlotConst) traits.traits.get(t);
|
||||
if (tsc.name_index == multinameIndex) {
|
||||
ret.add(new ConstVarNameMultinameUsage(abcTags, this, multinameIndex, classIndex, t, isStatic, traits, parentTraitIndex));
|
||||
ret.add(new ConstVarNameMultinameUsage(this, multinameIndex, classIndex, t, isStatic, traits, parentTraitIndex));
|
||||
}
|
||||
if (tsc.type_index == multinameIndex) {
|
||||
ret.add(new ConstVarTypeMultinameUsage(abcTags, this, multinameIndex, classIndex, t, isStatic, traits, parentTraitIndex));
|
||||
ret.add(new ConstVarTypeMultinameUsage(this, multinameIndex, classIndex, t, isStatic, traits, parentTraitIndex));
|
||||
}
|
||||
}
|
||||
if (traits.traits.get(t) instanceof TraitMethodGetterSetter) {
|
||||
TraitMethodGetterSetter tmgs = (TraitMethodGetterSetter) traits.traits.get(t);
|
||||
if (tmgs.name_index == multinameIndex) {
|
||||
ret.add(new MethodNameMultinameUsage(abcTags, this, multinameIndex, classIndex, t, isStatic, false, traits, parentTraitIndex));
|
||||
ret.add(new MethodNameMultinameUsage(this, multinameIndex, classIndex, t, isStatic, false, traits, parentTraitIndex));
|
||||
}
|
||||
checkMultinameUsedInMethod(abcTags, multinameIndex, tmgs.method_info, ret, classIndex, t, isStatic, false, traits, parentTraitIndex);
|
||||
checkMultinameUsedInMethod(multinameIndex, tmgs.method_info, ret, classIndex, t, isStatic, false, traits, parentTraitIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<MultinameUsage> findMultinameDefinition(List<ABCContainerTag> abcTags, int multinameIndex) {
|
||||
List<MultinameUsage> usages = findMultinameUsage(abcTags, multinameIndex);
|
||||
public List<MultinameUsage> findMultinameDefinition(int multinameIndex) {
|
||||
List<MultinameUsage> usages = findMultinameUsage(multinameIndex);
|
||||
List<MultinameUsage> ret = new ArrayList<>();
|
||||
for (MultinameUsage u : usages) {
|
||||
if (u instanceof DefinitionUsage) {
|
||||
@@ -939,38 +944,38 @@ public class ABC {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<MultinameUsage> findMultinameUsage(List<ABCContainerTag> abcTags, int multinameIndex) {
|
||||
public List<MultinameUsage> findMultinameUsage(int multinameIndex) {
|
||||
List<MultinameUsage> ret = new ArrayList<>();
|
||||
if (multinameIndex == 0) {
|
||||
return ret;
|
||||
}
|
||||
for (int c = 0; c < instance_info.size(); c++) {
|
||||
if (instance_info.get(c).name_index == multinameIndex) {
|
||||
ret.add(new ClassNameMultinameUsage(abcTags, this, multinameIndex, c));
|
||||
ret.add(new ClassNameMultinameUsage(this, multinameIndex, c));
|
||||
}
|
||||
if (instance_info.get(c).super_index == multinameIndex) {
|
||||
ret.add(new ExtendsMultinameUsage(abcTags, this, multinameIndex, c));
|
||||
ret.add(new ExtendsMultinameUsage(this, multinameIndex, c));
|
||||
}
|
||||
for (int i = 0; i < instance_info.get(c).interfaces.length; i++) {
|
||||
if (instance_info.get(c).interfaces[i] == multinameIndex) {
|
||||
ret.add(new ImplementsMultinameUsage(abcTags, this, multinameIndex, c));
|
||||
ret.add(new ImplementsMultinameUsage(this, multinameIndex, c));
|
||||
}
|
||||
}
|
||||
checkMultinameUsedInMethod(abcTags, multinameIndex, instance_info.get(c).iinit_index, ret, c, 0, false, true, null, -1);
|
||||
checkMultinameUsedInMethod(abcTags, multinameIndex, class_info.get(c).cinit_index, ret, c, 0, true, true, null, -1);
|
||||
findMultinameUsageInTraits(abcTags, instance_info.get(c).instance_traits, multinameIndex, false, c, ret, -1);
|
||||
findMultinameUsageInTraits(abcTags, class_info.get(c).static_traits, multinameIndex, true, c, ret, -1);
|
||||
checkMultinameUsedInMethod(multinameIndex, instance_info.get(c).iinit_index, ret, c, 0, false, true, null, -1);
|
||||
checkMultinameUsedInMethod(multinameIndex, class_info.get(c).cinit_index, ret, c, 0, true, true, null, -1);
|
||||
findMultinameUsageInTraits(instance_info.get(c).instance_traits, multinameIndex, false, c, ret, -1);
|
||||
findMultinameUsageInTraits(class_info.get(c).static_traits, multinameIndex, true, c, ret, -1);
|
||||
}
|
||||
loopm:
|
||||
for (int m = 1; m < constants.getMultinameCount(); m++) {
|
||||
if (constants.getMultiname(m).kind == Multiname.TYPENAME) {
|
||||
if (constants.getMultiname(m).qname_index == multinameIndex) {
|
||||
ret.add(new TypeNameMultinameUsage(abcTags, this, m));
|
||||
ret.add(new TypeNameMultinameUsage(this, m));
|
||||
continue;
|
||||
}
|
||||
for (int mp : constants.getMultiname(m).params) {
|
||||
if (mp == multinameIndex) {
|
||||
ret.add(new TypeNameMultinameUsage(abcTags, this, m));
|
||||
ret.add(new TypeNameMultinameUsage(this, m));
|
||||
continue loopm;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc;
|
||||
|
||||
import com.jpexs.decompiler.flash.BaseLocalData;
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.helpers.FileTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem;
|
||||
import com.jpexs.helpers.CancellableWorker;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -123,40 +122,40 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
return Helper.joinStrings(pathParts, File.separator);
|
||||
}
|
||||
|
||||
public void convert(final NulWriter writer, final List<ABCContainerTag> abcList, final List<Trait> traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException {
|
||||
public void convert(final NulWriter writer, final List<Trait> traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException {
|
||||
for (int t : traitIndices) {
|
||||
Trait trait = traits.get(t);
|
||||
Multiname name = trait.getName(abc);
|
||||
Namespace ns = name.getNamespace(abc.constants);
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
trait.convertPackaged(null, "", abcList, abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
|
||||
trait.convertPackaged(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
|
||||
} else {
|
||||
trait.convert(null, "", abcList, abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
|
||||
trait.convert(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void appendTo(GraphTextWriter writer, List<ABCContainerTag> abcList, List<Trait> traits, ScriptExportMode exportMode, boolean parallel) throws InterruptedException {
|
||||
public void appendTo(GraphTextWriter writer, List<Trait> traits, ScriptExportMode exportMode, boolean parallel) throws InterruptedException {
|
||||
for (int t : traitIndices) {
|
||||
Trait trait = traits.get(t);
|
||||
Multiname name = trait.getName(abc);
|
||||
Namespace ns = name.getNamespace(abc.constants);
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
trait.toStringPackaged(null, "", abcList, abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
|
||||
trait.toStringPackaged(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
|
||||
} else {
|
||||
trait.toString(null, "", abcList, abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
|
||||
trait.toString(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void toSource(GraphTextWriter writer, final List<ABCContainerTag> abcList, final List<Trait> traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException {
|
||||
public void toSource(GraphTextWriter writer, final List<Trait> traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException {
|
||||
writer.suspendMeasure();
|
||||
int timeout = Configuration.decompilationTimeoutFile.get();
|
||||
try {
|
||||
CancellableWorker.call(new Callable<Void>() {
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
convert(new NulWriter(), abcList, traits, exportMode, parallel);
|
||||
convert(new NulWriter(), traits, exportMode, parallel);
|
||||
return null;
|
||||
}
|
||||
}, timeout, TimeUnit.SECONDS);
|
||||
@@ -173,10 +172,10 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
}
|
||||
writer.continueMeasure();
|
||||
|
||||
appendTo(writer, abcList, traits, exportMode, parallel);
|
||||
appendTo(writer, traits, exportMode, parallel);
|
||||
}
|
||||
|
||||
public File export(String directory, List<ABCContainerTag> abcList, ScriptExportMode exportMode, boolean parallel) throws IOException {
|
||||
public File export(String directory, ScriptExportMode exportMode, boolean parallel) throws IOException {
|
||||
String scriptName = getPathScriptName();
|
||||
String packageName = getPathPackage();
|
||||
File outDir = new File(directory + File.separatorChar + "scripts" + File.separatorChar + makeDirPath(packageName));
|
||||
@@ -192,7 +191,7 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
File file = new File(fileName);
|
||||
try (FileTextWriter writer = new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(file))) {
|
||||
try {
|
||||
toSource(writer, abcList, abc.script_info.get(scriptIndex).traits.traits, exportMode, parallel);
|
||||
toSource(writer, abc.script_info.get(scriptIndex).traits.traits, exportMode, parallel);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(ScriptPack.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public abstract class Trait implements Serializable {
|
||||
|
||||
public abstract void delete(ABC abc, boolean d);
|
||||
|
||||
public String getModifiers(List<ABCContainerTag> abcTags, ABC abc, boolean isStatic) {
|
||||
public String getModifiers(ABC abc, boolean isStatic) {
|
||||
String ret = "";
|
||||
if ((kindFlags & ATTR_Override) > 0) {
|
||||
ret += "override";
|
||||
@@ -59,7 +59,7 @@ public abstract class Trait implements Serializable {
|
||||
String nsname = "";
|
||||
//if (abc.constants.getNamespace(m.namespace_index).kind == Namespace.KIND_NAMESPACE) {
|
||||
{
|
||||
for (ABCContainerTag abcTag : abcTags) {
|
||||
for (ABCContainerTag abcTag : abc.getAbcTags()) {
|
||||
if (m.namespace_index == -1) {
|
||||
break;
|
||||
}
|
||||
@@ -121,15 +121,15 @@ public abstract class Trait implements Serializable {
|
||||
return abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata);
|
||||
}
|
||||
|
||||
public GraphTextWriter toString(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
writer.appendNoHilight(abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata));
|
||||
return writer;
|
||||
}
|
||||
|
||||
public void convert(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
}
|
||||
|
||||
public GraphTextWriter toStringPackaged(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
public GraphTextWriter toStringPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants);
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
String nsname = ns.getName(abc.constants, false);
|
||||
@@ -138,27 +138,27 @@ public abstract class Trait implements Serializable {
|
||||
writer.appendNoHilight(" " + nsname); //assume not null name
|
||||
}
|
||||
writer.startBlock();
|
||||
toString(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
toString(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
writer.endBlock();
|
||||
writer.newLine();
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
public void convertPackaged(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
public void convertPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants);
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
convert(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
convert(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
}
|
||||
}
|
||||
|
||||
public GraphTextWriter toStringHeader(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
toString(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
toString(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
return writer;
|
||||
}
|
||||
|
||||
public void convertHeader(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
convert(parent, path, abcTags, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
convert(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
}
|
||||
|
||||
public Multiname getName(ABC abc) {
|
||||
|
||||
@@ -86,7 +86,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
return "Class " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " class_info=" + class_info + " metadata=" + Helper.intArrToString(metadata);
|
||||
}
|
||||
|
||||
private boolean parseUsagesFromNS(List<ABCContainerTag> abcTags, ABC abc, List<String> imports, List<String> uses, int namespace_index, String ignorePackage, String name) {
|
||||
private boolean parseUsagesFromNS(ABC abc, List<String> imports, List<String> uses, int namespace_index, String ignorePackage, String name) {
|
||||
Namespace ns = abc.constants.getNamespace(namespace_index);
|
||||
if (name.isEmpty()) {
|
||||
name = "*";
|
||||
@@ -100,7 +100,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
/*if (ns.kind == Namespace.KIND_NAMESPACE)*/ {
|
||||
String oldimport = newimport;
|
||||
newimport = null;
|
||||
for (ABCContainerTag abcTag : abcTags) {
|
||||
for (ABCContainerTag abcTag : abc.getAbcTags()) {
|
||||
String newname = abcTag.getABC().nsValueToName(oldimport);
|
||||
if (newname.equals("-")) {
|
||||
return true;
|
||||
@@ -158,13 +158,13 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void parseImportsUsagesFromNS(List<ABCContainerTag> abcTags, ABC abc, List<String> imports, List<String> uses, int namespace_index, String ignorePackage, String name) {
|
||||
private void parseImportsUsagesFromNS(ABC abc, List<String> imports, List<String> uses, int namespace_index, String ignorePackage, String name) {
|
||||
Namespace ns = abc.constants.getNamespace(namespace_index);
|
||||
if (name.isEmpty()) {
|
||||
name = "*";
|
||||
}
|
||||
String newimport = ns.getName(abc.constants, false);
|
||||
if (parseUsagesFromNS(abcTags, abc, imports, uses, namespace_index, ignorePackage, name)) {
|
||||
if (parseUsagesFromNS(abc, imports, uses, namespace_index, ignorePackage, name)) {
|
||||
return;
|
||||
} else if ((ns.kind != Namespace.KIND_PACKAGE) && (ns.kind != Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
return;
|
||||
@@ -189,15 +189,15 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
//}
|
||||
}
|
||||
|
||||
private void parseUsagesFromMultiname(List<ABCContainerTag> abcTags, ABC abc, List<String> imports, List<String> uses, Multiname m, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
private void parseUsagesFromMultiname(ABC abc, List<String> imports, List<String> uses, Multiname m, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
if (m != null) {
|
||||
if (m.kind == Multiname.TYPENAME) {
|
||||
if (m.qname_index != 0) {
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(m.qname_index), ignorePackage, fullyQualifiedNames);
|
||||
parseUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(m.qname_index), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
for (Integer i : m.params) {
|
||||
if (i != 0) {
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(i), ignorePackage, fullyQualifiedNames);
|
||||
parseUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(i), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -206,29 +206,29 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
String name = m.getName(abc.constants, fullyQualifiedNames, false);
|
||||
NamespaceSet nss = m.getNamespaceSet(abc.constants);
|
||||
if (ns != null) {
|
||||
parseUsagesFromNS(abcTags, abc, imports, uses, m.namespace_index, ignorePackage, name);
|
||||
parseUsagesFromNS(abc, imports, uses, m.namespace_index, ignorePackage, name);
|
||||
}
|
||||
if (nss != null) {
|
||||
if (nss.namespaces.length == 1) {
|
||||
parseUsagesFromNS(abcTags, abc, imports, uses, nss.namespaces[0], ignorePackage, name);
|
||||
parseUsagesFromNS(abc, imports, uses, nss.namespaces[0], ignorePackage, name);
|
||||
} else {
|
||||
for (int n : nss.namespaces) {
|
||||
parseUsagesFromNS(abcTags, abc, imports, uses, n, ignorePackage, "");
|
||||
parseUsagesFromNS(abc, imports, uses, n, ignorePackage, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void parseImportsUsagesFromMultiname(List<ABCContainerTag> abcTags, ABC abc, List<String> imports, List<String> uses, Multiname m, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
private void parseImportsUsagesFromMultiname(ABC abc, List<String> imports, List<String> uses, Multiname m, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
if (m != null) {
|
||||
if (m.kind == Multiname.TYPENAME) {
|
||||
if (m.qname_index != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(m.qname_index), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(m.qname_index), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
for (Integer i : m.params) {
|
||||
if (i != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(i), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(i), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -237,40 +237,40 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
String name = m.getName(abc.constants, fullyQualifiedNames, false);
|
||||
NamespaceSet nss = m.getNamespaceSet(abc.constants);
|
||||
if (ns != null) {
|
||||
parseImportsUsagesFromNS(abcTags, abc, imports, uses, m.namespace_index, ignorePackage, name);
|
||||
parseImportsUsagesFromNS(abc, imports, uses, m.namespace_index, ignorePackage, name);
|
||||
}
|
||||
if (nss != null) {
|
||||
for (int n : nss.namespaces) {
|
||||
parseImportsUsagesFromNS(abcTags, abc, imports, uses, n, ignorePackage, nss.namespaces.length > 1 ? "" : name);
|
||||
parseImportsUsagesFromNS(abc, imports, uses, n, ignorePackage, nss.namespaces.length > 1 ? "" : name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void parseImportsUsagesFromMethodInfo(List<ABCContainerTag> abcTags, ABC abc, int method_index, List<String> imports, List<String> uses, String ignorePackage, List<String> fullyQualifiedNames, List<Integer> visitedMethods) {
|
||||
private void parseImportsUsagesFromMethodInfo(ABC abc, int method_index, List<String> imports, List<String> uses, String ignorePackage, List<String> fullyQualifiedNames, List<Integer> visitedMethods) {
|
||||
if ((method_index < 0) || (method_index >= abc.method_info.size())) {
|
||||
return;
|
||||
}
|
||||
visitedMethods.add(method_index);
|
||||
if (abc.method_info.get(method_index).ret_type != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.method_info.get(method_index).ret_type), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(abc.method_info.get(method_index).ret_type), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
for (int t : abc.method_info.get(method_index).param_types) {
|
||||
if (t != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(t), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(t), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
MethodBody body = abc.findBody(method_index);
|
||||
if (body != null) {
|
||||
parseImportsUsagesFromTraits(abcTags, abc, body.traits, imports, uses, ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromTraits(abc, body.traits, imports, uses, ignorePackage, fullyQualifiedNames);
|
||||
for (ABCException ex : body.exceptions) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(ex.type_index), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(ex.type_index), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
for (AVM2Instruction ins : body.getCode().code) {
|
||||
if (ins.definition instanceof NewFunctionIns) {
|
||||
if (ins.operands[0] != method_index) {
|
||||
if (!visitedMethods.contains(ins.operands[0])) {
|
||||
parseImportsUsagesFromMethodInfo(abcTags, abc, ins.operands[0], imports, uses, ignorePackage, fullyQualifiedNames, visitedMethods);
|
||||
parseImportsUsagesFromMethodInfo(abc, ins.operands[0], imports, uses, ignorePackage, fullyQualifiedNames, visitedMethods);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,14 +281,14 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
|| (ins.definition instanceof AsTypeIns)) {
|
||||
int m = ins.operands[0];
|
||||
if (m != 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(m), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(m), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
} else {
|
||||
for (int k = 0; k < ins.definition.operands.length; k++) {
|
||||
|
||||
if (ins.definition.operands[k] == AVM2Code.DAT_MULTINAME_INDEX) {
|
||||
int multinameIndex = ins.operands[k];
|
||||
parseUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(multinameIndex), ignorePackage, fullyQualifiedNames);
|
||||
parseUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(multinameIndex), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,73 +296,73 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
}
|
||||
}
|
||||
|
||||
private void parseImportsUsagesFromTraits(List<ABCContainerTag> abcTags, ABC abc, Traits ts, List<String> imports, List<String> uses, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
private void parseImportsUsagesFromTraits(ABC abc, Traits ts, List<String> imports, List<String> uses, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
for (Trait t : ts.traits) {
|
||||
parseImportsUsagesFromTrait(abcTags, abc, t, imports, uses, ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromTrait(abc, t, imports, uses, ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
|
||||
private void parseImportsUsagesFromTrait(List<ABCContainerTag> abcTags, ABC abc, Trait t, List<String> imports, List<String> uses, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
private void parseImportsUsagesFromTrait(ABC abc, Trait t, List<String> imports, List<String> uses, String ignorePackage, List<String> fullyQualifiedNames) {
|
||||
if (t instanceof TraitMethodGetterSetter) {
|
||||
TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t;
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(tm.name_index), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(tm.name_index), ignorePackage, fullyQualifiedNames);
|
||||
if (tm.method_info != 0) {
|
||||
parseImportsUsagesFromMethodInfo(abcTags, abc, tm.method_info, imports, uses, ignorePackage, fullyQualifiedNames, new ArrayList<Integer>());
|
||||
parseImportsUsagesFromMethodInfo(abc, tm.method_info, imports, uses, ignorePackage, fullyQualifiedNames, new ArrayList<Integer>());
|
||||
}
|
||||
}
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, t.getName(abc), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, t.getName(abc), ignorePackage, fullyQualifiedNames);
|
||||
if (t instanceof TraitSlotConst) {
|
||||
TraitSlotConst ts = (TraitSlotConst) t;
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(ts.name_index), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(ts.type_index), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(ts.name_index), ignorePackage, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(ts.type_index), ignorePackage, fullyQualifiedNames);
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> getImportsUsages(List<ABCContainerTag> abcTags, ABC abc, List<String> imports, List<String> uses, List<String> fullyQualifiedNames) {
|
||||
private List<String> getImportsUsages(ABC abc, List<String> imports, List<String> uses, List<String> fullyQualifiedNames) {
|
||||
//constructor
|
||||
|
||||
String packageName = abc.instance_info.get(class_info).getName(abc.constants).getNamespace(abc.constants).getName(abc.constants, false); //assume not null name
|
||||
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.instance_info.get(class_info).name_index), packageName, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(abc.instance_info.get(class_info).name_index), packageName, fullyQualifiedNames);
|
||||
|
||||
if (abc.instance_info.get(class_info).super_index > 0) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(abc.instance_info.get(class_info).super_index), packageName, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(abc.instance_info.get(class_info).super_index), packageName, fullyQualifiedNames);
|
||||
}
|
||||
for (int i : abc.instance_info.get(class_info).interfaces) {
|
||||
parseImportsUsagesFromMultiname(abcTags, abc, imports, uses, abc.constants.getMultiname(i), packageName, fullyQualifiedNames);
|
||||
parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(i), packageName, fullyQualifiedNames);
|
||||
}
|
||||
|
||||
//static
|
||||
parseImportsUsagesFromTraits(abcTags, abc, abc.class_info.get(class_info).static_traits, imports, uses, packageName, fullyQualifiedNames);
|
||||
parseImportsUsagesFromTraits(abc, abc.class_info.get(class_info).static_traits, imports, uses, packageName, fullyQualifiedNames);
|
||||
|
||||
//static initializer
|
||||
parseImportsUsagesFromMethodInfo(abcTags, abc, abc.class_info.get(class_info).cinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList<Integer>());
|
||||
parseImportsUsagesFromMethodInfo(abc, abc.class_info.get(class_info).cinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList<Integer>());
|
||||
|
||||
//instance
|
||||
parseImportsUsagesFromTraits(abcTags, abc, abc.instance_info.get(class_info).instance_traits, imports, uses, packageName, fullyQualifiedNames);
|
||||
parseImportsUsagesFromTraits(abc, abc.instance_info.get(class_info).instance_traits, imports, uses, packageName, fullyQualifiedNames);
|
||||
|
||||
//instance initializer
|
||||
parseImportsUsagesFromMethodInfo(abcTags, abc, abc.instance_info.get(class_info).iinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList<Integer>());
|
||||
parseImportsUsagesFromMethodInfo(abc, abc.instance_info.get(class_info).iinit_index, imports, uses, packageName, fullyQualifiedNames, new ArrayList<Integer>());
|
||||
return imports;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter toStringHeader(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
abc.instance_info.get(class_info).getClassHeaderStr(writer, abc, fullyQualifiedNames, false);
|
||||
return writer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertHeader(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphTextWriter toString(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
|
||||
writer.startClass(class_info);
|
||||
String packageName = abc.instance_info.get(class_info).getName(abc.constants).getNamespace(abc.constants).getName(abc.constants, false); //assume not null name
|
||||
List<String> namesInThisPackage = new ArrayList<>();
|
||||
for (ABCContainerTag tag : abcTags) {
|
||||
for (ABCContainerTag tag : abc.getAbcTags()) {
|
||||
for (ScriptInfo si : tag.getABC().script_info) {
|
||||
for (Trait t : si.traits.traits) {
|
||||
String spath = t.getPath(tag.getABC());
|
||||
@@ -382,7 +382,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
//imports
|
||||
List<String> imports = new ArrayList<>();
|
||||
List<String> uses = new ArrayList<>();
|
||||
getImportsUsages(abcTags, abc, imports, uses, new ArrayList<String>());
|
||||
getImportsUsages(abc, imports, uses, new ArrayList<String>());
|
||||
|
||||
fullyQualifiedNames = new ArrayList<>();
|
||||
|
||||
@@ -506,9 +506,9 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
//static variables,constants & methods
|
||||
abc.class_info.get(class_info).static_traits.toString(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames, false), abcTags, abc, true, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel);
|
||||
abc.class_info.get(class_info).static_traits.toString(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames, false), abc, true, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel);
|
||||
|
||||
abc.instance_info.get(class_info).instance_traits.toString(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames, false), abcTags, abc, false, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel);
|
||||
abc.instance_info.get(class_info).instance_traits.toString(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames, false), abc, false, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel);
|
||||
|
||||
writer.endBlock(); // class
|
||||
writer.endClass();
|
||||
@@ -517,7 +517,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convert(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
|
||||
fullyQualifiedNames = new ArrayList<>();
|
||||
|
||||
@@ -537,9 +537,9 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
//static variables,constants & methods
|
||||
abc.class_info.get(class_info).static_traits.convert(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames, false), abcTags, abc, true, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel);
|
||||
abc.class_info.get(class_info).static_traits.convert(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames, false), abc, true, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel);
|
||||
|
||||
abc.instance_info.get(class_info).instance_traits.convert(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames, false), abcTags, abc, false, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel);
|
||||
abc.instance_info.get(class_info).instance_traits.convert(this, path +/*packageName +*/ "/" + abc.instance_info.get(class_info).getName(abc.constants).getName(abc.constants, fullyQualifiedNames, false), abc, false, exportMode, false, scriptIndex, class_info, writer, fullyQualifiedNames, parallel);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.types.traits;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
@@ -21,7 +22,6 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import java.util.List;
|
||||
@@ -48,8 +48,8 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public GraphTextWriter toStringHeader(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
String modifier = getModifiers(abc, isStatic) + " ";
|
||||
MethodBody body = abc.findBody(method_info);
|
||||
if (body == null) {
|
||||
modifier = "native " + modifier;
|
||||
@@ -68,13 +68,13 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
writer.startMethod(method_info);
|
||||
writer.startMethod(method_info);
|
||||
toStringHeader(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
if (abc.instance_info.get(classIndex).isInterface()) {
|
||||
writer.appendNoHilight(";");
|
||||
} else {
|
||||
@@ -92,9 +92,9 @@ public class TraitFunction extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
writer.startMethod(method_info);
|
||||
writer.startMethod(method_info);
|
||||
convertHeader(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
if (!abc.instance_info.get(classIndex).isInterface()) {
|
||||
int bodyIndex = abc.findBodyIndex(method_info);
|
||||
if (bodyIndex != -1) {
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.types.traits;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
@@ -21,7 +22,6 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import java.util.List;
|
||||
@@ -43,12 +43,12 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public GraphTextWriter toStringHeader(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
String modifier = getModifiers(abc, isStatic) + " ";
|
||||
if (modifier.equals(" ")) {
|
||||
modifier = "";
|
||||
}
|
||||
@@ -76,10 +76,10 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
writer.startMethod(method_info);
|
||||
path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames, false);
|
||||
path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames, false);
|
||||
convertHeader(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
int bodyIndex = abc.findBodyIndex(method_info);
|
||||
if (!(classIndex != -1 && abc.instance_info.get(classIndex).isInterface() || bodyIndex == -1)) {
|
||||
if (bodyIndex != -1) {
|
||||
@@ -90,10 +90,10 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
writer.startMethod(method_info);
|
||||
path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames, false);
|
||||
path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames, false);
|
||||
toStringHeader(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
int bodyIndex = abc.findBodyIndex(method_info);
|
||||
if (classIndex != -1 && abc.instance_info.get(classIndex).isInterface() || bodyIndex == -1) {
|
||||
writer.appendNoHilight(";");
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.types.traits;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
@@ -25,7 +26,6 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -130,8 +130,8 @@ public class TraitSlotConst extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public GraphTextWriter toString(Trait parent, String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
String modifier = getModifiers(abc, isStatic) + " ";
|
||||
if (modifier.equals(" ")) {
|
||||
modifier = "";
|
||||
}
|
||||
@@ -160,7 +160,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
getNameStr(writer, abc, fullyQualifiedNames);
|
||||
if (assignedValue != null || value_kind != 0) {
|
||||
getValueStr(parent, writer, abc, fullyQualifiedNames);
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.types.traits;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
@@ -20,7 +21,6 @@ import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -83,7 +83,6 @@ public class Traits implements Serializable {
|
||||
Trait trait;
|
||||
boolean makePackages;
|
||||
String path;
|
||||
String path;
|
||||
ABC abc;
|
||||
boolean isStatic;
|
||||
ScriptExportMode exportMode;
|
||||
@@ -95,12 +94,11 @@ public class Traits implements Serializable {
|
||||
boolean parallel;
|
||||
Trait parent;
|
||||
|
||||
|
||||
public TraitConvertTask(Trait trait, Trait parent, boolean makePackages, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, int traitIndex, boolean parallel) {
|
||||
this.trait = trait;
|
||||
this.parent = parent;
|
||||
this.makePackages = makePackages;
|
||||
this.path = path;
|
||||
this.path = path;
|
||||
this.abc = abc;
|
||||
this.isStatic = isStatic;
|
||||
this.exportMode = exportMode;
|
||||
@@ -115,15 +113,15 @@ public class Traits implements Serializable {
|
||||
@Override
|
||||
public Void call() throws InterruptedException {
|
||||
if (makePackages) {
|
||||
if (makePackages) {
|
||||
trait.convertPackaged(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
} else {
|
||||
} else {
|
||||
trait.convert(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
for (int t = 0; t < traits.size(); t++) {
|
||||
writer.newLine();
|
||||
Trait trait = traits.get(t);
|
||||
@@ -139,9 +137,9 @@ public class Traits implements Serializable {
|
||||
writer.startTrait(h);
|
||||
}
|
||||
if (makePackages) {
|
||||
if (makePackages) {
|
||||
trait.toStringPackaged(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
} else {
|
||||
} else {
|
||||
trait.toString(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
|
||||
}
|
||||
if (trait instanceof TraitClass) {
|
||||
writer.endClass();
|
||||
@@ -152,10 +150,10 @@ public class Traits implements Serializable {
|
||||
return writer;
|
||||
}
|
||||
|
||||
|
||||
public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
|
||||
if (!parallel || traits.size() < 2) {
|
||||
for (int t = 0; t < traits.size(); t++) {
|
||||
for (int t = 0; t < traits.size(); t++) {
|
||||
TraitConvertTask task = new TraitConvertTask(traits.get(t), parent, makePackages, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, t, parallel);
|
||||
task.call();
|
||||
}
|
||||
} else {
|
||||
@@ -165,7 +163,7 @@ public class Traits implements Serializable {
|
||||
futureResults = new ArrayList<>();
|
||||
for (int t = 0; t < traits.size(); t++) {
|
||||
// each convert task needs a separate NulWriter, because they are executed parallel
|
||||
// each convert task needs a separate NulWriter, because they are executed parallel
|
||||
TraitConvertTask task = new TraitConvertTask(traits.get(t), parent, makePackages, path, abc, isStatic, exportMode, scriptIndex, classIndex, new NulWriter(), fullyQualifiedNames, t, parallel);
|
||||
Future<Void> future = executor.submit(task);
|
||||
futureResults.add(future);
|
||||
}
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -25,8 +24,8 @@ import java.util.List;
|
||||
*/
|
||||
public class ClassNameMultinameUsage extends InsideClassMultinameUsage implements DefinitionUsage {
|
||||
|
||||
|
||||
public ClassNameMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex) {
|
||||
public ClassNameMultinameUsage(ABC abc, int multinameIndex, int classIndex) {
|
||||
super(abc, multinameIndex, classIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
@@ -23,9 +24,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -33,8 +32,8 @@ import java.util.List;
|
||||
*/
|
||||
public abstract class ConstVarMultinameUsage extends TraitMultinameUsage {
|
||||
|
||||
|
||||
public ConstVarMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) {
|
||||
public ConstVarMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex, traitIndex, isStatic, traits, parentTraitIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,13 +41,13 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage {
|
||||
NulWriter nulWriter = new NulWriter();
|
||||
if (parentTraitIndex > -1) {
|
||||
if (isStatic) {
|
||||
if (isStatic) {
|
||||
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
|
||||
} else {
|
||||
} else {
|
||||
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
|
||||
}
|
||||
}
|
||||
try {
|
||||
try {
|
||||
((TraitSlotConst) traits.traits.get(traitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
|
||||
} catch (InterruptedException ex) {
|
||||
// ignore
|
||||
}
|
||||
@@ -57,13 +56,13 @@ public abstract class ConstVarMultinameUsage extends TraitMultinameUsage {
|
||||
writer.appendNoHilight(super.toString() + " ");
|
||||
if (parentTraitIndex > -1) {
|
||||
if (isStatic) {
|
||||
if (isStatic) {
|
||||
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
|
||||
} else {
|
||||
} else {
|
||||
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
|
||||
}
|
||||
}
|
||||
try {
|
||||
try {
|
||||
((TraitSlotConst) traits.traits.get(traitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
|
||||
} catch (InterruptedException ex) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,8 +25,8 @@ import java.util.List;
|
||||
*/
|
||||
public class ConstVarNameMultinameUsage extends ConstVarMultinameUsage implements DefinitionUsage {
|
||||
|
||||
|
||||
public ConstVarNameMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) {
|
||||
public ConstVarNameMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex, traitIndex, isStatic, traits, parentTraitIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,8 +25,8 @@ import java.util.List;
|
||||
*/
|
||||
public class ConstVarTypeMultinameUsage extends ConstVarMultinameUsage {
|
||||
|
||||
|
||||
public ConstVarTypeMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) {
|
||||
public ConstVarTypeMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex, traitIndex, isStatic, traits, parentTraitIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -25,8 +24,8 @@ import java.util.List;
|
||||
*/
|
||||
public class ExtendsMultinameUsage extends InsideClassMultinameUsage {
|
||||
|
||||
|
||||
public ExtendsMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex) {
|
||||
public ExtendsMultinameUsage(ABC abc, int multinameIndex, int classIndex) {
|
||||
super(abc, multinameIndex, classIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -25,8 +24,8 @@ import java.util.List;
|
||||
*/
|
||||
public class ImplementsMultinameUsage extends InsideClassMultinameUsage {
|
||||
|
||||
|
||||
public ImplementsMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex) {
|
||||
public ImplementsMultinameUsage(ABC abc, int multinameIndex, int classIndex) {
|
||||
super(abc, multinameIndex, classIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -28,8 +27,8 @@ public abstract class InsideClassMultinameUsage extends MultinameUsage {
|
||||
public int multinameIndex;
|
||||
public int classIndex;
|
||||
|
||||
|
||||
public InsideClassMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex) {
|
||||
public InsideClassMultinameUsage(ABC abc, int multinameIndex, int classIndex) {
|
||||
super(abc);
|
||||
this.multinameIndex = multinameIndex;
|
||||
this.classIndex = classIndex;
|
||||
}
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,8 +25,8 @@ import java.util.List;
|
||||
*/
|
||||
public class MethodBodyMultinameUsage extends MethodMultinameUsage {
|
||||
|
||||
|
||||
public MethodBodyMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
public MethodBodyMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
@@ -22,9 +23,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -34,8 +33,8 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage {
|
||||
|
||||
public boolean isInitializer;
|
||||
|
||||
|
||||
public MethodMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
public MethodMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex, traitIndex, isStatic, traits, parentTraitIndex);
|
||||
this.isInitializer = isInitializer;
|
||||
}
|
||||
|
||||
@@ -49,12 +48,12 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage {
|
||||
if (!isInitializer) {
|
||||
if (parentTraitIndex > -1) {
|
||||
if (isStatic) {
|
||||
if (isStatic) {
|
||||
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
|
||||
} else {
|
||||
} else {
|
||||
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
((TraitMethodGetterSetter) traits.traits.get(traitIndex)).convertHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, nulWriter, new ArrayList<String>(), false);
|
||||
}
|
||||
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
@@ -69,13 +68,13 @@ public abstract class MethodMultinameUsage extends TraitMultinameUsage {
|
||||
} else {
|
||||
if (parentTraitIndex > -1) {
|
||||
if (isStatic) {
|
||||
if (isStatic) {
|
||||
((TraitMethodGetterSetter) abc.class_info.get(classIndex).static_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
|
||||
} else {
|
||||
} else {
|
||||
((TraitMethodGetterSetter) abc.instance_info.get(classIndex).instance_traits.traits.get(parentTraitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
|
||||
}
|
||||
writer.appendNoHilight(" ");
|
||||
}
|
||||
}
|
||||
((TraitMethodGetterSetter) traits.traits.get(traitIndex)).toStringHeader(null, "", abc, isStatic, ScriptExportMode.AS, -1/*FIXME*/, classIndex, writer, new ArrayList<String>(), false);
|
||||
}
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,8 +25,8 @@ import java.util.List;
|
||||
*/
|
||||
public class MethodNameMultinameUsage extends MethodMultinameUsage implements DefinitionUsage {
|
||||
|
||||
|
||||
public MethodNameMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
public MethodNameMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,8 +25,8 @@ import java.util.List;
|
||||
*/
|
||||
public class MethodParamsMultinameUsage extends MethodMultinameUsage {
|
||||
|
||||
|
||||
public MethodParamsMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
public MethodParamsMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,8 +25,8 @@ import java.util.List;
|
||||
*/
|
||||
public class MethodReturnTypeMultinameUsage extends MethodMultinameUsage {
|
||||
|
||||
|
||||
public MethodReturnTypeMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
public MethodReturnTypeMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, boolean isInitializer, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex, traitIndex, isStatic, isInitializer, traits, parentTraitIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,12 +12,11 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -25,12 +24,9 @@ import java.util.List;
|
||||
*/
|
||||
public abstract class MultinameUsage {
|
||||
|
||||
|
||||
public ABC abc;
|
||||
|
||||
|
||||
public MultinameUsage(List<ABCContainerTag> abcTags, ABC abc) {
|
||||
public MultinameUsage(ABC abc) {
|
||||
this.abc = abc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -31,8 +30,8 @@ public abstract class TraitMultinameUsage extends InsideClassMultinameUsage {
|
||||
public Traits traits;
|
||||
public int parentTraitIndex;
|
||||
|
||||
|
||||
public TraitMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) {
|
||||
public TraitMultinameUsage(ABC abc, int multinameIndex, int classIndex, int traitIndex, boolean isStatic, Traits traits, int parentTraitIndex) {
|
||||
super(abc, multinameIndex, classIndex);
|
||||
this.traitIndex = traitIndex;
|
||||
this.isStatic = isStatic;
|
||||
this.traits = traits;
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.usages;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import java.util.ArrayList;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -28,8 +27,8 @@ public class TypeNameMultinameUsage extends MultinameUsage {
|
||||
|
||||
public int typename_index;
|
||||
|
||||
|
||||
public TypeNameMultinameUsage(List<ABCContainerTag> abcTags, ABC abc, int typename_index) {
|
||||
public TypeNameMultinameUsage(ABC abc, int typename_index) {
|
||||
super(abc);
|
||||
this.typename_index = typename_index;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.jpexs.decompiler.flash.abc.types.Namespace;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.console.CommandLineArgumentParser;
|
||||
import com.jpexs.decompiler.flash.console.ContextMenuTools;
|
||||
import com.jpexs.decompiler.flash.exporters.swf.SwfFile;
|
||||
import com.jpexs.decompiler.flash.gui.debugger.Debugger;
|
||||
import com.jpexs.decompiler.flash.gui.proxy.ProxyFrame;
|
||||
import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin;
|
||||
@@ -318,7 +317,6 @@ public class Main {
|
||||
startWork(AppStrings.translate("work.reading.swf"), p);
|
||||
}
|
||||
}, Configuration.parallelSpeedUp.get());
|
||||
swf = new SwfFile().getSwf();
|
||||
swf.file = sourceInfo.getFile();
|
||||
swf.fileTitle = sourceInfo.getFileTitle();
|
||||
result.add(swf);
|
||||
|
||||
@@ -636,7 +636,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
boolean hasAbc = !abcList.isEmpty();
|
||||
|
||||
if (hasAbc) {
|
||||
getABCPanel().setSwf(swf);
|
||||
getABCPanel().setAbc(abcList.get(0).getABC());
|
||||
}
|
||||
|
||||
if (isWelcomeScreen) {
|
||||
@@ -706,7 +706,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
swfs.remove(swfList);
|
||||
if (abcPanel != null) {
|
||||
for (SWF swf : swfList) {
|
||||
if (abcPanel.swf == swf) {
|
||||
if (abcPanel.getSwf() == swf) {
|
||||
abcPanel.clearSwf();
|
||||
}
|
||||
}
|
||||
@@ -857,7 +857,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
updateClassesList();
|
||||
reload(true);
|
||||
getABCPanel().hilightScript(getABCPanel().swf, getABCPanel().decompiledTextArea.getScriptLeaf().getClassPath().toString());
|
||||
getABCPanel().hilightScript(getABCPanel().getSwf(), getABCPanel().decompiledTextArea.getScriptLeaf().getClassPath().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1095,10 +1095,13 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
String documentClass = swf.getDocumentClass();
|
||||
if (documentClass != null && !Configuration.dumpView.get()) {
|
||||
showDetail(DETAILCARDAS3NAVIGATOR);
|
||||
showCard(CARDACTIONSCRIPT3PANEL);
|
||||
getABCPanel().setSwf(swf);
|
||||
getABCPanel().hilightScript(swf, documentClass);
|
||||
List<ABCContainerTag> abcList = swf.getAbcList();
|
||||
if (!abcList.isEmpty()) {
|
||||
showDetail(DETAILCARDAS3NAVIGATOR);
|
||||
showCard(CARDACTIONSCRIPT3PANEL);
|
||||
getABCPanel().setAbc(abcList.get(0).getABC());
|
||||
getABCPanel().hilightScript(swf, documentClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1690,7 +1693,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
protected Object doInBackground() throws Exception {
|
||||
int cnt = 0;
|
||||
if (all) {
|
||||
for (ABCContainerTag tag : getABCPanel().swf.getAbcList()) {
|
||||
for (ABCContainerTag tag : getABCPanel().getAbcList()) {
|
||||
tag.getABC().restoreControlFlow();
|
||||
}
|
||||
} else {
|
||||
@@ -1778,7 +1781,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
protected Object doInBackground() throws Exception {
|
||||
try {
|
||||
if (deobfuscationDialog.processAllCheckbox.isSelected()) {
|
||||
for (ABCContainerTag tag : getABCPanel().swf.getAbcList()) {
|
||||
for (ABCContainerTag tag : getABCPanel().getAbcList()) {
|
||||
if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_DEAD_CODE) {
|
||||
tag.getABC().removeDeadCode();
|
||||
} else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_TRAPS) {
|
||||
@@ -2324,7 +2327,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
stopFlashPlayer();
|
||||
if (treeItem instanceof ScriptPack) {
|
||||
final ScriptPack scriptLeaf = (ScriptPack) treeItem;
|
||||
final List<ABCContainerTag> abcList = scriptLeaf.abc.swf.getAbcList();
|
||||
if (setSourceWorker != null) {
|
||||
setSourceWorker.cancel(true);
|
||||
setSourceWorker = null;
|
||||
@@ -2343,10 +2345,10 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
}
|
||||
getABCPanel().detailPanel.methodTraitPanel.methodCodePanel.clear();
|
||||
getABCPanel().navigator.setAbc(abcList, scriptLeaf.abc);
|
||||
getABCPanel().navigator.setAbc(scriptLeaf.abc);
|
||||
getABCPanel().navigator.setClassIndex(classIndex, scriptLeaf.scriptIndex);
|
||||
getABCPanel().setAbc(scriptLeaf.abc);
|
||||
getABCPanel().decompiledTextArea.setScript(scriptLeaf, abcList);
|
||||
getABCPanel().decompiledTextArea.setScript(scriptLeaf);
|
||||
getABCPanel().decompiledTextArea.setClassIndex(classIndex);
|
||||
getABCPanel().decompiledTextArea.setNoTrait();
|
||||
return null;
|
||||
|
||||
@@ -116,7 +116,6 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
private MainPanel mainPanel;
|
||||
public TraitsList navigator;
|
||||
public ABC abc;
|
||||
public SWF swf;
|
||||
public JComboBox<ABCContainerTag> abcComboBox;
|
||||
public DecompiledEditorPane decompiledTextArea;
|
||||
public JScrollPane decompiledScrollPane;
|
||||
@@ -253,24 +252,21 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
//colModel.getColumn(0).setMaxWidth(50);
|
||||
}
|
||||
|
||||
public SWF getSwf() {
|
||||
return abc == null ? null : abc.getSwf();
|
||||
}
|
||||
|
||||
public List<ABCContainerTag> getAbcList() {
|
||||
SWF swf = getSwf();
|
||||
return swf == null ? null : swf.getAbcList();
|
||||
}
|
||||
|
||||
public void clearSwf() {
|
||||
this.swf = null;
|
||||
this.abc = null;
|
||||
constantTable.setModel(new DefaultTableModel());
|
||||
navigator.clearAbc();
|
||||
}
|
||||
|
||||
public void setSwf(SWF swf) {
|
||||
if (this.swf != swf) {
|
||||
this.swf = swf;
|
||||
List<ABCContainerTag> abcList = swf.getAbcList();
|
||||
if (abcList.size() > 0) {
|
||||
this.abc = abcList.get(0).getABC();
|
||||
}
|
||||
navigator.setAbc(abcList, abc);
|
||||
}
|
||||
}
|
||||
|
||||
public void initSplits() {
|
||||
//splitPaneTreeVSNavigator.setDividerLocation(splitPaneTreeVSNavigator.getHeight() / 2);
|
||||
try {
|
||||
@@ -408,7 +404,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
int multinameIndex = decompiledTextArea.getMultinameUnderCaret();
|
||||
if (multinameIndex > -1) {
|
||||
UsageFrame usageFrame = new UsageFrame(swf.getAbcList(), abc, multinameIndex, ABCPanel.this, false);
|
||||
UsageFrame usageFrame = new UsageFrame(abc, multinameIndex, ABCPanel.this, false);
|
||||
usageFrame.setVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -470,7 +466,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
}
|
||||
int multinameIndex = constantTable.convertRowIndexToModel(rowIndex);
|
||||
if (multinameIndex > 0) {
|
||||
UsageFrame usageFrame = new UsageFrame(t.swf.getAbcList(), abc, multinameIndex, t, false);
|
||||
UsageFrame usageFrame = new UsageFrame(abc, multinameIndex, t, false);
|
||||
usageFrame.setVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -504,19 +500,19 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
if (multinameIndex == 0) {
|
||||
return false;
|
||||
}
|
||||
List<MultinameUsage> usages = abc.findMultinameDefinition(swf.getAbcList(), multinameIndex);
|
||||
List<MultinameUsage> usages = abc.findMultinameDefinition(multinameIndex);
|
||||
|
||||
Multiname m = abc.constants.constant_multiname.get(multinameIndex);
|
||||
//search other ABC tags if this is not private multiname
|
||||
if (m.namespace_index > 0 && abc.constants.constant_namespace.get(m.namespace_index).kind != Namespace.KIND_PRIVATE) {
|
||||
for (ABCContainerTag at : swf.getAbcList()) {
|
||||
for (ABCContainerTag at : getAbcList()) {
|
||||
ABC a = at.getABC();
|
||||
if (a == abc) {
|
||||
continue;
|
||||
}
|
||||
int mid = a.constants.getMultinameId(m, false);
|
||||
if (mid > 0) {
|
||||
usages.addAll(a.findMultinameDefinition(swf.getAbcList(), mid));
|
||||
usages.addAll(a.findMultinameDefinition(mid));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -538,32 +534,32 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
Reference<Integer> multinameIndexRef = new Reference<>(0);
|
||||
|
||||
if (decompiledTextArea.getPropertyTypeAtPos(pos, abcIndex, classIndex, traitIndex, classTrait, multinameIndexRef)) {
|
||||
UsageFrame.gotoUsage(ABCPanel.this, new TraitMultinameUsage(swf.getAbcList(), swf.getAbcList().get(abcIndex.getVal()).getABC(), multinameIndexRef.getVal(), classIndex.getVal(), traitIndex.getVal(), classTrait.getVal(), null, -1) {
|
||||
UsageFrame.gotoUsage(ABCPanel.this, new TraitMultinameUsage(getAbcList().get(abcIndex.getVal()).getABC(), multinameIndexRef.getVal(), classIndex.getVal(), traitIndex.getVal(), classTrait.getVal(), null, -1) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
int multinameIndex = decompiledTextArea.getMultinameAtPos(pos);
|
||||
if (multinameIndex > -1) {
|
||||
List<MultinameUsage> usages = abc.findMultinameDefinition(swf.getAbcList(), multinameIndex);
|
||||
List<MultinameUsage> usages = abc.findMultinameDefinition(multinameIndex);
|
||||
|
||||
Multiname m = abc.constants.constant_multiname.get(multinameIndex);
|
||||
//search other ABC tags if this is not private multiname
|
||||
if (m.namespace_index > 0 && abc.constants.constant_namespace.get(m.namespace_index).kind != Namespace.KIND_PRIVATE) {
|
||||
for (ABCContainerTag at : swf.getAbcList()) {
|
||||
for (ABCContainerTag at : getAbcList()) {
|
||||
ABC a = at.getABC();
|
||||
if (a == abc) {
|
||||
continue;
|
||||
}
|
||||
int mid = a.constants.getMultinameId(m, false);
|
||||
if (mid > 0) {
|
||||
usages.addAll(a.findMultinameDefinition(swf.getAbcList(), mid));
|
||||
usages.addAll(a.findMultinameDefinition(mid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//more than one? display list
|
||||
if (usages.size() > 1) {
|
||||
UsageFrame usageFrame = new UsageFrame(swf.getAbcList(), abc, multinameIndex, ABCPanel.this, true);
|
||||
UsageFrame usageFrame = new UsageFrame(abc, multinameIndex, ABCPanel.this, true);
|
||||
usageFrame.setVisible(true);
|
||||
return;
|
||||
} else if (!usages.isEmpty()) { //one
|
||||
@@ -643,7 +639,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
|
||||
public void reload() {
|
||||
lastDecompiled = "";
|
||||
swf.clearScriptCache();
|
||||
getSwf().clearScriptCache();
|
||||
decompiledTextArea.reloadClass();
|
||||
detailPanel.methodTraitPanel.methodCodePanel.clear();
|
||||
}
|
||||
@@ -698,7 +694,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
public void updateSearchPos(ABCPanelSearchResult item) {
|
||||
ScriptPack pack = item.scriptPack;
|
||||
setAbc(pack.abc);
|
||||
decompiledTextArea.setScript(pack, swf.getAbcList());
|
||||
decompiledTextArea.setScript(pack);
|
||||
hilightScript(pack);
|
||||
decompiledTextArea.setCaretPosition(0);
|
||||
|
||||
@@ -795,7 +791,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se
|
||||
mainPanel.updateClassesList();
|
||||
|
||||
if (oldSp != null) {
|
||||
hilightScript(swf, oldSp);
|
||||
hilightScript(getSwf(), oldSp);
|
||||
}
|
||||
setDecompiledEditMode(false);
|
||||
reload();
|
||||
|
||||
@@ -61,7 +61,6 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
private List<Highlighting> classHighlights = new ArrayList<>();
|
||||
private Highlighting currentMethodHighlight;
|
||||
private Highlighting currentTraitHighlight;
|
||||
private ABC abc;
|
||||
private ScriptPack script;
|
||||
public int lastTraitIndex = 0;
|
||||
public boolean ignoreCarret = false;
|
||||
@@ -91,7 +90,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
}
|
||||
|
||||
public Trait getCurrentTrait() {
|
||||
return abc.findTraitByTraitId(classIndex, lastTraitIndex);
|
||||
return script.abc.findTraitByTraitId(classIndex, lastTraitIndex);
|
||||
}
|
||||
|
||||
public ScriptPack getScriptLeaf() {
|
||||
@@ -175,6 +174,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
}
|
||||
|
||||
private boolean displayMethod(int pos, int methodIndex, String name, Trait trait, boolean isStatic) {
|
||||
ABC abc = getABC();
|
||||
if (abc == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -261,6 +261,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
if ("this".equals(lname)) {
|
||||
Highlighting ch = Highlighting.searchPos(classHighlights, pos);
|
||||
int cindex = (int) ch.getProperties().index;
|
||||
ABC abc = getABC();
|
||||
type.setVal(abc.instance_info.get(cindex).getName(abc.constants).getNameWithNamespace(abc.constants, true));
|
||||
return ch.startPos;
|
||||
}
|
||||
@@ -327,6 +328,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
t = sd.getNextToken(t);
|
||||
String ident = t.getString(sd);
|
||||
found = false;
|
||||
List<ABCContainerTag> abcList = getABC().getSwf().getAbcList();
|
||||
loopi:
|
||||
for (int i = 0; i < abcList.size(); i++) {
|
||||
ABC a = abcList.get(i).getABC();
|
||||
@@ -383,6 +385,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
Highlighting tm = Highlighting.searchPos(methodHighlights, pos);
|
||||
Trait currentTrait = null;
|
||||
int currentMethod = -1;
|
||||
ABC abc = getABC();
|
||||
if (tm != null) {
|
||||
|
||||
int mi = (int) tm.getProperties().index;
|
||||
@@ -491,6 +494,8 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
ABC abc = getABC();
|
||||
if (abc == null) {
|
||||
return;
|
||||
}
|
||||
@@ -622,9 +627,8 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
addCaretListener(this);
|
||||
this.abcPanel = abcPanel;
|
||||
}
|
||||
private List<ABCContainerTag> abcList;
|
||||
|
||||
public void setScript(ScriptPack scriptLeaf, List<ABCContainerTag> abcList) {
|
||||
public void setScript(ScriptPack scriptLeaf) {
|
||||
abcPanel.scriptNameLabel.setText(scriptLeaf.getClassPath().toString());
|
||||
int scriptIndex = scriptLeaf.scriptIndex;
|
||||
ScriptInfo script = null;
|
||||
@@ -642,8 +646,6 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
}
|
||||
setText("// " + AppStrings.translate("pleasewait") + "...");
|
||||
|
||||
this.abc = abc;
|
||||
this.abcList = abcList;
|
||||
this.script = scriptLeaf;
|
||||
CachedDecompilation cd = null;
|
||||
try {
|
||||
@@ -665,8 +667,8 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
public void reloadClass() {
|
||||
int ci = classIndex;
|
||||
SWF.uncache(script);
|
||||
if ((script != null) && (abc != null)) {
|
||||
setScript(script, abcList);
|
||||
if (script != null && getABC() != null) {
|
||||
setScript(script);
|
||||
}
|
||||
setNoTrait();
|
||||
setClassIndex(ci);
|
||||
@@ -676,11 +678,10 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
|
||||
return classIndex;
|
||||
}
|
||||
|
||||
public void setABC(ABC abc) {
|
||||
this.abc = abc;
|
||||
setText("");
|
||||
private ABC getABC() {
|
||||
return script == null ? null : script.abc;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setText(String t) {
|
||||
super.setText(t);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.abc;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
|
||||
@@ -30,6 +31,11 @@ public class RootABCContainerTag implements ABCContainerTag {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SWF getSwf() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ABCContainerTag t) {
|
||||
if (t instanceof RootABCContainerTag) {
|
||||
|
||||
@@ -30,9 +30,8 @@ import javax.swing.event.ListSelectionListener;
|
||||
|
||||
public class TraitsList extends JList<Object> implements ListSelectionListener {
|
||||
|
||||
ABC abc;
|
||||
List<ABCContainerTag> abcTags;
|
||||
int classIndex = -1;
|
||||
private ABC abc;
|
||||
private int classIndex = -1;
|
||||
private final ABCPanel abcPanel;
|
||||
private boolean sorted = false;
|
||||
|
||||
@@ -57,16 +56,18 @@ public class TraitsList extends JList<Object> implements ListSelectionListener {
|
||||
|
||||
public void clearAbc() {
|
||||
this.abc = null;
|
||||
this.abcTags = null;
|
||||
setModel(new DefaultListModel<>());
|
||||
}
|
||||
|
||||
public void setAbc(List<ABCContainerTag> abcTags, ABC abc) {
|
||||
public void setAbc(ABC abc) {
|
||||
this.abc = abc;
|
||||
this.abcTags = abcTags;
|
||||
setModel(new DefaultListModel<>());
|
||||
setClassIndex(-1, -1);
|
||||
}
|
||||
|
||||
private List<ABCContainerTag> getAbcTags() {
|
||||
return abc == null ? null : abc.getSwf().getAbcList();
|
||||
}
|
||||
|
||||
public void setClassIndex(int classIndex, int scriptIndex) {
|
||||
if (classIndex >= abc.instance_info.size()) {
|
||||
@@ -77,7 +78,7 @@ public class TraitsList extends JList<Object> implements ListSelectionListener {
|
||||
setModel(new DefaultListModel<>());
|
||||
} else {
|
||||
if (abc != null) {
|
||||
setModel(new TraitsListModel(abcTags, abc, classIndex, scriptIndex, sorted));
|
||||
setModel(new TraitsListModel(abc, classIndex, scriptIndex, sorted));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,7 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||
import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.NulWriter;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -39,7 +37,6 @@ public class TraitsListItem {
|
||||
|
||||
private final Type type;
|
||||
private final boolean isStatic;
|
||||
private final List<ABCContainerTag> abcTags;
|
||||
private final ABC abc;
|
||||
private final int classIndex;
|
||||
private final int index;
|
||||
@@ -47,11 +44,10 @@ public class TraitsListItem {
|
||||
public String STR_INSTANCE_INITIALIZER = AppStrings.translate("abc.traitslist.instanceinitializer");
|
||||
public String STR_CLASS_INITIALIZER = AppStrings.translate("abc.traitslist.classinitializer");
|
||||
|
||||
public TraitsListItem(Type type, int index, boolean isStatic, List<ABCContainerTag> abcTags, ABC abc, int classIndex, int scriptIndex) {
|
||||
public TraitsListItem(Type type, int index, boolean isStatic, ABC abc, int classIndex, int scriptIndex) {
|
||||
this.type = type;
|
||||
this.index = index;
|
||||
this.isStatic = isStatic;
|
||||
this.abcTags = abcTags;
|
||||
this.abc = abc;
|
||||
this.classIndex = classIndex;
|
||||
this.scriptIndex = scriptIndex;
|
||||
@@ -89,14 +85,14 @@ public class TraitsListItem {
|
||||
String s = "";
|
||||
try {
|
||||
if ((type != Type.INITIALIZER) && isStatic) {
|
||||
abc.class_info.get(classIndex).static_traits.traits.get(index).convertHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<String>(), false);
|
||||
abc.class_info.get(classIndex).static_traits.traits.get(index).convertHeader(null, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<String>(), false);
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
abc.class_info.get(classIndex).static_traits.traits.get(index).toStringHeader(null, "", abcTags, abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<String>(), false);
|
||||
abc.class_info.get(classIndex).static_traits.traits.get(index).toStringHeader(null, "", abc, true, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<String>(), false);
|
||||
s = writer.toString();
|
||||
} else if ((type != Type.INITIALIZER) && (!isStatic)) {
|
||||
abc.instance_info.get(classIndex).instance_traits.traits.get(index).convertHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<String>(), false);
|
||||
abc.instance_info.get(classIndex).instance_traits.traits.get(index).convertHeader(null, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, new NulWriter(), new ArrayList<String>(), false);
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
abc.instance_info.get(classIndex).instance_traits.traits.get(index).toStringHeader(null, "", abcTags, abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<String>(), false);
|
||||
abc.instance_info.get(classIndex).instance_traits.traits.get(index).toStringHeader(null, "", abc, false, ScriptExportMode.AS, scriptIndex, classIndex, writer, new ArrayList<String>(), false);
|
||||
s = writer.toString();
|
||||
} else if (!isStatic) {
|
||||
s = STR_INSTANCE_INITIALIZER;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.jpexs.decompiler.flash.gui.abc;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
@@ -28,7 +27,6 @@ import javax.swing.event.ListDataListener;
|
||||
public final class TraitsListModel implements ListModel<Object> {
|
||||
|
||||
private List<TraitsListItem> items;
|
||||
private final List<ABCContainerTag> abcTags;
|
||||
private final ABC abc;
|
||||
private final int classIndex;
|
||||
private final int scriptIndex;
|
||||
@@ -49,17 +47,16 @@ public final class TraitsListModel implements ListModel<Object> {
|
||||
private void reset() {
|
||||
items = new ArrayList<>();
|
||||
for (int t = 0; t < abc.class_info.get(classIndex).static_traits.traits.size(); t++) {
|
||||
items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.class_info.get(classIndex).static_traits.traits.get(t)), t, true, abcTags, abc, classIndex, scriptIndex));
|
||||
items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.class_info.get(classIndex).static_traits.traits.get(t)), t, true, abc, classIndex, scriptIndex));
|
||||
}
|
||||
for (int t = 0; t < abc.instance_info.get(classIndex).instance_traits.traits.size(); t++) {
|
||||
items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.instance_info.get(classIndex).instance_traits.traits.get(t)), t, false, abcTags, abc, classIndex, scriptIndex));
|
||||
items.add(new TraitsListItem(TraitsListItem.Type.getTypeForTrait(abc.instance_info.get(classIndex).instance_traits.traits.get(t)), t, false, abc, classIndex, scriptIndex));
|
||||
}
|
||||
items.add(new TraitsListItem(TraitsListItem.Type.INITIALIZER, 0, false, abcTags, abc, classIndex, scriptIndex));
|
||||
items.add(new TraitsListItem(TraitsListItem.Type.INITIALIZER, 0, true, abcTags, abc, classIndex, scriptIndex));
|
||||
items.add(new TraitsListItem(TraitsListItem.Type.INITIALIZER, 0, false, abc, classIndex, scriptIndex));
|
||||
items.add(new TraitsListItem(TraitsListItem.Type.INITIALIZER, 0, true, abc, classIndex, scriptIndex));
|
||||
}
|
||||
|
||||
public TraitsListModel(List<ABCContainerTag> abcTags, ABC abc, int classIndex, int scriptIndex, boolean sorted) {
|
||||
this.abcTags = abcTags;
|
||||
public TraitsListModel(ABC abc, int classIndex, int scriptIndex, boolean sorted) {
|
||||
this.abc = abc;
|
||||
this.classIndex = classIndex;
|
||||
this.scriptIndex = scriptIndex;
|
||||
|
||||
@@ -55,20 +55,20 @@ public class UsageFrame extends AppDialog implements ActionListener, MouseListen
|
||||
private final UsageListModel usageListModel;
|
||||
private final ABCPanel abcPanel;
|
||||
|
||||
public UsageFrame(List<ABCContainerTag> abcTags, ABC abc, int multinameIndex, ABCPanel abcPanel, boolean definitions) {
|
||||
public UsageFrame(ABC abc, int multinameIndex, ABCPanel abcPanel, boolean definitions) {
|
||||
super(abcPanel.getMainPanel().getMainFrame().getWindow());
|
||||
this.abcPanel = abcPanel;
|
||||
List<MultinameUsage> usages = definitions ? abc.findMultinameDefinition(abcTags, multinameIndex) : abc.findMultinameUsage(abcTags, multinameIndex);
|
||||
List<MultinameUsage> usages = definitions ? abc.findMultinameDefinition(multinameIndex) : abc.findMultinameUsage(multinameIndex);
|
||||
Multiname m = abc.constants.constant_multiname.get(multinameIndex);
|
||||
if (m.namespace_index > 0 && abc.constants.constant_namespace.get(m.namespace_index).kind != Namespace.KIND_PRIVATE) {
|
||||
for (ABCContainerTag at : abcTags) {
|
||||
for (ABCContainerTag at : abc.getAbcTags()) {
|
||||
ABC a = at.getABC();
|
||||
if (a == abc) {
|
||||
continue;
|
||||
}
|
||||
int mid = a.constants.getMultinameId(m, false);
|
||||
if (mid > 0) {
|
||||
usages.addAll(definitions ? a.findMultinameDefinition(abcTags, mid) : a.findMultinameUsage(abcTags, mid));
|
||||
usages.addAll(definitions ? a.findMultinameDefinition(mid) : a.findMultinameUsage(mid));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class UsageFrame extends AppDialog implements ActionListener, MouseListen
|
||||
settrait.run();
|
||||
} else {
|
||||
abcPanel.decompiledTextArea.addScriptListener(settrait);
|
||||
abcPanel.hilightScript(abcPanel.swf, abcPanel.abc.instance_info.get(icu.classIndex).getName(abcPanel.abc.constants).getNameWithNamespace(abcPanel.abc.constants, false));
|
||||
abcPanel.hilightScript(abcPanel.getSwf(), abcPanel.abc.instance_info.get(icu.classIndex).getName(abcPanel.abc.constants).getNameWithNamespace(abcPanel.abc.constants, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user