Added: Unknown and errored tags moved to special folders

This commit is contained in:
Jindra Petřík
2025-07-27 18:04:36 +02:00
parent f0f4467ed9
commit fcdf363efc
13 changed files with 49 additions and 13 deletions

View File

@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
- Optional heap memory status widget in the titlebar
- [#2485] Show variable name in the text tree node label
- Deobfuscate identifiers option - non destructible renaming identifiers for display purposes
- Unknown and errored tags moved to special folders
### Fixed
- [#2474] Gotos incorrectly decompiled

View File

@@ -70,10 +70,10 @@ public class TagStub extends Tag {
return dataStream;
}
@Override
/*@Override
public String toString() {
return tagName + " [ID = " + id + "]";
}
return tagName + " (tid = " + id + ")";
}*/
@Override
public Map<String, String> getNameProperties() {

View File

@@ -63,7 +63,7 @@ public enum TreeNodeType {
REMOVE_OBJECT,
SCALING_GRID,
END,
ERROR,
ERRORED,
ABC,
COOKIE
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1093,4 +1093,7 @@ text.copy = Copy
text.selectAll = Select all
menu.settings.autoDeobfuscateIdentifiers = Deobfuscate identifiers
deobfuscate_options.deobfuscateIdentifiers = Deobfuscate identifiers
deobfuscate_options.deobfuscateIdentifiers = Deobfuscate identifiers
node.unknown = unknown
node.errored = errored

View File

@@ -1089,3 +1089,9 @@ deobfuscate_options.skip_uninitialized_class_fields_detection = P\u0159esko\u010
text.copy = Kop\u00edrovat
text.selectAll = Vybrat v\u0161e
menu.settings.autoDeobfuscateIdentifiers = Deobfukovat identifik\u00e1tory
deobfuscate_options.deobfuscateIdentifiers = Deobfukovat identifik\u00e1tory
node.unknown = nezn\u00e1m\u00e9
node.errored = chybov\u00e9

View File

@@ -72,6 +72,7 @@ import com.jpexs.decompiler.flash.tags.StartSound2Tag;
import com.jpexs.decompiler.flash.tags.StartSoundTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.TagStub;
import com.jpexs.decompiler.flash.tags.UnknownTag;
import com.jpexs.decompiler.flash.tags.VideoFrameTag;
import com.jpexs.decompiler.flash.tags.base.ASMSource;
import com.jpexs.decompiler.flash.tags.base.BinaryDataInterface;
@@ -143,10 +144,8 @@ public abstract class AbstractTagTree extends JTree {
static {
ICONS = new HashMap<>();
for (TreeNodeType treeNodeType : TreeNodeType.values()) {
if (treeNodeType != TreeNodeType.UNKNOWN) {
String tagTypeStr = treeNodeType.toString().toLowerCase(Locale.ENGLISH).replace("_", "");
ICONS.put(treeNodeType, View.getIcon(tagTypeStr + "16"));
}
String tagTypeStr = treeNodeType.toString().toLowerCase(Locale.ENGLISH).replace("_", "");
ICONS.put(treeNodeType, View.getIcon(tagTypeStr + "16"));
}
}
@@ -484,9 +483,13 @@ public abstract class AbstractTagTree extends JTree {
}
if (t instanceof TagStub) {
return TreeNodeType.ERROR;
return TreeNodeType.ERRORED;
}
if (t instanceof UnknownTag) {
return TreeNodeType.UNKNOWN;
}
if (t instanceof Tag) {
return TreeNodeType.OTHER_TAG;
}

View File

@@ -102,6 +102,11 @@ public class TagTreeModel extends AbstractTagTreeModel {
public static final String FOLDER_SCENES = "scenes";
public static final String FOLDER_UNKNOWN = "unknown";
public static final String FOLDER_ERRORED = "errored";
public static final List<String> FOLDERS_ORDER = Arrays.asList(
"header",
"cookies",
@@ -118,6 +123,8 @@ public class TagTreeModel extends AbstractTagTreeModel {
"frames",
"scenes",
"others",
"unknown",
"errored",
"scripts"
);
@@ -202,7 +209,9 @@ public class TagTreeModel extends AbstractTagTreeModel {
List<TreeItem> movies,
List<TreeItem> sounds,
List<TreeItem> binaryData,
List<TreeItem> others
List<TreeItem> others,
List<TreeItem> unknown,
List<TreeItem> errored
) {
for (Tag t : timelined.getTags()) {
TreeNodeType ttype = TagTree.getTreeNodeType(t);
@@ -215,7 +224,7 @@ public class TagTreeModel extends AbstractTagTreeModel {
break;
case SPRITE:
sprites.add(t);
walkTimelinedTagList((DefineSpriteTag) t, mappedTags, shapes, morphShapes, sprites, buttons, images, fonts, texts, movies, sounds, binaryData, others);
walkTimelinedTagList((DefineSpriteTag) t, mappedTags, shapes, morphShapes, sprites, buttons, images, fonts, texts, movies, sounds, binaryData, others, unknown, errored);
break;
case BUTTON:
buttons.add(t);
@@ -241,6 +250,12 @@ public class TagTreeModel extends AbstractTagTreeModel {
case AS:
case AS_FRAME:
break;
case UNKNOWN:
unknown.add(t);
break;
case ERRORED:
errored.add(t);
break;
default:
if (t.getId() != ShowFrameTag.ID && !ShowFrameTag.isNestedTagType(t.getId())) {
boolean parentFound = false;
@@ -283,9 +298,11 @@ public class TagTreeModel extends AbstractTagTreeModel {
List<TreeItem> sounds = new ArrayList<>();
List<TreeItem> binaryData = new ArrayList<>();
List<TreeItem> others = new ArrayList<>();
List<TreeItem> unknown = new ArrayList<>();
List<TreeItem> errored = new ArrayList<>();
List<FolderItem> emptyFolders = new ArrayList<>();
Map<Integer, List<TreeItem>> mappedTags = new HashMap<>();
walkTimelinedTagList(swf, mappedTags, shapes, morphShapes, sprites, buttons, images, fonts, texts, movies, sounds, binaryData, others);
walkTimelinedTagList(swf, mappedTags, shapes, morphShapes, sprites, buttons, images, fonts, texts, movies, sounds, binaryData, others, unknown, errored);
Timeline timeline = swf.getTimeline();
int frameCount = timeline.getFrameCount();
@@ -364,6 +381,12 @@ public class TagTreeModel extends AbstractTagTreeModel {
case "others":
addFolderItem(nodeList, emptyFolders, true /*always add*/, translate("node.others"), FOLDER_OTHERS, swf, others);
break;
case "unknown":
addFolderItem(nodeList, emptyFolders, false, translate("node.unknown"), FOLDER_UNKNOWN, swf, unknown);
break;
case "errored":
addFolderItem(nodeList, emptyFolders, false, translate("node.errored"), FOLDER_ERRORED, swf, errored);
break;
case "scripts":
if (swf.isAS3()) {
if (!swf.getAbcList().isEmpty()) {