Changed: "__defaultPackage" folder changed to scripts main folder

This commit is contained in:
Jindra Petřík
2025-05-25 22:43:16 +02:00
parent ecb37f3a21
commit 07b9cb5174
2 changed files with 21 additions and 12 deletions
+4 -3
View File
@@ -22,10 +22,11 @@ All notable changes to this project will be documented in this file.
- AS1/2 - Single DoAction tag inside frame is now displayed directly as frame node - AS1/2 - Single DoAction tag inside frame is now displayed directly as frame node
so there is no longer need to expand frame nodes (useful for fast switching scripts) so there is no longer need to expand frame nodes (useful for fast switching scripts)
- AS1/2 - Scripts from default package (not these inside `__Packages`) are now - AS1/2 - Scripts from default package (not these inside `__Packages`) are now
exported/imported to/from the folder named `__defaultPackage` for all languages exported/imported to/from main scripts folder instead of localized `<default package>` before.
instead of localized `<default package>` before. (Only happened when package flattening was on)
This may break backwards compatibility. For importing scripts from older This may break backwards compatibility. For importing scripts from older
versions of FFDec, you should rename the folder to the new name. versions of FFDec, you should move the scripts from `<default package>`
to main scripts folder.
### Fixed ### Fixed
@@ -351,8 +351,8 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
/** /**
* Map of characterId to CharacterTag including imported tags. The * Map of characterId to CharacterTag including imported tags. The
* CharacterTags.getCharacterId() does not necessarily be the characterId * CharacterTags.getCharacterId() does not necessarily be the characterId in
* in the map since there can be imported CharacterTags from other SWFs. * the map since there can be imported CharacterTags from other SWFs.
*/ */
@Internal @Internal
private volatile Map<Integer, CharacterTag> charactersWithImported; private volatile Map<Integer, CharacterTag> charactersWithImported;
@@ -3219,6 +3219,16 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
} }
Map<String, ASMSource> asmsToExport = new LinkedHashMap<>(); Map<String, ASMSource> asmsToExport = new LinkedHashMap<>();
for (TreeItem treeItem : getFirstLevelASMNodes(null)) { for (TreeItem treeItem : getFirstLevelASMNodes(null)) {
if (treeItem instanceof AS2Package) {
AS2Package pkg = (AS2Package) treeItem;
if (pkg.isDefaultPackage()) {
getASMs(exportFileNames, treeItem, nodesToExport, exportAll, asmsToExport,
"",
""
);
continue;
}
}
getASMs(exportFileNames, treeItem, nodesToExport, exportAll, asmsToExport, getASMs(exportFileNames, treeItem, nodesToExport, exportAll, asmsToExport,
File.separator + getASMPath(true, treeItem), File.separator + getASMPath(true, treeItem),
File.separator + getASMPath(false, treeItem) File.separator + getASMPath(false, treeItem)
@@ -3325,9 +3335,6 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
if (treeItem instanceof AS2Package) { if (treeItem instanceof AS2Package) {
AS2Package pkg = (AS2Package) treeItem; AS2Package pkg = (AS2Package) treeItem;
if (pkg.isDefaultPackage() && exportFileName) {
return "__defaultPackage";
}
if (pkg.isFlat()) { if (pkg.isFlat()) {
String[] parts = pkg.toString().split("\\."); String[] parts = pkg.toString().split("\\.");
for (int i = 0; i < parts.length; i++) { for (int i = 0; i < parts.length; i++) {
@@ -5119,7 +5126,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
setModified(true); setModified(true);
tags.remove(tag); tags.remove(tag);
updateCharacters(); updateCharacters();
readOnlyTags = null; readOnlyTags = null;
} }
/** /**
@@ -6220,12 +6227,12 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
if (CancellableWorker.isInterrupted()) { if (CancellableWorker.isInterrupted()) {
throw new InterruptedException(); throw new InterruptedException();
} }
if (uninitializedAs2ClassTraits == null) { if (uninitializedAs2ClassTraits == null) {
calculateAs2UninitializedClassTraits(); calculateAs2UninitializedClassTraits();
} }
return uninitializedAs2ClassTraits; return uninitializedAs2ClassTraits;
} }
public boolean needsCalculatingAS2UninitializeClassTraits(ASMSource src) { public boolean needsCalculatingAS2UninitializeClassTraits(ASMSource src) {
if (!isAS3()) { if (!isAS3()) {
if (src instanceof DoInitActionTag) { if (src instanceof DoInitActionTag) {
@@ -6249,9 +6256,10 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
/** /**
* Checks whether SWF was freed * Checks whether SWF was freed
*
* @return True if destroyed * @return True if destroyed
*/ */
public boolean isDestroyed() { public boolean isDestroyed() {
return destroyed; return destroyed;
} }
} }