mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-23 05:15:48 +00:00
Added FileAttributes tag - SWF relative Urls flag
This commit is contained in:
@@ -39,6 +39,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Traits;
|
||||
import com.jpexs.decompiler.flash.amf.amf3.Amf3Value;
|
||||
import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
|
||||
import com.jpexs.decompiler.flash.tags.FileAttributesTag;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.tags.TagTypeInfo;
|
||||
import com.jpexs.decompiler.flash.tags.UnknownTag;
|
||||
@@ -313,6 +314,19 @@ public class SwfXmlImporter {
|
||||
((SWF) obj).setCharset(val);
|
||||
continue;
|
||||
}
|
||||
|
||||
//backwards compatibility
|
||||
if (name.equals("reserved1") && "FileAttributesTag".equals(attributes.get("type"))) {
|
||||
name = "reservedA";
|
||||
}
|
||||
if (name.equals("reserved2") && "FileAttributesTag".equals(attributes.get("type"))) {
|
||||
name = "swfRelativeUrls";
|
||||
}
|
||||
if (name.equals("reserved3") && "FileAttributesTag".equals(attributes.get("type"))) {
|
||||
name = "reservedB";
|
||||
}
|
||||
|
||||
|
||||
if (!name.equals("type")) {
|
||||
try {
|
||||
Field field = getField(cls, name);
|
||||
|
||||
@@ -37,6 +37,9 @@ public class FileAttributesTag extends Tag {
|
||||
|
||||
public static final String NAME = "FileAttributes";
|
||||
|
||||
@Reserved
|
||||
public boolean reservedA;
|
||||
|
||||
public boolean useDirectBlit;
|
||||
|
||||
public boolean useGPU;
|
||||
@@ -48,16 +51,12 @@ public class FileAttributesTag extends Tag {
|
||||
public boolean useNetwork;
|
||||
|
||||
public boolean noCrossDomainCache;
|
||||
|
||||
@Reserved
|
||||
public boolean reserved1;
|
||||
|
||||
@Reserved
|
||||
public boolean reserved2;
|
||||
|
||||
|
||||
public boolean swfRelativeUrls;
|
||||
|
||||
@SWFType(value = BasicType.UB, count = 24)
|
||||
@Reserved
|
||||
public int reserved3;
|
||||
public int reservedB;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -75,14 +74,14 @@ public class FileAttributesTag extends Tag {
|
||||
|
||||
@Override
|
||||
public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException {
|
||||
reserved1 = sis.readUB(1, "reserved1") == 1; // reserved
|
||||
reservedA = sis.readUB(1, "reservedA") == 1; // reserved
|
||||
// UB[1] == 0 (reserved)
|
||||
useDirectBlit = sis.readUB(1, "useDirectBlit") != 0;
|
||||
useGPU = sis.readUB(1, "useGPU") != 0;
|
||||
hasMetadata = sis.readUB(1, "hasMetadata") != 0;
|
||||
actionScript3 = sis.readUB(1, "actionScript3") != 0;
|
||||
noCrossDomainCache = sis.readUB(1, "noCrossDomainCache") != 0;
|
||||
reserved2 = sis.readUB(1, "reserved2") == 1; // reserved
|
||||
swfRelativeUrls = sis.readUB(1, "swfRelativeUrls") == 1;
|
||||
useNetwork = sis.readUB(1, "useNetwork") != 0;
|
||||
// UB[24] == 0 (reserved)
|
||||
int bitCount = 24;
|
||||
@@ -90,7 +89,7 @@ public class FileAttributesTag extends Tag {
|
||||
bitCount = sis.available() * 8;
|
||||
}
|
||||
|
||||
reserved3 = (int) sis.readUB(bitCount, "reserved3"); //reserved
|
||||
reservedB = (int) sis.readUB(bitCount, "reservedB"); //reserved
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,14 +100,14 @@ public class FileAttributesTag extends Tag {
|
||||
*/
|
||||
@Override
|
||||
public void getData(SWFOutputStream sos) throws IOException {
|
||||
sos.writeUB(1, reserved1 ? 1 : 0); //reserved
|
||||
sos.writeUB(1, reservedA ? 1 : 0); //reserved
|
||||
sos.writeUB(1, useDirectBlit ? 1 : 0);
|
||||
sos.writeUB(1, useGPU ? 1 : 0);
|
||||
sos.writeUB(1, hasMetadata ? 1 : 0);
|
||||
sos.writeUB(1, actionScript3 ? 1 : 0);
|
||||
sos.writeUB(1, noCrossDomainCache ? 1 : 0);
|
||||
sos.writeUB(1, reserved2 ? 1 : 0); //reserved
|
||||
sos.writeUB(1, swfRelativeUrls ? 1 : 0);
|
||||
sos.writeUB(1, useNetwork ? 1 : 0);
|
||||
sos.writeUB(24, reserved3); //reserved
|
||||
sos.writeUB(24, reservedB); //reserved
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user