mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 22:38:36 +00:00
every configuration setting is configurable on the ui, reset configuration button, show config descriptions
This commit is contained in:
@@ -684,9 +684,9 @@ public final class SWF {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}, Configuration.DECOMPILATION_TIMEOUT, TimeUnit.SECONDS);
|
||||
}, Configuration.exportTimeout.get(), TimeUnit.SECONDS);
|
||||
} catch (TimeoutException ex) {
|
||||
Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, Helper.formatTimeToText(Configuration.DECOMPILATION_TIMEOUT) + " ActionScript export limit reached", ex);
|
||||
Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, Helper.formatTimeToText(Configuration.exportTimeout.get()) + " ActionScript export limit reached", ex);
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, "Error during ABC export", ex);
|
||||
}
|
||||
@@ -707,10 +707,10 @@ public final class SWF {
|
||||
}
|
||||
|
||||
try {
|
||||
executor.awaitTermination(Configuration.DECOMPILATION_TIMEOUT, TimeUnit.SECONDS);
|
||||
executor.awaitTermination(Configuration.exportTimeout.get(), TimeUnit.SECONDS);
|
||||
executor.shutdownNow();
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, Helper.formatTimeToText(Configuration.DECOMPILATION_TIMEOUT) + " ActionScript export limit reached", ex);
|
||||
Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, Helper.formatTimeToText(Configuration.exportTimeout.get()) + " ActionScript export limit reached", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -653,7 +653,7 @@ public class SWFInputStream extends InputStream {
|
||||
if (!parallel) {
|
||||
tags.add(tag);
|
||||
}
|
||||
if (Configuration.dump_tags && level == 0) {
|
||||
if (Configuration.dumpTags.get() && level == 0) {
|
||||
dumpTag(System.out, version, tag, level);
|
||||
}
|
||||
tag.previousTag = previousTag;
|
||||
|
||||
@@ -267,7 +267,7 @@ public class TagNode {
|
||||
int totalCount = TagNode.getTagCountRecursive(nodeList);
|
||||
return exportNodeAS(allTags, handler, nodeList, outdir, exportMode, cnt, totalCount, ev);
|
||||
}
|
||||
}, Configuration.DECOMPILATION_TIMEOUT, TimeUnit.SECONDS);
|
||||
}, Configuration.exportTimeout.get(), TimeUnit.SECONDS);
|
||||
return result;
|
||||
} catch (ExecutionException | InterruptedException | TimeoutException ex) {
|
||||
}
|
||||
|
||||
@@ -149,13 +149,13 @@ public class ScriptPack {
|
||||
convert(new NulWriter(), abcList, traits, exportMode, parallel);
|
||||
return null;
|
||||
}
|
||||
}, Configuration.DECOMPILATION_TIMEOUT_FILE, TimeUnit.SECONDS);
|
||||
}, Configuration.decompilationTimeoutFile.get(), TimeUnit.SECONDS);
|
||||
} catch (TimeoutException ex) {
|
||||
writer.continueMeasure();
|
||||
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", ex);
|
||||
writer.appendNoHilight("/*").newLine();
|
||||
writer.appendNoHilight(" * Decompilation error").newLine();
|
||||
writer.appendNoHilight(" * Timeout (" + Helper.formatTimeToText(Configuration.DECOMPILATION_TIMEOUT_FILE) + ") was reached").newLine();
|
||||
writer.appendNoHilight(" * Timeout (" + Helper.formatTimeToText(Configuration.decompilationTimeoutFile.get()) + ") was reached").newLine();
|
||||
writer.appendNoHilight(" */").newLine();
|
||||
writer.appendNoHilight("throw new IllegalOperationError(\"Not decompiled due to timeout\");").newLine();
|
||||
return;
|
||||
|
||||
@@ -476,7 +476,7 @@ public class ASM3Parser {
|
||||
value_index = parseNamespace(constants, lexer);
|
||||
break;
|
||||
default:
|
||||
if (Configuration.debugMode) {
|
||||
if (Configuration.debugMode.get()) {
|
||||
throw new ParseException("Not supported valueType.", lexer.yyline());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ public class MethodInfoParser {
|
||||
useParamNames = true;
|
||||
}
|
||||
}
|
||||
if (!Configuration.PARAM_NAMES_ENABLE) {
|
||||
if (!Configuration.paramNamesEnable.get()) {
|
||||
useParamNames = false;
|
||||
}
|
||||
if (useParamNames) {
|
||||
|
||||
@@ -92,7 +92,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
HashMap<Integer, String> ret = new HashMap<>();
|
||||
for (int i = 1; i <= abc.method_info[this.method_info].param_types.length; i++) {
|
||||
String paramName = "param" + i;
|
||||
if (abc.method_info[this.method_info].flagHas_paramnames() && Configuration.PARAM_NAMES_ENABLE) {
|
||||
if (abc.method_info[this.method_info].flagHas_paramnames() && Configuration.paramNamesEnable.get()) {
|
||||
paramName = abc.constants.constant_string[abc.method_info[this.method_info].paramNames[i - 1]];
|
||||
}
|
||||
ret.put(i, paramName);
|
||||
|
||||
@@ -253,7 +253,7 @@ public class MethodInfo {
|
||||
}
|
||||
if (!localRegNames.isEmpty()) {
|
||||
writer.appendNoHilight(localRegNames.get(i + 1));
|
||||
} else if ((paramNames.length > i) && (paramNames[i] != 0) && Configuration.PARAM_NAMES_ENABLE) {
|
||||
} else if ((paramNames.length > i) && (paramNames[i] != 0) && Configuration.paramNamesEnable.get()) {
|
||||
writer.appendNoHilight(constants.constant_string[paramNames[i]]);
|
||||
} else {
|
||||
writer.appendNoHilight("param" + (i + 1));
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ConstantIndex implements Serializable {
|
||||
}
|
||||
|
||||
public String toStringNoQ() {
|
||||
if (Configuration.RESOLVE_CONSTANTS) {
|
||||
if (Configuration.resolveConstants.get()) {
|
||||
if (constantPool != null) {
|
||||
if (index < constantPool.size()) {
|
||||
return constantPool.get(index);
|
||||
@@ -50,7 +50,7 @@ public class ConstantIndex implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (Configuration.RESOLVE_CONSTANTS) {
|
||||
if (Configuration.resolveConstants.get()) {
|
||||
if (constantPool != null) {
|
||||
if (index < constantPool.size()) {
|
||||
return "\"" + Helper.escapeString(constantPool.get(index)) + "\"";
|
||||
|
||||
@@ -40,106 +40,118 @@ public class Configuration {
|
||||
private static final File unspecifiedFile = new File("unspecified");
|
||||
private static File directory = unspecifiedFile;
|
||||
|
||||
public static final boolean DISPLAY_FILENAME = true;
|
||||
public static boolean DEBUG_COPY = false;
|
||||
public static boolean dump_tags = false;
|
||||
/**
|
||||
* List of replacements
|
||||
*/
|
||||
private static List<Replacement> replacements = new ArrayList<>();
|
||||
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
public static final ConfigurationItem<Boolean> decompile = null;
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
public static final ConfigurationItem<Boolean> parallelSpeedUp = null;
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
public static final ConfigurationItem<Boolean> autoDeobfuscate = null;
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
public static final ConfigurationItem<Boolean> cacheOnDisk = null;
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
public static final ConfigurationItem<Boolean> internalFlashViewer = null;
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
public static final ConfigurationItem<Boolean> gotoMainClassOnStartup = null;
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
public static final ConfigurationItem<Boolean> deobfuscateUsePrevTagOnly = null;
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
public static final ConfigurationItem<Boolean> offeredAssociation = null;
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
public static final ConfigurationItem<Boolean> removeNops = null;
|
||||
|
||||
/**
|
||||
* Debug mode = throwing an error when comparing original file and
|
||||
* recompiled
|
||||
*/
|
||||
public static boolean debugMode = false;
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
@ConfigurationDescription("Debug mode = throwing an error when comparing original file and recompiled")
|
||||
public static final ConfigurationItem<Boolean> debugMode = null;
|
||||
/**
|
||||
* Turn off reading unsafe tags (tags which can cause problems with
|
||||
* recompiling)
|
||||
*/
|
||||
public static boolean DISABLE_DANGEROUS = false;
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
@ConfigurationDescription("Turn off reading unsafe tags (tags which can cause problems with recompiling)")
|
||||
public static final ConfigurationItem<Boolean> disableDangerous = null;
|
||||
/**
|
||||
* Turn off resolving constants in ActionScript 2
|
||||
*/
|
||||
public static final boolean RESOLVE_CONSTANTS = true;
|
||||
/**
|
||||
* Find latest constant pool in the code
|
||||
*/
|
||||
public static final boolean LATEST_CONSTANTPOOL_HACK = false;
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
@ConfigurationDescription("Turn off resolving constants in ActionScript 2")
|
||||
public static final ConfigurationItem<Boolean> resolveConstants = null;
|
||||
/**
|
||||
* Limit of code subs (for obfuscated code)
|
||||
*/
|
||||
public static final int SUBLIMITER = 500;
|
||||
@ConfigurationDefaultInt(500)
|
||||
@ConfigurationDescription("Limit of code subs (for obfuscated code)")
|
||||
public static final ConfigurationItem<Integer> sublimiter = null;
|
||||
/**
|
||||
* Decompilation timeout in seconds
|
||||
* Total export timeout in seconds
|
||||
*/
|
||||
public static final int DECOMPILATION_TIMEOUT = 30 * 60;
|
||||
@ConfigurationDefaultInt(30 * 60)
|
||||
@ConfigurationDescription("Total export timeout in seconds")
|
||||
public static final ConfigurationItem<Integer> exportTimeout = null;
|
||||
/**
|
||||
* Decompilation timeout in seconds for a single file
|
||||
*/
|
||||
public static final int DECOMPILATION_TIMEOUT_FILE = 5 * 60;
|
||||
//using parameter names in decompiling may cause problems because official programs like Flash CS 5.5 inserts wrong parameter names indices
|
||||
public static final boolean PARAM_NAMES_ENABLE = false;
|
||||
@ConfigurationDefaultInt(5 * 60)
|
||||
@ConfigurationDescription("Decompilation timeout in seconds for a single file")
|
||||
public static final ConfigurationItem<Integer> decompilationTimeoutFile = null;
|
||||
/**
|
||||
* List of replacements
|
||||
* Using parameter names in decompiling may cause problems because official programs like Flash CS 5.5 inserts wrong parameter names indices
|
||||
*/
|
||||
private static java.util.List<Replacement> replacements = new ArrayList<>();
|
||||
private static HashMap<String, Object> configDefaults = new HashMap<String, Object>() {
|
||||
{
|
||||
put("decompile", true);
|
||||
put("parallelSpeedUp", true);
|
||||
put("autoDeobfuscate", true);
|
||||
put("cacheOnDisk", true);
|
||||
put("internalFlashViewer", false);
|
||||
put("gotoMainClassOnStartup", false);
|
||||
put("deobfuscateUsePrevTagOnly", true);
|
||||
put("decompilationTimeoutSingleMethod", 60);
|
||||
put("lastSaveDir", ".");
|
||||
put("lastOpenDir", ".");
|
||||
put("offeredAssociation", false);
|
||||
put("locale", "en");
|
||||
put("registerNameFormat", "_loc%d_");
|
||||
put("lastUpdatesCheckDate", null);
|
||||
put("gui.window.width", 1000);
|
||||
put("gui.window.height", 700);
|
||||
put("gui.window.maximized.horizontal", false);
|
||||
put("gui.window.maximized.vertical", false);
|
||||
put("lastRenameType", 1);
|
||||
put("removeNops", true);
|
||||
}
|
||||
};
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
@ConfigurationDescription("Using parameter names in decompiling may cause problems because official programs like Flash CS 5.5 inserts wrong parameter names indices")
|
||||
public static final ConfigurationItem<Boolean> paramNamesEnable = null;
|
||||
|
||||
public static final ConfigurationItem<Boolean> decompile = null;
|
||||
public static final ConfigurationItem<Boolean> parallelSpeedUp = null;
|
||||
public static final ConfigurationItem<Boolean> autoDeobfuscate = null;
|
||||
public static final ConfigurationItem<Boolean> cacheOnDisk = null;
|
||||
public static final ConfigurationItem<Boolean> internalFlashViewer = null;
|
||||
public static final ConfigurationItem<Boolean> gotoMainClassOnStartup = null;
|
||||
public static final ConfigurationItem<Boolean> deobfuscateUsePrevTagOnly = null;
|
||||
public static final ConfigurationItem<Boolean> offeredAssociation = null;
|
||||
public static final ConfigurationItem<Boolean> removeNops = null;
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
public static final ConfigurationItem<Boolean> displayFileName = null;
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
public static final ConfigurationItem<Boolean> debugCopy = null;
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
public static final ConfigurationItem<Boolean> dumpTags = null;
|
||||
|
||||
@ConfigurationDefaultInt(60)
|
||||
public static final ConfigurationItem<Integer> decompilationTimeoutSingleMethod = null;
|
||||
@ConfigurationDefaultInt(1)
|
||||
public static final ConfigurationItem<Integer> lastRenameType = null;
|
||||
|
||||
@ConfigurationDefaultString(".")
|
||||
public static final ConfigurationItem<String> lastSaveDir = null;
|
||||
@ConfigurationDefaultString(".")
|
||||
public static final ConfigurationItem<String> lastOpenDir = null;
|
||||
public static final ConfigurationItem<String> lastExportDir = null;
|
||||
@ConfigurationDefaultString("en")
|
||||
public static final ConfigurationItem<String> locale = null;
|
||||
@ConfigurationDefaultString("_loc%d_")
|
||||
public static final ConfigurationItem<String> registerNameFormat = null;
|
||||
|
||||
public static final ConfigurationItem<Calendar> lastUpdatesCheckDate = null;
|
||||
|
||||
@ConfigurationName(name = "gui.window.width")
|
||||
@ConfigurationDefaultInt(1000)
|
||||
@ConfigurationName("gui.window.width")
|
||||
public static final ConfigurationItem<Integer> guiWindowWidth = null;
|
||||
@ConfigurationName(name = "gui.window.height")
|
||||
@ConfigurationDefaultInt(700)
|
||||
@ConfigurationName("gui.window.height")
|
||||
public static final ConfigurationItem<Integer> guiWindowHeight = null;
|
||||
@ConfigurationName(name = "gui.window.maximized.horizontal")
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
@ConfigurationName("gui.window.maximized.horizontal")
|
||||
public static final ConfigurationItem<Boolean> guiWindowMaximizedHorizontal = null;
|
||||
@ConfigurationName(name = "gui.window.maximized.vertical")
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
@ConfigurationName("gui.window.maximized.vertical")
|
||||
public static final ConfigurationItem<Boolean> guiWindowMaximizedVertical = null;
|
||||
@ConfigurationName(name = "gui.avm2.splitPane.dividerLocation")
|
||||
@ConfigurationName("gui.avm2.splitPane.dividerLocation")
|
||||
public static final ConfigurationItem<Integer> guiAvm2SplitPaneDividerLocation = null;
|
||||
@ConfigurationName(name = "guiActionSplitPaneDividerLocation")
|
||||
@ConfigurationName("guiActionSplitPaneDividerLocation")
|
||||
public static final ConfigurationItem<Integer> guiActionSplitPaneDividerLocation = null;
|
||||
@ConfigurationName(name = "gui.splitPane1.dividerLocation")
|
||||
@ConfigurationName("gui.splitPane1.dividerLocation")
|
||||
public static final ConfigurationItem<Integer> guiSplitPane1DividerLocation = null;
|
||||
@ConfigurationName(name = "gui.splitPane2.dividerLocation")
|
||||
@ConfigurationName("gui.splitPane2.dividerLocation")
|
||||
public static final ConfigurationItem<Integer> guiSplitPane2DividerLocation = null;
|
||||
|
||||
private enum OSId {
|
||||
@@ -345,26 +357,53 @@ public class Configuration {
|
||||
modifiersField.setAccessible(true);
|
||||
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
|
||||
|
||||
Object defaultValue = configDefaults.get(name);
|
||||
|
||||
Object defaultValue = getDefaultValue(field);
|
||||
if (config.containsKey(name)) {
|
||||
field.set(null, new ConfigurationItem(field.getName(), defaultValue, config.get(name)));
|
||||
} else {
|
||||
field.set(null, new ConfigurationItem(field.getName(), defaultValue));
|
||||
}
|
||||
}
|
||||
} catch (IOException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException ex) {
|
||||
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException ex) {
|
||||
// Reflection exceptions. This should never happen
|
||||
throw new Error(ex.getMessage());
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static Object getDefaultValue(Field field) {
|
||||
Object defaultValue = null;
|
||||
ConfigurationDefaultBoolean aBool = (ConfigurationDefaultBoolean) field.getAnnotation(ConfigurationDefaultBoolean.class);
|
||||
if (aBool != null) {
|
||||
defaultValue = aBool.value();
|
||||
}
|
||||
ConfigurationDefaultInt aInt = (ConfigurationDefaultInt) field.getAnnotation(ConfigurationDefaultInt.class);
|
||||
if (aInt != null) {
|
||||
defaultValue = aInt.value();
|
||||
}
|
||||
ConfigurationDefaultString aString = (ConfigurationDefaultString) field.getAnnotation(ConfigurationDefaultString.class);
|
||||
if (aString != null) {
|
||||
defaultValue = aString.value();
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public static String getDescription(Field field) {
|
||||
ConfigurationDescription a = (ConfigurationDescription) field.getAnnotation(ConfigurationDescription.class);
|
||||
if (a != null) {
|
||||
return a.value();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Map<String, Field> getConfigurationFields() {
|
||||
Field[] fields = Configuration.class.getFields();
|
||||
Map<String, Field> result = new HashMap<>();
|
||||
for (Field field : fields) {
|
||||
if (ConfigurationItem.class.isAssignableFrom(field.getType())) {
|
||||
ConfigurationName annotation = (ConfigurationName) field.getAnnotation(ConfigurationName.class);
|
||||
String name = annotation == null ? field.getName() : annotation.name();
|
||||
String name = annotation == null ? field.getName() : annotation.value();
|
||||
result.put(name, field);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2013 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.configuration;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ConfigurationDefaultBoolean {
|
||||
|
||||
boolean value();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2013 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.configuration;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ConfigurationDefaultInt {
|
||||
|
||||
int value();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2013 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.configuration;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ConfigurationDefaultString {
|
||||
|
||||
String value();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2013 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.configuration;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ConfigurationDescription {
|
||||
|
||||
String value();
|
||||
|
||||
}
|
||||
@@ -29,6 +29,6 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface ConfigurationName {
|
||||
|
||||
String name();
|
||||
String value();
|
||||
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class CommandLineArgumentParser {
|
||||
traceLevel = Level.FINE;
|
||||
break;
|
||||
case "-debug":
|
||||
Configuration.debugMode = true;
|
||||
Configuration.debugMode.set(true);
|
||||
break;
|
||||
default:
|
||||
break OUTER;
|
||||
@@ -574,7 +574,7 @@ public class CommandLineArgumentParser {
|
||||
badArguments();
|
||||
}
|
||||
try {
|
||||
Configuration.dump_tags = true;
|
||||
Configuration.dumpTags.set(true);
|
||||
Configuration.parallelSpeedUp.set(false);
|
||||
SWF swf = Main.parseSWF(args.remove());
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
<Form version="1.5" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||
<Property name="resizable" type="boolean" value="false"/>
|
||||
<Property name="modal" type="boolean" value="true"/>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[600, 400]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
@@ -29,7 +32,8 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jScrollPane1" alignment="0" pref="380" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="btnReset" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnOk" min="-2" max="-2" attributes="0"/>
|
||||
@@ -43,11 +47,12 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" min="-2" pref="240" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="15" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="244" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="btnOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnReset" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -65,9 +70,10 @@
|
||||
<Component class="com.jpexs.decompiler.flash.gui.EachRowRendererEditor" name="configurationTable">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||
<Table columnCount="2" rowCount="0">
|
||||
<Table columnCount="3" rowCount="0">
|
||||
<Column editable="false" title="Name" type="java.lang.String"/>
|
||||
<Column editable="true" title="Value" type="java.lang.Object"/>
|
||||
<Column editable="false" title="Description" type="java.lang.String"/>
|
||||
</Table>
|
||||
</Property>
|
||||
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
|
||||
@@ -84,6 +90,11 @@
|
||||
</Editor>
|
||||
<Renderer/>
|
||||
</Column>
|
||||
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||
<Title/>
|
||||
<Editor/>
|
||||
<Renderer/>
|
||||
</Column>
|
||||
</TableColumnModel>
|
||||
</Property>
|
||||
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
|
||||
@@ -109,5 +120,13 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnReset">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Reset"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnResetActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
||||
@@ -19,10 +19,9 @@ package com.jpexs.decompiler.flash.gui;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.configuration.ConfigurationItem;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableModel;
|
||||
|
||||
@@ -44,15 +43,26 @@ public class AdvancedSettingsDialog extends AppDialog {
|
||||
configurationTable.setCellEditor(configurationTable.getDefaultEditor(null));
|
||||
|
||||
Map<String, Field> fields = Configuration.getConfigurationFields();
|
||||
for (Entry<String, Field> entry : fields.entrySet()) {
|
||||
String name = entry.getKey();
|
||||
Field field = entry.getValue();
|
||||
String[] keys = new String[fields.size()];
|
||||
keys = fields.keySet().toArray(keys);
|
||||
Arrays.sort(keys);
|
||||
for (String name : keys) {
|
||||
Field field = fields.get(name);
|
||||
DefaultTableModel model = (DefaultTableModel) configurationTable.getModel();
|
||||
try {
|
||||
ConfigurationItem item = (ConfigurationItem) field.get(null);
|
||||
model.addRow(new Object[]{name, item.get()});
|
||||
String description = Configuration.getDescription(field);
|
||||
if (description == null) {
|
||||
description = "";
|
||||
}
|
||||
Object defaultValue = Configuration.getDefaultValue(field);
|
||||
if (defaultValue != null) {
|
||||
description += " (default: " + defaultValue + ")";
|
||||
}
|
||||
model.addRow(new Object[]{name, item.get(), description});
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(AdvancedSettingsDialog.class.getName()).log(Level.SEVERE, null, ex);
|
||||
// Reflection exceptions. This should never happen
|
||||
throw new Error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,23 +80,25 @@ public class AdvancedSettingsDialog extends AppDialog {
|
||||
configurationTable = new com.jpexs.decompiler.flash.gui.EachRowRendererEditor();
|
||||
btnOk = new javax.swing.JButton();
|
||||
btnCancel = new javax.swing.JButton();
|
||||
btnReset = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setResizable(false);
|
||||
setModal(true);
|
||||
setPreferredSize(new java.awt.Dimension(600, 400));
|
||||
|
||||
configurationTable.setModel(new javax.swing.table.DefaultTableModel(
|
||||
new Object [][] {
|
||||
|
||||
},
|
||||
new String [] {
|
||||
"Name", "Value"
|
||||
"Name", "Value", "Description"
|
||||
}
|
||||
) {
|
||||
Class[] types = new Class [] {
|
||||
java.lang.String.class, java.lang.Object.class
|
||||
java.lang.String.class, java.lang.Object.class, java.lang.String.class
|
||||
};
|
||||
boolean[] canEdit = new boolean [] {
|
||||
false, true
|
||||
false, true, false
|
||||
};
|
||||
|
||||
public Class getColumnClass(int columnIndex) {
|
||||
@@ -114,6 +126,13 @@ public class AdvancedSettingsDialog extends AppDialog {
|
||||
}
|
||||
});
|
||||
|
||||
btnReset.setText("Reset");
|
||||
btnReset.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btnResetActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
@@ -123,7 +142,8 @@ public class AdvancedSettingsDialog extends AppDialog {
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(btnReset)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(btnCancel)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnOk)))
|
||||
@@ -133,11 +153,12 @@ public class AdvancedSettingsDialog extends AppDialog {
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(btnOk)
|
||||
.addComponent(btnCancel))
|
||||
.addComponent(btnCancel)
|
||||
.addComponent(btnReset))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@@ -157,7 +178,8 @@ public class AdvancedSettingsDialog extends AppDialog {
|
||||
try {
|
||||
item = (ConfigurationItem) field.get(null);
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
Logger.getLogger(AdvancedSettingsDialog.class.getName()).log(Level.SEVERE, null, ex);
|
||||
// Reflection exceptions. This should never happen
|
||||
throw new Error(ex.getMessage());
|
||||
}
|
||||
if (item.get() != null && !item.get().equals(value)) {
|
||||
item.set(value);
|
||||
@@ -171,9 +193,28 @@ public class AdvancedSettingsDialog extends AppDialog {
|
||||
setVisible(false);
|
||||
}//GEN-LAST:event_btnCancelActionPerformed
|
||||
|
||||
private void btnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnResetActionPerformed
|
||||
Map<String, Field> fields = Configuration.getConfigurationFields();
|
||||
for (Entry<String, Field> entry : fields.entrySet()) {
|
||||
String name = entry.getKey();
|
||||
Field field = entry.getValue();
|
||||
try {
|
||||
ConfigurationItem item = (ConfigurationItem) field.get(null);
|
||||
item.unset();
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
// Reflection exceptions. This should never happen
|
||||
throw new Error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
Configuration.saveConfig();
|
||||
setVisible(false);
|
||||
SelectLanguageDialog.reloadUi();
|
||||
}//GEN-LAST:event_btnResetActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnCancel;
|
||||
private javax.swing.JButton btnOk;
|
||||
private javax.swing.JButton btnReset;
|
||||
private com.jpexs.decompiler.flash.gui.EachRowRendererEditor configurationTable;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
@@ -119,7 +119,7 @@ public class Main {
|
||||
|
||||
public static void setSubLimiter(boolean value) {
|
||||
if (value) {
|
||||
AVM2Code.toSourceLimit = Configuration.SUBLIMITER;
|
||||
AVM2Code.toSourceLimit = Configuration.sublimiter.get();
|
||||
} else {
|
||||
AVM2Code.toSourceLimit = -1;
|
||||
}
|
||||
@@ -786,7 +786,7 @@ public class Main {
|
||||
*/
|
||||
public static void main(String[] args) throws IOException {
|
||||
startFreeMemThread();
|
||||
initLogging(Configuration.debugMode);
|
||||
initLogging(Configuration.debugMode.get());
|
||||
|
||||
initLang();
|
||||
|
||||
|
||||
@@ -622,7 +622,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
|
||||
Main.exit();
|
||||
}
|
||||
});
|
||||
setTitle(ApplicationInfo.applicationVerName + ((swf != null && Configuration.DISPLAY_FILENAME) ? " - " + Main.getFileTitle() : ""));
|
||||
setTitle(ApplicationInfo.applicationVerName + ((swf != null && Configuration.displayFileName.get()) ? " - " + Main.getFileTitle() : ""));
|
||||
JMenuBar menuBar = new JMenuBar();
|
||||
|
||||
|
||||
@@ -2646,7 +2646,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
|
||||
break;
|
||||
case "SAVEAS":
|
||||
if (Main.saveFileDialog()) {
|
||||
setTitle(ApplicationInfo.applicationVerName + (Configuration.DISPLAY_FILENAME ? " - " + Main.getFileTitle() : ""));
|
||||
setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + Main.getFileTitle() : ""));
|
||||
saveCommandButton.setEnabled(!Main.readOnly);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -112,12 +112,8 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener {
|
||||
newLanguage = "";
|
||||
}
|
||||
Configuration.locale.set(newLanguage);
|
||||
Locale.setDefault(Locale.forLanguageTag(newLanguage));
|
||||
updateLanguage();
|
||||
setVisible(false);
|
||||
AppStrings.updateLanguage();
|
||||
DefaultSyntaxKit.reloadConfigs();
|
||||
Main.reloadApp();
|
||||
reloadUi();
|
||||
}
|
||||
break;
|
||||
case "CANCEL":
|
||||
@@ -126,6 +122,14 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener {
|
||||
}
|
||||
}
|
||||
|
||||
public static void reloadUi() {
|
||||
Locale.setDefault(Locale.forLanguageTag(Configuration.locale.get()));
|
||||
AppStrings.updateLanguage();
|
||||
DefaultSyntaxKit.reloadConfigs();
|
||||
Main.initLang();
|
||||
Main.reloadApp();
|
||||
}
|
||||
|
||||
public String display() {
|
||||
setVisible(true);
|
||||
return languageCode;
|
||||
|
||||
@@ -240,8 +240,8 @@ button.no = Nem
|
||||
|
||||
FileChooser.openButtonText = Megnyit\u00e1s
|
||||
FileChooser.openButtonToolTipText = Megnyit\u00e1s
|
||||
FileChooser.lookInLabelText = Minden f\u00e1jl
|
||||
FileChooser.acceptAllFileFilterText = Keres\u00e9s ebben:
|
||||
FileChooser.lookInLabelText = Keres\u00e9s ebben:
|
||||
FileChooser.acceptAllFileFilterText = Minden f\u00e1jlt\u00edpus
|
||||
FileChooser.filesOfTypeLabelText = A k\u00f6vetkez\u0151 t\u00edpus\u00fa f\u00e1jlok:
|
||||
FileChooser.fileNameLabelText = F\u00e1jln\u00e9v:
|
||||
FileChooser.listViewButtonToolTipText = Lista
|
||||
|
||||
@@ -245,7 +245,7 @@ public class HilightedTextWriter extends GraphTextWriter {
|
||||
if (toStringCalled) {
|
||||
throw new Error("HilightedTextWriter.toString() was already called.");
|
||||
}
|
||||
if (Configuration.debugMode) {
|
||||
if (Configuration.debugMode.get()) {
|
||||
long stopTime = System.currentTimeMillis();
|
||||
long time = stopTime - startTime;
|
||||
if (time > 500) {
|
||||
|
||||
@@ -104,7 +104,7 @@ public class Highlighting implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
if (Configuration.debugMode) {
|
||||
if (Configuration.debugMode.get()) {
|
||||
if (ret != null) {
|
||||
System.out.println("Highlight found: " + ret.hilightedText);
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public class Highlighting implements Serializable {
|
||||
public Highlighting(int startPos, Map<String, String> data, HilightType type, String text) {
|
||||
this.startPos = startPos;
|
||||
this.type = type;
|
||||
if (Configuration.debugMode) {
|
||||
if (Configuration.debugMode.get()) {
|
||||
this.hilightedText = text;
|
||||
}
|
||||
this.properties = data;
|
||||
|
||||
@@ -113,7 +113,7 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded
|
||||
*/
|
||||
@Override
|
||||
public byte[] getData(int version) {
|
||||
if (Configuration.DISABLE_DANGEROUS) {
|
||||
if (Configuration.disableDangerous.get()) {
|
||||
return super.getData(version);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
OutputStream os = baos;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
os = new CopyOutputStream(os, bais);
|
||||
}
|
||||
SWFOutputStream sos = new SWFOutputStream(os, version);
|
||||
@@ -133,7 +133,7 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded
|
||||
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
|
||||
OutputStream os2 = baos2;
|
||||
byte[] origbrdata = null;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
SWFInputStream sis = new SWFInputStream(bais, version);
|
||||
int len = sis.readUI16();
|
||||
if (len != 0) {
|
||||
@@ -145,14 +145,14 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded
|
||||
sos2.writeBUTTONRECORDList(characters, true);
|
||||
}
|
||||
byte[] brdata = baos2.toByteArray();
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
if (origbrdata != null) {
|
||||
if (origbrdata.length != brdata.length) {
|
||||
/*throw nso*/
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
sos = new SWFOutputStream(baos, version);
|
||||
}
|
||||
if ((actions == null) || (actions.isEmpty())) {
|
||||
@@ -161,7 +161,7 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded
|
||||
sos.writeUI16(2 + brdata.length);
|
||||
}
|
||||
sos.write(brdata);
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
sos = new SWFOutputStream(new CopyOutputStream(baos, bais), version);
|
||||
}
|
||||
sos.writeBUTTONCONDACTIONList(actions);
|
||||
|
||||
@@ -112,12 +112,12 @@ public class DefineButtonTag extends CharacterTag implements ASMSource, BoundedT
|
||||
*/
|
||||
@Override
|
||||
public byte[] getData(int version) {
|
||||
if (Configuration.DISABLE_DANGEROUS) {
|
||||
if (Configuration.disableDangerous.get()) {
|
||||
return super.getData(version);
|
||||
}
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
OutputStream os = baos;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
os = new CopyOutputStream(os, new ByteArrayInputStream(super.data));
|
||||
}
|
||||
SWFOutputStream sos = new SWFOutputStream(os, version);
|
||||
|
||||
@@ -163,7 +163,7 @@ public class DefineFont3Tag extends FontTag {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
OutputStream os = baos;
|
||||
SWFOutputStream sos = new SWFOutputStream(os, version);
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
sos = new SWFOutputStream(new CopyOutputStream(sos, new ByteArrayInputStream(data)), 10);
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -209,12 +209,12 @@ public class DefineSpriteTag extends CharacterTag implements Container, BoundedT
|
||||
*/
|
||||
@Override
|
||||
public byte[] getData(int version) {
|
||||
if (Configuration.DISABLE_DANGEROUS) {
|
||||
if (Configuration.disableDangerous.get()) {
|
||||
return super.getData(version);
|
||||
}
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
OutputStream os = baos;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
os = new CopyOutputStream(os, new ByteArrayInputStream(super.data));
|
||||
}
|
||||
SWFOutputStream sos = new SWFOutputStream(os, version);
|
||||
|
||||
@@ -85,7 +85,7 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag {
|
||||
try {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
OutputStream os = bos;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
os = new CopyOutputStream(os, new ByteArrayInputStream(super.data));
|
||||
}
|
||||
try (SWFOutputStream sos = new SWFOutputStream(os, version)) {
|
||||
|
||||
@@ -71,7 +71,7 @@ public class DoABCTag extends Tag implements ABCContainerTag {
|
||||
try {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
OutputStream os = bos;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
os = new CopyOutputStream(os, new ByteArrayInputStream(super.data));
|
||||
}
|
||||
try (SWFOutputStream sos = new SWFOutputStream(os, version)) {
|
||||
|
||||
@@ -134,12 +134,12 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO
|
||||
*/
|
||||
@Override
|
||||
public byte[] getData(int version) {
|
||||
if (Configuration.DISABLE_DANGEROUS) {
|
||||
if (Configuration.disableDangerous.get()) {
|
||||
return super.getData(version);
|
||||
}
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
OutputStream os = baos;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
os = new CopyOutputStream(os, new ByteArrayInputStream(super.data));
|
||||
}
|
||||
SWFOutputStream sos = new SWFOutputStream(os, version);
|
||||
|
||||
@@ -198,12 +198,12 @@ public class PlaceObject3Tag extends CharacterIdTag implements Container, PlaceO
|
||||
*/
|
||||
@Override
|
||||
public byte[] getData(int version) {
|
||||
if (Configuration.DISABLE_DANGEROUS) {
|
||||
if (Configuration.disableDangerous.get()) {
|
||||
return super.getData(version);
|
||||
}
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
OutputStream os = baos;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
os = new CopyOutputStream(os, new ByteArrayInputStream(super.data));
|
||||
}
|
||||
SWFOutputStream sos = new SWFOutputStream(os, version);
|
||||
|
||||
@@ -199,12 +199,12 @@ public class PlaceObject4Tag extends CharacterIdTag implements Container, PlaceO
|
||||
*/
|
||||
@Override
|
||||
public byte[] getData(int version) {
|
||||
if (Configuration.DISABLE_DANGEROUS) {
|
||||
if (Configuration.disableDangerous.get()) {
|
||||
return super.getData(version);
|
||||
}
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
OutputStream os = baos;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (Configuration.debugCopy.get()) {
|
||||
os = new CopyOutputStream(os, new ByteArrayInputStream(super.data));
|
||||
}
|
||||
SWFOutputStream sos = new SWFOutputStream(os, version);
|
||||
|
||||
Reference in New Issue
Block a user