mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-28 12:16:13 +00:00
custom namespaces fix
This commit is contained in:
@@ -861,11 +861,11 @@ public class ABC {
|
||||
if (getNamespaceMap().containsKey(value)) {
|
||||
return getNamespaceMap().get(value);
|
||||
} else {
|
||||
String ns = getDeobfuscation().builtInNs(value);
|
||||
DottedChain ns = getDeobfuscation().builtInNs(value);
|
||||
if (ns == null) {
|
||||
return new DottedChain("");
|
||||
} else {
|
||||
return new DottedChain(ns);
|
||||
return ns;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.RenameType;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -91,15 +92,15 @@ public class AVM2Deobfuscation {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
public String builtInNs(String ns) {
|
||||
public DottedChain builtInNs(String ns) {
|
||||
if (ns == null) {
|
||||
return null;
|
||||
}
|
||||
if (ns.equals("http://www.adobe.com/2006/actionscript/flash/proxy")) {
|
||||
return "flash.utils.flash_proxy";
|
||||
return new DottedChain("flash", "utils", "flash_proxy");
|
||||
}
|
||||
if (ns.equals("http://adobe.com/AS3/2006/builtin")) {
|
||||
return "-";
|
||||
return new DottedChain("-");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ 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.tags.ABCContainerTag;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@@ -78,7 +79,8 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
if (m.namespace_index == -1) {
|
||||
break;
|
||||
}
|
||||
nsname = abcTag.getABC().nsValueToName(abc.constants.getNamespace(m.namespace_index).getName(abc.constants, true)).getLast();
|
||||
DottedChain dc = abcTag.getABC().nsValueToName(abc.constants.getNamespace(m.namespace_index).getName(abc.constants, true));
|
||||
nsname = dc.getLast();
|
||||
|
||||
if (nsname == null) {
|
||||
break;
|
||||
@@ -90,14 +92,6 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
|
||||
Namespace ns = m.getNamespace(abc.constants);
|
||||
|
||||
if (nsname.isEmpty() || (nsname.equals("-"))) {
|
||||
if (ns != null) {
|
||||
if (ns.kind == Namespace.KIND_NAMESPACE) {
|
||||
nsname = ns.getName(abc.constants, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nsname != null) {
|
||||
String identifier = IdentifiersDeobfuscation.printIdentifier(true, nsname);
|
||||
if (identifier != null && !identifier.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user