mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-02 20:04:37 +00:00
Custom SWF Configuration refactoring.
Make configuration serialization compatible with 16.2.0
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package com.jpexs.decompiler.flash.configuration;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class CustomConfigurationKeys {
|
||||
public static final String KEY_LAST_SELECTED_PATH_RESOURCES = "lastSelectedPath.resources";
|
||||
public static final String KEY_LAST_SELECTED_PATH_TAGLIST = "lastSelectedPath.taglist";
|
||||
public static final String KEY_CHARSET = "charset";
|
||||
}
|
||||
@@ -26,17 +26,15 @@ import java.util.Map;
|
||||
*/
|
||||
public class SwfSpecificCustomConfiguration implements Serializable {
|
||||
|
||||
private Map<String, String> customData = new HashMap<>();
|
||||
private static final long serialVersionUID = 0x2acb421da57f5eb4L;
|
||||
|
||||
public static final String KEY_LAST_SELECTED_PATH_RESOURCES = "lastSelectedPath.resources";
|
||||
public static final String KEY_LAST_SELECTED_PATH_TAGLIST = "lastSelectedPath.taglist";
|
||||
public static final String KEY_CHARSET = "charset";
|
||||
private Map<String, String> customData = new HashMap<>();
|
||||
|
||||
public String getCustomData(String key, String defaultValue) {
|
||||
if (customData.containsKey(key)) {
|
||||
return customData.get(key);
|
||||
}
|
||||
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.configuration.CustomConfigurationKeys;
|
||||
import com.jpexs.decompiler.flash.configuration.SwfSpecificCustomConfiguration;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
@@ -82,7 +83,7 @@ public class DefineBinaryDataTag extends CharacterTag {
|
||||
if (Configuration.autoLoadEmbeddedSwfs.get()) {
|
||||
String path = getSwf().getShortPathTitle()+"/DefineBinaryData (" + getCharacterId() + ")";
|
||||
SwfSpecificCustomConfiguration conf = Configuration.getSwfSpecificCustomConfiguration(path);
|
||||
String charset = conf == null ? Charset.defaultCharset().name() : conf.getCustomData(SwfSpecificCustomConfiguration.KEY_CHARSET, Charset.defaultCharset().name());
|
||||
String charset = conf == null ? Charset.defaultCharset().name() : conf.getCustomData(CustomConfigurationKeys.KEY_CHARSET, Charset.defaultCharset().name());
|
||||
|
||||
try {
|
||||
InputStream is = new ByteArrayInputStream(binaryData.getArray(), binaryData.getPos(), binaryData.getLength());
|
||||
|
||||
Reference in New Issue
Block a user