diff --git a/CHANGELOG.md b/CHANGELOG.md index 92d1b74f9..6d456d8e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. ### Fixed - [#1897] Close menu button without selecting specific item - Reading UI32 values +- Parsing obfuscated namespaces with hash character "#" ### Changed - Quick search needs minimum of 3 characters diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java index f826d8369..5a1b13890 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java @@ -663,7 +663,7 @@ public class AVM2ConstantPool implements Cloneable { String str = getString(index); DottedChain chain = dottedChainCache.get(str); if (chain == null) { - chain = DottedChain.parseWithSuffix(str); + chain = DottedChain.parseNoSuffix(str); dottedChainCache.put(str, chain); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java index 9f53be65d..1861bea78 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java @@ -88,6 +88,25 @@ public class DottedChain implements Serializable, Comparable { } + public static final DottedChain parseNoSuffix(String name) { + if (name == null) { + return DottedChain.EMPTY; + } else if (name.isEmpty()) { + return DottedChain.TOPLEVEL; + } else { + String parts[] = name.split("\\."); + String nsSuffixes[] = new String[parts.length]; + int i = 0; + for (String part : parts) { + String nameNoSuffix = part; + parts[i] = nameNoSuffix; + nsSuffixes[i] = ""; + i++; + } + + return new DottedChain(parts, nsSuffixes); + } + } public static final DottedChain parseWithSuffix(String name) { if (name == null) { return DottedChain.EMPTY;