mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-11 22:54:51 +00:00
fix not resolving custom namespaces
This commit is contained in:
@@ -2318,11 +2318,7 @@ public class ABC implements Openable {
|
||||
return newTrait;
|
||||
}
|
||||
|
||||
public DottedChain findCustomNs(int link_ns_index) {
|
||||
String nsname;
|
||||
if (link_ns_index <= 0) {
|
||||
return null;
|
||||
}
|
||||
public DottedChain findCustomNsOfNamespace(int link_ns_index) {
|
||||
Namespace ns = constants.getNamespace(link_ns_index);
|
||||
if (ns.kind != Namespace.KIND_NAMESPACE && ns.kind != Namespace.KIND_PACKAGE_INTERNAL) {
|
||||
return null;
|
||||
@@ -2332,20 +2328,20 @@ public class ABC implements Openable {
|
||||
return DottedChain.parseNoSuffix("AS3");
|
||||
}
|
||||
|
||||
return getSwf().getAbcIndex().nsValueToName(name);
|
||||
/*
|
||||
for (ABCContainerTag abcTag : getAbcTags()) {
|
||||
DottedChain dc = abcTag.getABC().nsValueToName(name);
|
||||
nsname = dc.getLast();
|
||||
return getSwf().getAbcIndex().nsValueToName(name);
|
||||
}
|
||||
|
||||
public DottedChain findCustomNsOfMultiname(Multiname m) {
|
||||
int nskind = m.getSimpleNamespaceKind(constants);
|
||||
if (nskind != Namespace.KIND_NAMESPACE && nskind != Namespace.KIND_PACKAGE_INTERNAL) {
|
||||
return null;
|
||||
}
|
||||
String name = m.getSimpleNamespaceName(constants).toRawString();
|
||||
if (name.equals("http://adobe.com/AS3/2006/builtin")) { //TODO: This should really be resolved using ABC indexing, not hardcoded constant
|
||||
return DottedChain.parseNoSuffix("AS3");
|
||||
}
|
||||
|
||||
if (nsname == null) {
|
||||
continue;
|
||||
}
|
||||
if (!nsname.isEmpty()) {
|
||||
return dc;
|
||||
}
|
||||
}*/
|
||||
//return null;
|
||||
return getSwf().getAbcIndex().nsValueToName(name);
|
||||
}
|
||||
|
||||
public void clearPacksCache() {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class NameSpaceAVM2Item extends AVM2Item {
|
||||
}
|
||||
AVM2ConstantPool constants = localData.constantsAvm2;
|
||||
|
||||
DottedChain dc = localData.abc.findCustomNs(namespaceIndex);
|
||||
DottedChain dc = localData.abc.findCustomNsOfNamespace(namespaceIndex);
|
||||
String nsname = dc != null ? dc.getLast() : null;
|
||||
|
||||
if (nsname != null) {
|
||||
|
||||
@@ -366,9 +366,9 @@ public class Multiname {
|
||||
} else {
|
||||
String name = abc.constants.getString(name_index);
|
||||
|
||||
int nskind = namespace_index <= 0 ? -1 : getNamespace(abc.constants).kind;
|
||||
int nskind = getSimpleNamespaceKind(abc.constants);
|
||||
if (nskind == Namespace.KIND_NAMESPACE || nskind == Namespace.KIND_PACKAGE_INTERNAL) {
|
||||
DottedChain dc = abc.findCustomNs(namespace_index);
|
||||
DottedChain dc = abc.findCustomNsOfMultiname(this);
|
||||
String nsname = dc != null ? dc.getLast() : null;
|
||||
|
||||
if (nsname != null && !"AS3".equals(nsname)) {
|
||||
|
||||
@@ -396,7 +396,7 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
}
|
||||
Multiname m = getName(abc);
|
||||
if (m != null) {
|
||||
DottedChain dc = abc.findCustomNs(m.namespace_index);
|
||||
DottedChain dc = abc.findCustomNsOfMultiname(m);
|
||||
String nsname = dc != null ? dc.getLast() : null;
|
||||
|
||||
int nskind = m.getSimpleNamespaceKind(abc.constants);
|
||||
|
||||
Reference in New Issue
Block a user