Changed: AS1/2: Export names are deobfuscated only when start with __Packages.,

if not, then classical escaping is performed (with quotes)
This commit is contained in:
Jindra Petřík
2025-07-21 20:56:01 +02:00
parent a9763c7151
commit 41118564b3
21 changed files with 163 additions and 37 deletions

View File

@@ -48,6 +48,8 @@ All notable changes to this project will be documented in this file.
- Error log window shows last 100 log entries (instead of first 100)
- AS1/2 P-code double Push values have suffix ".0" to properly distinguish them
- AS1/2 P-code float Push values have suffix "f" to properly distinguish them
- AS1/2: Export names are deobfuscated only when start with `__Packages.`,
if not, then classical escaping is performed (with quotes)
## [24.0.1] - 2025-06-27
### Fixed

View File

@@ -245,17 +245,15 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
@Override
public Map<String, String> getNameProperties() {
String expName = swf == null ? "" : swf.getExportName(spriteId);
String exportName = swf == null ? "" : swf.getExportName(spriteId);
Map<String, String> ret = super.getNameProperties();
ret.put("sid", "" + spriteId);
if (expName == null || expName.isEmpty()) {
if (exportName == null || exportName.isEmpty()) {
return ret;
}
//String[] pathParts = expName.contains(".") ? expName.split("\\.") : new String[]{expName};
//ret.put("exp", pathParts[pathParts.length - 1]);
ret.put("exp", expName);
ret.put("exp", Helper.escapeExportname(exportName, true));
return ret;
}

View File

@@ -28,6 +28,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
import com.jpexs.decompiler.flash.types.annotations.Table;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.Helper;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -58,7 +59,7 @@ public class ExportAssetsTag extends SymbolClassTypeTag {
@SWFArray(value = "name", countField = "count")
@Table(value = "assets", itemName = "asset")
@DottedIdentifier
@DottedIdentifier(exportName = true)
public List<String> names;
/**
@@ -164,7 +165,8 @@ public class ExportAssetsTag extends SymbolClassTypeTag {
Map<String, String> ret = super.getNameProperties();
if (names.size() == 1) {
ret.put("chid", "" + tags.get(0));
ret.put("ex", "" + DottedChain.parseNoSuffix(names.get(0)).toPrintableString(false));
String exportName = names.get(0);
ret.put("exp", Helper.escapeExportname(exportName, true));
}
return ret;
}

View File

@@ -162,7 +162,12 @@ public class ImportAssets2Tag extends Tag implements ImportTag {
Map<String, String> ret = super.getNameProperties();
if (names.size() == 1) {
ret.put("chid", "" + tags.get(0));
ret.put("im", "" + DottedChain.parseNoSuffix(names.get(0)).toPrintableString(false));
String importName = names.get(0);
if (importName.startsWith("__Packages.")) {
ret.put("imp", DottedChain.parseNoSuffix(importName).toPrintableString(false));
} else {
ret.put("imp", "\"" + Helper.escapePCodeString(importName) + "\"");
}
}
return ret;
}

View File

@@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
import com.jpexs.decompiler.flash.types.annotations.Table;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.Helper;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -138,7 +139,13 @@ public class ImportAssetsTag extends Tag implements ImportTag {
Map<String, String> ret = super.getNameProperties();
if (names.size() == 1) {
ret.put("chid", "" + tags.get(0));
ret.put("im", "" + DottedChain.parseNoSuffix(names.get(0)).toPrintableString(false));
String importName = names.get(0);
if (importName.startsWith("__Packages.")) {
ret.put("imp", DottedChain.parseNoSuffix(importName).toPrintableString(false));
} else {
ret.put("imp", "\"" + Helper.escapePCodeString(importName) + "\"");
}
}
return ret;
}

View File

@@ -131,7 +131,7 @@ public class PlaceObject2Tag extends PlaceObjectTypeTag implements ASMSourceCont
* If PlaceFlagHasName, Name of character
*/
@Conditional("placeFlagHasName")
@DottedIdentifier
@DottedIdentifier
public String name;
/**

View File

@@ -99,7 +99,7 @@ public abstract class CharacterTag extends Tag implements CharacterIdTag {
ret.put("chid", "" + chid);
}
if (exportName != null) {
ret.put("exp", DottedChain.parseNoSuffix(exportName).toPrintableString(false));
ret.put("exp", Helper.escapeExportname(exportName, true));
}
if (!classNames.isEmpty()) {
List<String> escapedList = new ArrayList<>();

View File

@@ -25,7 +25,9 @@ import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.filters.FILTER;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.Helper;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
@@ -336,7 +338,7 @@ public abstract class PlaceObjectTypeTag extends Tag implements CharacterIdTag,
ret.put("chid", "" + charId);
}
if (exportName != null) {
ret.put("exp", exportName);
ret.put("exp", Helper.escapeExportname(exportName, true));
}
}

View File

@@ -18,7 +18,9 @@ package com.jpexs.decompiler.flash.tags.base;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.Helper;
import java.util.Map;
/**
@@ -48,7 +50,7 @@ public abstract class RemoveTag extends Tag implements DepthTag {
ret.put("chid", "" + getCharacterId());
}
if (exportName != null) {
ret.put("exp", exportName);
ret.put("exp", Helper.escapeExportname(exportName, true));
}
ret.put("dpt", "" + getDepth());

View File

@@ -30,4 +30,5 @@ import java.lang.annotation.Target;
@Target(ElementType.FIELD)
public @interface DottedIdentifier {
boolean as3() default false;
boolean exportName() default false;
}

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.ApplicationInfo;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.helpers.Freed;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.TranslateStack;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.helpers.utf8.Utf8Helper;
@@ -237,6 +238,31 @@ public class Helper {
return sb.toString();
}
/**
* Escapes export name
* @param s Input string
* @param quote Add quotes when not starts __Packages.
* @return Escaped string
*/
public static String escapeExportname(String s, boolean quote) {
if (s.startsWith("__Packages.")) {
return DottedChain.parseNoSuffix(s).toPrintableString(false);
}
return (quote ? "\"" : "") + escapePCodeString(s) + (quote ? "\"" : "");
}
/**
* Unescape export name
* @param s Input string
* @return Unescaped string
*/
public static String unescapeExportname(String s) {
if (s.startsWith("__Packages.")) {
return DottedChain.parsePrintable(s).toRawString();
}
return unescapePCodeString(s);
}
/**
* Escapes string by adding backslashes
*
@@ -285,6 +311,58 @@ public class Helper {
return ret.toString();
}
/**
* Unescapes PCode String
* @param s Input string
* @return Unescaped string
*/
public static String unescapePCodeString(String s) {
StringBuilder ret = new StringBuilder(s.length());
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c == '\\') {
if (i + 1 < s.length() - 1) {
i++;
c = s.charAt(i);
if (c == 'n') {
ret.append("\n");
} else if (c == 'r') {
ret.append("\r");
} else if (c == 't') {
ret.append("\t");
} else if (c == 'b') {
ret.append("\b");
} else if (c == 'f') {
ret.append("\f");
} else if (c == '\\') {
ret.append("\\");
} else if (c == '"') {
ret.append("\"");
} else if (c == '\'') {
ret.append("'");
} else if (c == 'x' && i + 2 < s.length() - 1) {
ret.append((char) Integer.parseInt(s.substring(i + 1, i + 3), 16));
i += 2;
} else if (c == '{') {
int endPos = s.indexOf("}", i);
if (endPos != -1) {
int numRepeat = Integer.parseInt(s.substring(i + 1, endPos));
i = endPos + 1;
c = s.charAt(i);
for (int j = 0; j < numRepeat; j++) {
ret.append(c);
}
}
}
}
} else {
ret.append(c);
}
}
return ret.toString();
}
/**
* Escapes string by adding backslashes - limits to english characters -
* other are unicode escaped.

Binary file not shown.

View File

@@ -8,7 +8,7 @@
<DOMSoundItem name="punch_or_whack_-Vladimir-403040765.wav" itemID="56b4f54f-0000020c" sourceExternalFilepath="./LIBRARY/punch_or_whack_-Vladimir-403040765.wav" sourceLastImported="1454699830" externalFileCRC32="3062495803" externalFileSize="140100" href="punch_or_whack_-Vladimir-403040765.wav" soundDataHRef="M 5 1454699855.dat" format="44kHz 16bit Stereo" sampleCount="34995"/>
</media>
<symbols>
<Include href="blue.xml" itemID="50f29ad0-000001d6" lastModified="1678904510"/>
<Include href="blue.xml" itemID="50f29ad0-000001d6" lastModified="1753117135"/>
<Include href="klikatice.xml" loadImmediate="false" itemID="51a64400-0000024b" lastModified="1369850880"/>
<Include href="kolo.xml" loadImmediate="false" itemID="51a5fc86-00000244" lastModified="1370164793"/>
<Include href="list.xml" loadImmediate="false" itemID="602d8c01-00000217" lastModified="1613718129"/>
@@ -28,10 +28,10 @@
<Include href="Tween 2.xml" itemIcon="1" loadImmediate="false" itemID="50f29bc3-000001e6" lastModified="1358076867"/>
<Include href="Tween 3.xml" itemIcon="1" loadImmediate="false" itemID="50f29c22-000001eb" lastModified="1358076962"/>
<Include href="Tween 4.xml" itemIcon="1" loadImmediate="false" itemID="50f29c22-000001ed" lastModified="1358076962"/>
<Include href="Tween 5.xml" itemIcon="1" loadImmediate="false" itemID="60429674-00000289" lastModified="1614976628"/>
<Include href="Tween 5.xml" itemIcon="1" loadImmediate="false" itemID="60429674-00000289" lastModified="1753122968"/>
</symbols>
<timelines>
<DOMTimeline name="Scene 1" currentFrame="93">
<DOMTimeline name="Scene 1">
<layers>
<DOMLayer name="Layer 16" color="#FF4F4F">
<frames>
@@ -761,9 +761,9 @@
</fills>
<edges>
<Edge fillStyle0="1" fillStyle1="2" edges="
!3159 7239[3270 7033 3327 6947!3327 6947[3353 6908 3412 6794!3412 6794[3470 6682 3500 6639!3500 6639[3602 6491 3649 6692!3649 6692|3713 6670!3713 6670[3760 6655 3782 6655!3782 6655[3942 6655 3985 6781!3985 6781[4007 6844 3996 6914!3996
6914[3996 6948 3999 6995!3999 6995[4000 7031 3993 7054!3993 7054[3976 7106 3860 7224!3860 7224[3847 7237 3741 7292!3741 7292[3638 7346 3616 7372!3616 7372[3594 7396 3511 7442!3511 7442[3435 7483 3427 7483!3427 7483[3409 7483 3407 7468
!3407 7468[3405 7453 3386 7453!3386 7453[3361 7468 3330 7483!3330 7483[3270 7512 3235 7512!3235 7512[3220 7512 3156 7501!3156 7501[3091 7490 3054 7490!3054 7490[3050 7494 3050 7457!3050 7457[3050 7441 3159 7239"/>
!3156 7501[3091 7490 3054 7490!3054 7490[3050 7494 3050 7457!3050 7457[3050 7441 3159 7239!3159 7239[3270 7033 3327 6947!3327 6947[3353 6908 3412 6794!3412 6794[3470 6682 3500 6639!3500 6639[3602 6491 3649 6692!3649 6692|3713 6670!3713
6670[3760 6655 3782 6655!3782 6655[3942 6655 3985 6781!3985 6781[4007 6844 3996 6914!3996 6914[3996 6948 3999 6995!3999 6995[4000 7031 3993 7054!3993 7054[3976 7106 3860 7224!3860 7224[3847 7237 3741 7292!3741 7292[3638 7346 3616 7372
!3616 7372[3594 7396 3511 7442!3511 7442[3435 7483 3427 7483!3427 7483[3409 7483 3407 7468!3407 7468[3405 7453 3386 7453!3386 7453[3361 7468 3330 7483!3330 7483[3270 7512 3235 7512!3235 7512[3220 7512 3156 7501"/>
<Edge fillStyle1="1" edges="
!2675 7305[2675 6953 2924 6704!2924 6704[3174 6454 3525 6454!3525 6454[3622 6454 3711 6474!3711 6474[3733 6454 3765 6434!3765 6434[3806 6409 3930 6340!3930 6340[4062 6261 4196 6152!4196 6152[4256 6104 4311 6071!4311 6071[4428 5999 4520
6000!4520 6000[4595 5999 4654 6049!4654 6049[4666 6059 4677 6071!4677 6071[4717 6116 4741 6186!4741 6186[4765 6256 4765 6315!4765 6315[4765 6361 4719 6443!4719 6443[4667 6534 4584 6614!4584 6614[4420 6774 4222 6815!4222 6815[4376 7028
@@ -858,11 +858,11 @@
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="Layer 5" color="#4FFFFF">
<DOMLayer name="Layer 5" color="#4FFFFF" current="true" isSelected="true">
<frames>
<DOMFrame index="0" duration="75" keyMode="9728">
<elements>
<DOMSymbolInstance libraryItemName="blue" centerPoint3DX="41.8" centerPoint3DY="341.7">
<DOMSymbolInstance libraryItemName="blue" name="myBlueInstance" centerPoint3DX="41.8" centerPoint3DY="341.7">
<matrix>
<Matrix a="0.39276123046875" d="0.39276123046875" tx="31.15" ty="328.65"/>
</matrix>
@@ -1009,7 +1009,7 @@
</DOMFrame>
</frames>
</DOMLayer>
<DOMLayer name="Layer 1" color="#4FFF4F" current="true" isSelected="true">
<DOMLayer name="Layer 1" color="#4FFF4F">
<frames>
<DOMFrame index="0" duration="22" keyMode="9728">
<elements/>
@@ -3479,6 +3479,9 @@ switch(test)
</timelines>
<PrinterSettings/>
<publishHistory>
<PublishItem publishSize="109225" publishTime="1753122880"/>
<PublishItem publishSize="109211" publishTime="1753117139"/>
<PublishItem publishSize="109103" publishTime="1753117077"/>
<PublishItem publishSize="109188" publishTime="1752429800"/>
<PublishItem publishSize="109184" publishTime="1752429338"/>
<PublishItem publishSize="109169" publishTime="1752429277"/>
@@ -3496,8 +3499,5 @@ switch(test)
<PublishItem publishSize="108712" publishTime="1722538048"/>
<PublishItem publishSize="108683" publishTime="1722537974"/>
<PublishItem publishSize="108493" publishTime="1710662026"/>
<PublishItem publishSize="1157" publishTime="1710661951"/>
<PublishItem publishSize="1156" publishTime="1710661951"/>
<PublishItem publishSize="1156" publishTime="1710661950"/>
</publishHistory>
</DOMDocument>

View File

@@ -1,4 +1,4 @@
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="Tween 5" itemID="60429674-00000289" symbolType="graphic" lastModified="1614976628">
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="Tween 5" itemID="60429674-00000289" symbolType="graphic" lastModified="1753122968">
<timeline>
<DOMTimeline name="Tween 5">
<layers>

View File

@@ -1,4 +1,4 @@
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="blue" itemID="50f29ad0-000001d6" linkageExportForAS="true" linkageIdentifier="blue" linkageClassName="MyBlueSprite" lastModified="1678904510">
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="blue" itemID="50f29ad0-000001d6" linkageExportForAS="true" linkageIdentifier="Blue Symbol" linkageClassName="MyBlueSprite" lastModified="1753117135">
<timeline>
<DOMTimeline name="blue">
<layers>
@@ -36,8 +36,8 @@ trace("init_blue");
</StrokeStyle>
</strokes>
<edges>
<Edge fillStyle1="1" strokeStyle="1" edges="!1262 253[1226 402 1321 562!1321 562[1336 582 1523 825!1523 825[1642 976 1647 1087!1647 1087[1654 1238 1475 1397!1475 1397[1351 1509 1091 1776!1091 1776[861 2014 767 2089!767 2089[619 2208 569 2155!569 2155[511 2092 568 1787!568 1787
|724 930!724 930[464 939 243 859!243 859[50 787 -57 669!-57 669[-160 555 -134 455!-134 455[-106 348 59 314!59 314[178 288 456 198!456 198[750 102 875 73!875 73[1331 -36 1262 253"/>
<Edge fillStyle1="1" strokeStyle="1" edges="!1321 562[1336 582 1523 825!1523 825[1642 976 1647 1087!1647 1087[1654 1238 1475 1397!1475 1397[1351 1509 1091 1776!1091 1776[861 2014 767 2089!767 2089[619 2208 569 2155!569 2155[511 2092 568 1787!568 1787|724 930!724 930[464 939 243
859!243 859[50 787 -57 669!-57 669[-160 555 -134 455!-134 455[-106 348 59 314!59 314[178 288 456 198!456 198[750 102 875 73!875 73[1331 -36 1262 253!1262 253[1226 402 1321 562"/>
<Edge cubics="!724 930(;-16,957 -399,411 59,314q724 930Q464 939q243 859Q50 787q-57 669Q-160 555q-134 455Q-106 348q59 314);"/>
<Edge cubics="!59 314(;518,215 1372,-211 1262,253q59 314Q178 288q456 198Q750 102q875 73Q1331 -36q1262 253);"/>
<Edge cubics="!1262 253(;1152,717 1996,929 1475,1397q1262 253Q1226 402q1321 562Q1336 582q1523 825Q1642 976q1647 1087Q1654 1238q1475 1397);"/>

View File

@@ -5,8 +5,8 @@
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreatorTool>Adobe Flash CS4 Professional</xmp:CreatorTool>
<xmp:CreateDate>2010-08-03T10:48:58+02:00</xmp:CreateDate>
<xmp:MetadataDate>2025-07-13T10:54:33-07:00</xmp:MetadataDate>
<xmp:ModifyDate>2025-07-13T10:54:33-07:00</xmp:ModifyDate>
<xmp:MetadataDate>2025-07-21T09:57:55-07:00</xmp:MetadataDate>
<xmp:ModifyDate>2025-07-21T09:57:55-07:00</xmp:ModifyDate>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
@@ -22,7 +22,7 @@
<stRef:originalDocumentID>xmp.did:8DD71700DC9EDF1194ADAC9B23608190</stRef:originalDocumentID>
</xmpMM:DerivedFrom>
<xmpMM:DocumentID>xmp.did:F0EB4FF7CAC3ED11AC9DC078F41E1AA7</xmpMM:DocumentID>
<xmpMM:InstanceID>xmp.iid:587E6B88F65FF0119C96D9FB8C6458ED</xmpMM:InstanceID>
<xmpMM:InstanceID>xmp.iid:5606F1423266F01194B1B97CA76F6B16</xmpMM:InstanceID>
<xmpMM:OriginalDocumentID>xmp.did:8DD71700DC9EDF1194ADAC9B23608190</xmpMM:OriginalDocumentID>
<xmpMM:History>
<rdf:Seq>
@@ -494,6 +494,12 @@
<stEvt:when>2010-08-03T10:48:58+02:00</stEvt:when>
<stEvt:softwareAgent>Adobe Flash Professional CS6 - build 481</stEvt:softwareAgent>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stEvt:action>created</stEvt:action>
<stEvt:instanceID>xmp.iid:5606F1423266F01194B1B97CA76F6B16</stEvt:instanceID>
<stEvt:when>2010-08-03T10:48:58+02:00</stEvt:when>
<stEvt:softwareAgent>Adobe Flash Professional CS6 - build 481</stEvt:softwareAgent>
</rdf:li>
</rdf:Seq>
</xmpMM:History>
</rdf:Description>

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.tags.DoInitActionTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.timeline.FrameScript;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.SerializableImage;
import java.awt.Color;
import java.awt.Dimension;
@@ -256,7 +257,11 @@ public class FolderListPanel extends JPanel {
String expName = tag.getSwf().getExportName(tag.getCharacterId());
if (expName != null && !expName.isEmpty()) {
String[] pathParts = expName.contains(".") ? expName.split("\\.") : new String[]{expName};
s = IdentifiersDeobfuscation.printIdentifier(false, pathParts[pathParts.length - 1]);
if (expName.startsWith("__Packages.")) {
s = IdentifiersDeobfuscation.printIdentifier(false, pathParts[pathParts.length - 1]);
} else {
s = Helper.escapeExportname(expName, false);
}
}
}
if (s == null) {

View File

@@ -63,6 +63,7 @@ import com.jpexs.decompiler.flash.types.filters.CONVOLUTIONFILTER;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.ConcreteClasses;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.ReflectionTools;
import java.awt.BorderLayout;
import java.awt.Color;
@@ -909,7 +910,11 @@ public class GenericTagTreePanel extends GenericTagPanel {
DottedIdentifier di = field.getAnnotation(DottedIdentifier.class);
if (val instanceof String && di != null) {
valStr += " = " + DottedChain.parseNoSuffix(val.toString()).toPrintableString(di.as3());
if (di.exportName()) {
valStr += " = " + Helper.escapeExportname(val.toString(), true);
} else {
valStr += " = " + DottedChain.parseNoSuffix(val.toString()).toPrintableString(di.as3());
}
} else if (val instanceof byte[]) {
valStr += " = " + ((byte[]) val).length + " byte";
} else if (val instanceof ByteArrayRange) {

View File

@@ -89,7 +89,11 @@ public class StringEditor extends JTextArea implements GenericTagEditor {
String newValue = (String) ReflectionTools.getValue(obj, field, index);
DottedIdentifier di = field.getAnnotation(DottedIdentifier.class);
if (di != null) {
newValue = DottedChain.parseNoSuffix(newValue).toPrintableString(di.as3());
if (di.exportName()) {
newValue = Helper.escapeExportname(newValue, false);
} else {
newValue = DottedChain.parseNoSuffix(newValue).toPrintableString(di.as3());
}
}
setText(newValue);
} catch (IllegalArgumentException | IllegalAccessException ex) {
@@ -104,7 +108,11 @@ public class StringEditor extends JTextArea implements GenericTagEditor {
String newValue = getText();
DottedIdentifier di = field.getAnnotation(DottedIdentifier.class);
if (di != null) {
newValue = DottedChain.parsePrintable(newValue).toRawString();
if (di.exportName()) {
newValue = Helper.unescapeExportname(newValue);
} else {
newValue = DottedChain.parsePrintable(newValue).toRawString();
}
}
if (Objects.equals(oldValue, newValue)) {

View File

@@ -90,6 +90,7 @@ import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem;
import com.jpexs.decompiler.flash.treeitems.Openable;
import com.jpexs.decompiler.flash.treeitems.OpenableList;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.helpers.Helper;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Component;
@@ -350,7 +351,11 @@ public class TagTree extends AbstractTagTree {
String expName = tag.getSwf().getExportName(tag.getCharacterId());
if (expName != null && !expName.isEmpty()) {
String[] pathParts = expName.contains(".") ? expName.split("\\.") : new String[]{expName};
return IdentifiersDeobfuscation.printIdentifier(false, pathParts[pathParts.length - 1]);
if (expName.startsWith("__Packages.")) {
return IdentifiersDeobfuscation.printIdentifier(false, pathParts[pathParts.length - 1]);
} else {
return Helper.escapeExportname(expName, false);
}
}
}
if (value != null) {