mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-02 20:04:37 +00:00
imports & code formatting 1
This commit is contained in:
@@ -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;
|
||||
|
||||
import com.jpexs.decompiler.flash.action.Action;
|
||||
@@ -1090,7 +1091,7 @@ public class SWFInputStream implements AutoCloseable {
|
||||
Future<Tag> future = executor.submit(new TagResolutionTask((TagStub) tag, di, level, parallel, skipUnusualTags));
|
||||
futureResults.add(future);
|
||||
} else {
|
||||
} else {
|
||||
Future<Tag> future = new ImmediateFuture<>(tag);
|
||||
futureResults.add(future);
|
||||
if (!(tag instanceof TagStub)) {
|
||||
if (di != null) {
|
||||
|
||||
@@ -300,7 +300,7 @@ public class ABC {
|
||||
int mIndex = body.code.code.get(ip).operands[0];
|
||||
if (mIndex > 0) {
|
||||
Multiname m = constants.getMultiname(mIndex);
|
||||
if (m.getNameWithNamespace(constants,true).equals("flash.utils.getDefinitionByName")) {
|
||||
if (m.getNameWithNamespace(constants, true).equals("flash.utils.getDefinitionByName")) {
|
||||
if (ip > 0) {
|
||||
if (body.code.code.get(ip - 1).definition instanceof PushStringIns) {
|
||||
int strIndex = body.code.code.get(ip - 1).operands[0];
|
||||
@@ -698,7 +698,7 @@ public class ABC {
|
||||
for (Trait t : instance_info.get(i).instance_traits.traits) {
|
||||
if (t instanceof TraitMethodGetterSetter) {
|
||||
TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t;
|
||||
if (methodName.equals(t2.getName(this).getName(constants, new ArrayList<String>(),true))) {
|
||||
if (methodName.equals(t2.getName(this).getName(constants, new ArrayList<String>(), true))) {
|
||||
for (MethodBody body : bodies) {
|
||||
if (body.method_info == t2.method_info) {
|
||||
return body;
|
||||
@@ -711,11 +711,11 @@ public class ABC {
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < class_info.size(); i++) {
|
||||
if (className.equals(constants.getMultiname(instance_info.get(i).name_index).getName(constants, new ArrayList<String>(),true))) {
|
||||
if (className.equals(constants.getMultiname(instance_info.get(i).name_index).getName(constants, new ArrayList<String>(), true))) {
|
||||
for (Trait t : class_info.get(i).static_traits.traits) {
|
||||
if (t instanceof TraitMethodGetterSetter) {
|
||||
TraitMethodGetterSetter t2 = (TraitMethodGetterSetter) t;
|
||||
if (methodName.equals(t2.getName(this).getName(constants, new ArrayList<String>(),true))) {
|
||||
if (methodName.equals(t2.getName(this).getName(constants, new ArrayList<String>(), true))) {
|
||||
for (MethodBody body : bodies) {
|
||||
if (body.method_info == t2.method_info) {
|
||||
return body;
|
||||
@@ -794,7 +794,7 @@ public class ABC {
|
||||
TraitSlotConst s = ((TraitSlotConst) t);
|
||||
if (s.isNamespace()) {
|
||||
String key = constants.getNamespace(s.value_index).getName(constants); //assume not null
|
||||
String val = constants.getMultiname(s.name_index).getNameWithNamespace(constants,true);
|
||||
String val = constants.getMultiname(s.name_index).getNameWithNamespace(constants, true);
|
||||
namespaceMap.put(key, val);
|
||||
}
|
||||
}
|
||||
@@ -955,7 +955,7 @@ public class ABC {
|
||||
if (classId > -1) {
|
||||
for (Trait t : instance_info.get(classId).instance_traits.traits) {
|
||||
if (t instanceof TraitMethodGetterSetter) {
|
||||
if (t.getName(this).getName(constants, new ArrayList<String>(),true).equals(methodName)) {
|
||||
if (t.getName(this).getName(constants, new ArrayList<String>(), true).equals(methodName)) {
|
||||
return ((TraitMethodGetterSetter) t).method_info;
|
||||
}
|
||||
}
|
||||
@@ -968,7 +968,7 @@ public class ABC {
|
||||
if (classId > -1) {
|
||||
for (Trait t : instance_info.get(classId).instance_traits.traits) {
|
||||
if (t instanceof TraitMethodGetterSetter) {
|
||||
if (t.getName(this).getName(constants, new ArrayList<String>(),true).equals(methodName)) {
|
||||
if (t.getName(this).getName(constants, new ArrayList<String>(), true).equals(methodName)) {
|
||||
return findBodyIndex(((TraitMethodGetterSetter) t).method_info);
|
||||
}
|
||||
}
|
||||
@@ -984,7 +984,7 @@ public class ABC {
|
||||
|
||||
public int findClassByName(String name) {
|
||||
for (int c = 0; c < instance_info.size(); c++) {
|
||||
String s = constants.getMultiname(instance_info.get(c).name_index).getNameWithNamespace(constants,true);
|
||||
String s = constants.getMultiname(instance_info.get(c).name_index).getNameWithNamespace(constants, true);
|
||||
if (name.equals(s)) {
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ScriptPack implements TreeElementItem {
|
||||
Multiname name = abc.script_info.get(scriptIndex).traits.traits.get(t).getName(abc);
|
||||
Namespace ns = name.getNamespace(abc.constants);
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
scriptName = name.getName(abc.constants, new ArrayList<String>(),false);
|
||||
scriptName = name.getName(abc.constants, new ArrayList<String>(), false);
|
||||
}
|
||||
}
|
||||
return scriptName;
|
||||
|
||||
@@ -119,7 +119,7 @@ public class InstructionDefinition implements Serializable {
|
||||
if (constants.getMultiname(multinameIndex).needsName()) {
|
||||
name = stack.get(pos).toString();
|
||||
} else {
|
||||
name = GraphTextWriter.hilighOffset(constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames,false), ins.offset);
|
||||
name = GraphTextWriter.hilighOffset(constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames, false), ins.offset);
|
||||
}
|
||||
return name + ns;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class ConstructIns extends InstructionDefinition {
|
||||
}
|
||||
if (obj instanceof GetLexAVM2Item) {
|
||||
GetLexAVM2Item glt = (GetLexAVM2Item) obj;
|
||||
isXML = glt.propertyName.getName(constants, fullyQualifiedNames,true).equals("XML");
|
||||
isXML = glt.propertyName.getName(constants, fullyQualifiedNames, true).equals("XML");
|
||||
}
|
||||
|
||||
if (isXML) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class NewClassIns extends InstructionDefinition {
|
||||
HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(), false);
|
||||
stack.pop().toString(writer, LocalData.create(constants, localRegNames, fullyQualifiedNames));
|
||||
String baseType = writer.toString();
|
||||
stack.push(new UnparsedAVM2Item(ins, "new " + abc.constants.getMultiname(abc.instance_info.get(clsIndex).name_index).getName(constants, fullyQualifiedNames,false) + ".class extends " + baseType));
|
||||
stack.push(new UnparsedAVM2Item(ins, "new " + abc.constants.getMultiname(abc.instance_info.get(clsIndex).name_index).getName(constants, fullyQualifiedNames, false) + ".class extends " + baseType));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ClassAVM2Item extends AVM2Item {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append(className.getName(localData.constantsAvm2, localData.fullyQualifiedNames,false));
|
||||
return writer.append(className.getName(localData.constantsAvm2, localData.fullyQualifiedNames, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,7 +62,7 @@ public class FullMultinameAVM2Item extends AVM2Item {
|
||||
if (name != null) {
|
||||
cname = name.toString(LocalData.create(constants, localRegNames, fullyQualifiedNames));
|
||||
} else {
|
||||
cname = (constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames,true));
|
||||
cname = (constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames, true));
|
||||
}
|
||||
String cns = "";
|
||||
if (namespace != null) {
|
||||
@@ -94,7 +94,7 @@ public class FullMultinameAVM2Item extends AVM2Item {
|
||||
} else {
|
||||
ConstantPool constants = localData.constantsAvm2;
|
||||
List<String> fullyQualifiedNames = localData.fullyQualifiedNames;
|
||||
writer.append(constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames,false));
|
||||
writer.append(constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames, false));
|
||||
}
|
||||
return writer;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class GetLexAVM2Item extends AVM2Item {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
|
||||
return writer.append(propertyName.getName(localData.constantsAvm2, localData.fullyQualifiedNames,false));
|
||||
return writer.append(propertyName.getName(localData.constantsAvm2, localData.fullyQualifiedNames, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GetSlotAVM2Item extends AVM2Item {
|
||||
if (slotName == null) {
|
||||
return writer.append("/*UnknownSlot*/");
|
||||
}
|
||||
return writer.append(slotName.getName(localData.constantsAvm2, localData.fullyQualifiedNames,false));
|
||||
return writer.append(slotName.getName(localData.constantsAvm2, localData.fullyQualifiedNames, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -65,7 +65,7 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign
|
||||
if (slotName == null) {
|
||||
return writer.append("/*UnknownSlot*/");
|
||||
}
|
||||
return writer.append(slotName.getName(localData.constantsAvm2, localData.fullyQualifiedNames,false));
|
||||
return writer.append(slotName.getName(localData.constantsAvm2, localData.fullyQualifiedNames, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1630,9 +1630,9 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
TraitSlotConst tsc = (TraitSlotConst) mbody.traits.traits.get(i);
|
||||
GraphTargetItem type = TypeItem.UNBOUNDED;
|
||||
if (tsc.type_index > 0) {
|
||||
type = new TypeItem(abc.constants.constant_multiname.get(tsc.type_index).getNameWithNamespace(abc.constants,true));
|
||||
type = new TypeItem(abc.constants.constant_multiname.get(tsc.type_index).getNameWithNamespace(abc.constants, true));
|
||||
}
|
||||
NameAVM2Item d = new NameAVM2Item(type, 0, tsc.getName(abc).getName(abc.constants, new ArrayList<String>(),true), NameAVM2Item.getDefaultValue("" + type), true, new ArrayList<Integer>());
|
||||
NameAVM2Item d = new NameAVM2Item(type, 0, tsc.getName(abc).getName(abc.constants, new ArrayList<String>(), true), NameAVM2Item.getDefaultValue("" + type), true, new ArrayList<Integer>());
|
||||
d.setSlotNumber(tsc.slot_id);
|
||||
d.setSlotScope(slotScope);
|
||||
mbody.code.code.addAll(0, toInsList(d.toSourceIgnoreReturnValue(localData, this)));
|
||||
@@ -1819,7 +1819,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
for (ScriptInfo si : a.script_info) {
|
||||
for (Trait t : si.traits.traits) {
|
||||
Multiname m = t.getName(a);
|
||||
if (fullCustom.equals(m.getNameWithNamespace(a.constants,true))) {
|
||||
if (fullCustom.equals(m.getNameWithNamespace(a.constants, true))) {
|
||||
if (t instanceof TraitSlotConst) {
|
||||
if (((TraitSlotConst) t).isNamespace()) {
|
||||
return ((TraitSlotConst) t).value_index;
|
||||
@@ -2133,7 +2133,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
indices.add(
|
||||
abc.constants.getMultinameId(
|
||||
new Multiname(Multiname.QNAME,
|
||||
abc.constants.getStringId(superName.getName(a.constants, new ArrayList<String>(),true), true),
|
||||
abc.constants.getStringId(superName.getName(a.constants, new ArrayList<String>(), true), true),
|
||||
abc.constants.getNamespaceId(new Namespace(superName.getNamespace(a.constants).kind, abc.constants.getStringId(superName.getNamespace(a.constants).getName(a.constants), true)), 0, true), 0, 0, new ArrayList<Integer>()), true)
|
||||
);
|
||||
}
|
||||
@@ -2189,7 +2189,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
}
|
||||
for (Trait t : ii.traits.traits) {
|
||||
if (eq(pkg, t.getName(abc).getNamespace(abc.constants).getName(abc.constants))) {
|
||||
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(),true))) {
|
||||
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(), true))) {
|
||||
outName.setVal(obj);
|
||||
outNs.setVal(pkg);
|
||||
outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants));
|
||||
@@ -2212,7 +2212,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
continue;
|
||||
}
|
||||
Multiname clsName = ii.getName(abc.constants);
|
||||
if (obj.equals(clsName.getName(abc.constants, new ArrayList<String>(),true))) {
|
||||
if (obj.equals(clsName.getName(abc.constants, new ArrayList<String>(), true))) {
|
||||
if (eq(pkg, clsName.getNamespace(abc.constants).getName(abc.constants))) {
|
||||
//class found
|
||||
|
||||
@@ -2220,7 +2220,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
if (t.getName(abc) == null) { //in traits phase 2
|
||||
continue;
|
||||
}
|
||||
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(),true))) {
|
||||
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(), true))) {
|
||||
outName.setVal(obj);
|
||||
outNs.setVal(pkg);
|
||||
outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants));
|
||||
@@ -2240,7 +2240,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
if (t.getName(abc) == null) { //in traits phase 2
|
||||
continue;
|
||||
}
|
||||
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(),true))) {
|
||||
if (propertyName.equals(t.getName(abc).getName(abc.constants, new ArrayList<String>(), true))) {
|
||||
outName.setVal(obj);
|
||||
outNs.setVal(pkg);
|
||||
outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants));
|
||||
@@ -2258,7 +2258,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
|
||||
Multiname superName = abc.constants.constant_multiname.get(ii.super_index);
|
||||
if (superName != null) {
|
||||
return searchPrototypeChain(instanceOnly, abcs, superName.getNamespace(abc.constants).getName(abc.constants), superName.getName(abc.constants, new ArrayList<String>(),true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue);
|
||||
return searchPrototypeChain(instanceOnly, abcs, superName.getNamespace(abc.constants).getName(abc.constants), superName.getName(abc.constants, new ArrayList<String>(), true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -2271,7 +2271,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
|
||||
public static void parentNames(ABC abc, List<ABC> allABCs, int name_index, List<Integer> indices, List<String> names, List<String> namespaces, List<ABC> outABCs) {
|
||||
indices.add(name_index);
|
||||
names.add(abc.constants.constant_multiname.get(name_index).getName(abc.constants, new ArrayList<String>(),true));
|
||||
names.add(abc.constants.constant_multiname.get(name_index).getName(abc.constants, new ArrayList<String>(), true));
|
||||
namespaces.add(abc.constants.constant_multiname.get(name_index).getNamespace(abc.constants).getName(abc.constants));
|
||||
Multiname mname = abc.constants.constant_multiname.get(name_index);
|
||||
|
||||
@@ -2284,7 +2284,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
for (ABC a : abcs) {
|
||||
for (int i = 0; i < a.instance_info.size(); i++) {
|
||||
Multiname m = a.constants.constant_multiname.get(a.instance_info.get(i).name_index);
|
||||
if (m.getName(a.constants, new ArrayList<String>(),true).equals(mname.getName(abc.constants, new ArrayList<String>(),true))) {
|
||||
if (m.getName(a.constants, new ArrayList<String>(), true).equals(mname.getName(abc.constants, new ArrayList<String>(), true))) {
|
||||
|
||||
if (m.getNamespace(a.constants).hasName(a.constants, mname.getNamespace(abc.constants).getName(abc.constants))) {
|
||||
//Multiname superName = a.constants.constant_multiname.get(a.instance_info.get(i).super_index);
|
||||
@@ -2380,7 +2380,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
}
|
||||
for (InstanceInfo ii : abc.instance_info) {
|
||||
Multiname mname = abc.constants.constant_multiname.get(ii.name_index);
|
||||
if (mname != null && name.equals(mname.getName(abc.constants, new ArrayList<String>(),true))) {
|
||||
if (mname != null && name.equals(mname.getName(abc.constants, new ArrayList<String>(), true))) {
|
||||
if (mname.getNamespace(abc.constants).hasName(pkg, abc.constants)) {
|
||||
name_index = ii.name_index;
|
||||
break;
|
||||
@@ -2389,7 +2389,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
}
|
||||
for (int i = 1; i < abc.constants.constant_multiname.size(); i++) {
|
||||
Multiname mname = abc.constants.constant_multiname.get(i);
|
||||
if (mname != null && name.equals(mname.getName(abc.constants, new ArrayList<String>(),true))) {
|
||||
if (mname != null && name.equals(mname.getName(abc.constants, new ArrayList<String>(), true))) {
|
||||
if (mname.getNamespace(abc.constants) != null && pkg.equals(mname.getNamespace(abc.constants).getName(abc.constants))) {
|
||||
name_index = i;
|
||||
break;
|
||||
@@ -2399,7 +2399,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
if (name_index == 0) {
|
||||
if (pkg.isEmpty() && localData.currentScript != null /*FIXME!*/) {
|
||||
for (Trait t : localData.currentScript.traits.traits) {
|
||||
if (t.getName(abc).getName(abc.constants, new ArrayList<String>(),true).equals(name)) {
|
||||
if (t.getName(abc).getName(abc.constants, new ArrayList<String>(), true).equals(name)) {
|
||||
name_index = t.name_index;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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;
|
||||
|
||||
import com.jpexs.decompiler.flash.AppStrings;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ScriptInfo {
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE_INTERNAL)
|
||||
|| (ns.kind == Namespace.KIND_PACKAGE)) {
|
||||
String packageName = ns.getName(abc.constants); //assume not null package
|
||||
String objectName = name.getName(abc.constants, new ArrayList<String>(),false);
|
||||
String objectName = name.getName(abc.constants, new ArrayList<String>(), false);
|
||||
List<Integer> traitIndices = new ArrayList<>();
|
||||
|
||||
traitIndices.add(j);
|
||||
|
||||
@@ -32,6 +32,6 @@ public class ClassNameMultinameUsage extends InsideClassMultinameUsage implement
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants,false);
|
||||
return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class InsideClassMultinameUsage extends MultinameUsage {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants,false);
|
||||
return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants, false);
|
||||
}
|
||||
|
||||
public int getMultinameIndex() {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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.action;
|
||||
|
||||
import com.jpexs.decompiler.flash.AppStrings;
|
||||
|
||||
@@ -251,7 +251,7 @@ public class Deobfuscation {
|
||||
}
|
||||
|
||||
public static String makeObfuscatedIdentifier(String s){
|
||||
return "\u00A7"+escapeOIdentifier(s)+"\u00A7";
|
||||
return "\u00A7" + escapeOIdentifier(s) + "\u00A7";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
@@ -74,8 +75,8 @@ public class DefineLocalActionItem extends ActionItem implements SetTypeActionIt
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append("var ");
|
||||
writer.append("var ");
|
||||
|
||||
|
||||
if (((name instanceof DirectValueActionItem)) && (((DirectValueActionItem) name).isString()) && (!Deobfuscation.isValidName(((DirectValueActionItem) name).toStringNoQuotes(localData), "this", "super"))) {
|
||||
writer.append(Deobfuscation.makeObfuscatedIdentifier(((DirectValueActionItem) name).toStringNoQuotes(localData)));
|
||||
} else {
|
||||
stripQuotes(name, localData, writer);
|
||||
|
||||
@@ -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.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
@@ -52,10 +53,10 @@ public class GetVariableActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
|
||||
|
||||
if (((name instanceof DirectValueActionItem)) && (((DirectValueActionItem) name).isString()) && (!Deobfuscation.isValidName(((DirectValueActionItem) name).toStringNoQuotes(localData), "this", "super"))) {
|
||||
return writer.append(Deobfuscation.makeObfuscatedIdentifier(((DirectValueActionItem) name).toStringNoQuotes(localData)));
|
||||
return writer.append(Deobfuscation.makeObfuscatedIdentifier(((DirectValueActionItem) name).toStringNoQuotes(localData)));
|
||||
} else if ((!(name instanceof DirectValueActionItem)) || (!((DirectValueActionItem) name).isString())) {
|
||||
writer.append("eval(");
|
||||
name.appendTo(writer, localData);
|
||||
return writer.append(")");
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
* 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.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.Deobfuscation;
|
||||
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
|
||||
import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionPush;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable;
|
||||
import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
|
||||
@@ -72,12 +72,12 @@ public class SetVariableActionItem extends ActionItem implements SetTypeActionIt
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
if (((name instanceof DirectValueActionItem)) && (((DirectValueActionItem) name).isString()) && (!Deobfuscation.isValidName(((DirectValueActionItem) name).toStringNoQuotes(localData), "this", "super"))) {
|
||||
writer.append(Deobfuscation.makeObfuscatedIdentifier(((DirectValueActionItem) name).toStringNoQuotes(localData)));
|
||||
writer.append(" = ");
|
||||
return value.toString(writer, localData);
|
||||
return value.toString(writer, localData);
|
||||
} else if ((!(name instanceof DirectValueActionItem)) || (!((DirectValueActionItem) name).isString())) {
|
||||
writer.append("set");
|
||||
writer.spaceBeforeCallParenthesies(2);
|
||||
writer.append("(");
|
||||
|
||||
@@ -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.action.swf4;
|
||||
|
||||
import com.jpexs.decompiler.flash.EndOfStreamException;
|
||||
@@ -41,8 +42,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class ActionPush extends Action {
|
||||
|
||||
|
||||
@@ -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.tags;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||
@@ -44,8 +45,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* Extends the capabilities of DefineButton by allowing any state transition to
|
||||
|
||||
@@ -90,14 +90,14 @@ public class Cache<E> {
|
||||
}
|
||||
|
||||
public boolean contains(Object key) {
|
||||
if (storageType == STORAGE_FILES) {
|
||||
if (storageType == STORAGE_FILES) {
|
||||
return cacheFiles.containsKey(key);
|
||||
} else if (storageType == STORAGE_MEMORY) {
|
||||
return cacheMemory.containsKey(key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public void clear() {
|
||||
cacheMemory.clear();
|
||||
for (File f : cacheFiles.values()) {
|
||||
|
||||
@@ -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.helpers;
|
||||
|
||||
import com.jpexs.decompiler.flash.AppStrings;
|
||||
|
||||
@@ -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.helpers;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@@ -28,11 +29,11 @@ import java.util.concurrent.TimeoutException;
|
||||
public class ImmediateFuture<V> implements Future<V> {
|
||||
|
||||
private final V value;
|
||||
private final V value;
|
||||
|
||||
public ImmediateFuture(V value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancel(boolean mayInterruptIfRunning) {
|
||||
return false;
|
||||
|
||||
@@ -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.helpers;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
@@ -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.helpers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -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.helpers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
Reference in New Issue
Block a user