diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 5a9212c94..8adafb617 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -1869,7 +1869,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable { sos.writeFIXED8(frameRate); sos.writeUI16(frameCount); - sos.writeTags(includeImported ? getTags() : getLocalTags()); + sos.writeTags(getTags()); if (hasEndTag) { sos.writeUI16(0); } @@ -3729,7 +3729,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable { if (ins instanceof ActionConstantPool) { constantPool = new ConstantPool(((ActionConstantPool) ins).constantPool); } - int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; + int staticOperation = 0; int requiredStackSize = ins.getStackPopCount(localData, stack); if (stack.size() < requiredStackSize) { @@ -4069,7 +4069,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable { classNameParts = new String[]{className}; } } - int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; + int staticOperation = 0; List dec; try { dec = Action.actionsToTree(new HashMap<>() /*??*/, true /*Yes, inside doInitAction*/, false, dia.getActions(), version, staticOperation, ""/*FIXME*/, getCharset()); @@ -5138,25 +5138,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable { } return readOnlyTags; - } - - /** - * Gets (readonly) list of all local tags in the SWF file. local = not - * imported. - * - * @return Tags - * @deprecated The tags from getTags method call are all local by default - * now. - */ - public ReadOnlyTagList getLocalTags() { - /*List localTags = new ArrayList<>(); - for (Tag t : tags) { - if (!t.isImported()) { - localTags.add(t); - } - }*/ - return new ReadOnlyTagList(tags); - } + } /** * Adds a tag to the SWF. diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorGetSet.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorGetSet.java index 2a56b21ec..26c776712 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorGetSet.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorGetSet.java @@ -230,7 +230,7 @@ public class AVM2DeobfuscatorGetSet extends SWFDecompilerAdapter { return; } - ins.translate(localData, stack, output, Graph.SOP_USE_STATIC, ""); + ins.translate(localData, stack, output, 0, ""); } boolean ok = false; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java index 3fbf1c919..6f1f09c56 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorRegistersOld.java @@ -317,7 +317,7 @@ public class AVM2DeobfuscatorRegistersOld extends AVM2DeobfuscatorSimpleOld { continue outer; } - ins.translate(localData, stack, output, Graph.SOP_USE_STATIC, ""); + ins.translate(localData, stack, output, 0, ""); if (def instanceof SetLocalTypeIns) { int regId = ((SetLocalTypeIns) def).getRegisterId(ins); if (!ignored.contains(regId)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimpleOld.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimpleOld.java index fed5a21ac..49f3a755b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimpleOld.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimpleOld.java @@ -363,7 +363,7 @@ public class AVM2DeobfuscatorSimpleOld extends AVM2DeobfuscatorZeroJumpsNullPush } } - ins.translate(localData, stack, output, Graph.SOP_USE_STATIC, ""); + ins.translate(localData, stack, output, 0, ""); } if (inlineIns.contains(ins)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index f65769488..963404138 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -471,7 +471,7 @@ public final class MethodBody implements Cloneable { HashMap localRegNames = getLocalRegNames(abc); List convertedItems1; try (Statistics s = new Statistics("AVM2Code.toGraphTargetItems")) { - convertedItems1 = converted.getCode().toGraphTargetItems(callStack, abcIndex, convertData.thisHasDefaultToPrimitive, convertData, path, methodIndex, isStatic, scriptIndex, classIndex, abc, converted, localRegNames, scopeStack, initializerType, fullyQualifiedNames, initTraits, Graph.SOP_USE_STATIC, new HashMap<>()); //converted.getCode().visitCode(converted) + convertedItems1 = converted.getCode().toGraphTargetItems(callStack, abcIndex, convertData.thisHasDefaultToPrimitive, convertData, path, methodIndex, isStatic, scriptIndex, classIndex, abc, converted, localRegNames, scopeStack, initializerType, fullyQualifiedNames, initTraits, 0, new HashMap<>()); //converted.getCode().visitCode(converted) } try (Statistics s = new Statistics("Graph.graphToString")) { Graph.graphToString(convertedItems1, writer, LocalData.create(callStack, abcIndex, abc, localRegNames, fullyQualifiedNames, seenMethods)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java index 7074af88f..3ef63ba78 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java @@ -987,7 +987,7 @@ public abstract class Action implements GraphSourceItem { tree = CancellableWorker.call(new Callable>() { @Override public List call() throws Exception { - int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; + int staticOperation = 0; boolean insideDoInitAction = (asm instanceof DoInitActionTag); List tree = actionsToTree(uninitializedClassTraits, insideDoInitAction, false, new HashMap<>(), new HashMap<>(), new HashMap<>(), actions, version, staticOperation, path, charset); SWFDecompilerPlugin.fireActionTreeCreated(tree, swf); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index b354a53cc..42261546d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -256,7 +256,7 @@ public class DoActionTag extends Tag implements ASMSource { @Override public List getActionsToTree() { try { - return Action.actionsToTree(new HashMap<>(), false, false, getActions(), swf.version, Graph.SOP_USE_STATIC, "", swf.getCharset()); + return Action.actionsToTree(new HashMap<>(), false, false, getActions(), swf.version, 0, "", swf.getCharset()); } catch (InterruptedException ex) { return new ArrayList<>(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 22d977459..bcb156729 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -298,7 +298,7 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource { @Override public List getActionsToTree() { try { - return Action.actionsToTree(swf.getUninitializedAs2ClassTraits(), true, false, getActions(), swf.version, Graph.SOP_USE_STATIC, "", swf.getCharset()); + return Action.actionsToTree(swf.getUninitializedAs2ClassTraits(), true, false, getActions(), swf.version, 0, "", swf.getCharset()); } catch (InterruptedException ex) { return new ArrayList<>(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ButtonAction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ButtonAction.java index 1e01fe2d3..7e451647f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ButtonAction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ButtonAction.java @@ -224,7 +224,7 @@ public class ButtonAction implements ASMSource { @Override public List getActionsToTree() { try { - return Action.actionsToTree(new HashMap<>(), false, false, getActions(), buttonTag.getSwf().version, Graph.SOP_USE_STATIC, "", buttonTag.getSwf().getCharset()); + return Action.actionsToTree(new HashMap<>(), false, false, getActions(), buttonTag.getSwf().version, 0, "", buttonTag.getSwf().getCharset()); } catch (InterruptedException ex) { return new ArrayList<>(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index 76a68ed68..326bdeb45 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -379,7 +379,7 @@ public class BUTTONCONDACTION implements ASMSource, Serializable, HasSwfAndTag { @Override public List getActionsToTree() { try { - return Action.actionsToTree(new HashMap<>(), false, false, getActions(), swf.version, Graph.SOP_USE_STATIC, "", swf.getCharset()); + return Action.actionsToTree(new HashMap<>(), false, false, getActions(), swf.version, 0, "", swf.getCharset()); } catch (InterruptedException ex) { return new ArrayList<>(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index 89834f1b8..8e632717b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -367,7 +367,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable, HasSwfAndTag { @Override public List getActionsToTree() { try { - return Action.actionsToTree(new HashMap<>(), false, false, getActions(), swf.version, Graph.SOP_USE_STATIC, "", swf.getCharset()); + return Action.actionsToTree(new HashMap<>(), false, false, getActions(), swf.version, 0, "", swf.getCharset()); } catch (InterruptedException ex) { return new ArrayList<>(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java index bacdcb98a..40486fba5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java @@ -95,14 +95,7 @@ public class Graph { * Exceptions in the graph */ private final List exceptions; - - /** - * Constant not used anymore - * - * @deprecated not used. - */ - public static final int SOP_USE_STATIC = 0; - + /** * Debug flag to print all parts */ diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 71c9046f0..057511925 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -544,7 +544,7 @@ public class Main { } if (instrSWF != null) { if (origFile != null) { - for (Tag t : instrSWF.getLocalTags()) { + for (Tag t : instrSWF.getTags()) { if (t instanceof ImportTag) { ImportTag it = (ImportTag) t; String url = it.getUrl(); diff --git a/test/com/jpexs/decompiler/flash/gui/FlashPlayerTest.java b/test/com/jpexs/decompiler/flash/gui/FlashPlayerTest.java index 46622d86e..5fb2407bb 100644 --- a/test/com/jpexs/decompiler/flash/gui/FlashPlayerTest.java +++ b/test/com/jpexs/decompiler/flash/gui/FlashPlayerTest.java @@ -563,7 +563,7 @@ public class FlashPlayerTest { ActionLocalData localData = new ActionLocalData(null, false, new HashMap<>()); TranslateStack stack = new TranslateStack(""); for (Action a : newActions) { - a.translate(localData, stack, output, Graph.SOP_USE_STATIC, ""); + a.translate(localData, stack, output, 0, ""); } String ffdecTranslateResult;