Square brackets is optional

This commit is contained in:
Jindra Petřík
2026-02-17 21:51:10 +01:00
parent 114f774672
commit 6a01ad3180
6 changed files with 25 additions and 8 deletions
@@ -207,7 +207,11 @@ public abstract class AVM2Item extends GraphTargetItem {
}
} else {
isValidName = true;
}
}
if (!Configuration.as3QNameObfuscatedPropsInSquareBrackets.get()) {
isValidName = true;
}
if (isValidName) {
if (((FullMultinameAVM2Item) propertyName).name != null) {
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.IdentifiersDeobfuscation;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.types.Namespace;
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.hilight.HighlightSpecialType;
@@ -216,7 +217,7 @@ public class FullMultinameAVM2Item extends AVM2Item {
String localName;
boolean isAttribute = constants.getMultiname(multinameIndex).isAttribute();
String namespaceSuffix = constants.getMultiname(multinameIndex).getNamespaceSuffix();
if (!isAttribute && afterDot && namespaceSuffix.isEmpty()) {
if (!isAttribute && afterDot && namespaceSuffix.isEmpty() && Configuration.as3QNameObfuscatedPropsInSquareBrackets.get()) {
//do not deobfuscate
localName = constants.getMultiname(multinameIndex).getNameAndCustomNamespace(new HashSet<>(), localData.abc, fullyQualifiedNames, true, true, customNsRef);
} else {
@@ -230,7 +231,7 @@ public class FullMultinameAVM2Item extends AVM2Item {
writer.appendNoHilight("::");
}
if (!isAttribute && afterDot && namespaceSuffix.isEmpty()) {
if (!isAttribute && afterDot && namespaceSuffix.isEmpty() && Configuration.as3QNameObfuscatedPropsInSquareBrackets.get()) {
if (IdentifiersDeobfuscation.isValidName(true, localName)) {
writer.append(localName);
} else {
@@ -1197,6 +1197,10 @@ public final class Configuration {
@ConfigurationCategory("ui")
public static ConfigurationItem<Boolean> showDebugListenInfo = null;
@ConfigurationDefaultBoolean(false)
@ConfigurationCategory("script")
public static ConfigurationItem<Boolean> as3QNameObfuscatedPropsInSquareBrackets = null;
private static Map<String, String> configurationDescriptions = new LinkedHashMap<>();
private static Map<String, String> configurationTitles = new LinkedHashMap<>();