generic config get/set methods

This commit is contained in:
Honfika
2013-08-25 08:29:56 +02:00
parent a72ece0d1d
commit 91eb780db3
17 changed files with 60 additions and 56 deletions

View File

@@ -116,22 +116,26 @@ public class Configuration {
return config.containsKey(cfg);
}
public static Object getConfig(String cfg) {
public static <T> T getConfig(String cfg) {
return getConfig(cfg, null);
}
public static Object getConfig(String cfg, Object defaultValue) {
public static <T> T getConfig(String cfg, T defaultValue) {
if (!config.containsKey(cfg)) {
return defaultValue;
}
return config.get(cfg);
@SuppressWarnings("unchecked")
T result = (T)config.get(cfg);
return result;
}
public static Object setConfig(String cfg, Object value) {
public static <T> T setConfig(String cfg, T value) {
if (cfg.equals("paralelSpeedUp")) {
cfg = "parallelSpeedUp";
}
return config.put(cfg, value);
@SuppressWarnings("unchecked")
T result = (T)config.put(cfg, value);
return result;
}
public static void unsetConfig(String cfg) {

View File

@@ -92,7 +92,7 @@ public class SWFInputStream extends InputStream {
private long percentMax;
private List<byte[]> buffered = new ArrayList<>();
private ByteArrayOutputStream buffer;
private static boolean DEOBFUSCATION_ALL_CODE_IN_PREVIOUS_TAG = (Boolean) Configuration.getConfig("deobfuscateUsePrevTagOnly", true);
private static boolean DEOBFUSCATION_ALL_CODE_IN_PREVIOUS_TAG = Configuration.getConfig("deobfuscateUsePrevTagOnly", true);
public int getVersion() {
return version;
@@ -549,7 +549,7 @@ public class SWFInputStream extends InputStream {
@SuppressWarnings("unchecked")
private static void getConstantPool(List<DisassemblyListener> listeners, ConstantPool cpool, List<Object> localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output, ActionGraphSource code, int ip, List<ConstantPool> constantPools, List<Integer> visited, int version, int endIp, String path) {
boolean debugMode = false;
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
while (((endIp == -1) || (endIp > ip)) && (ip > -1) && ip < code.size()) {
if (visited.contains(ip)) {
break;
@@ -805,7 +805,7 @@ public class SWFInputStream extends InputStream {
boolean debugMode = false;
boolean decideBranch = false;
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
boolean retv = false;
rri.setPos(ip);
Action a;

View File

@@ -116,7 +116,7 @@ public class MethodBody implements Cloneable, Serializable {
if (pcode) {
s += code.toASMSource(constants, this, false);
} else {
if (!(Boolean) Configuration.getConfig("decompile", Boolean.TRUE)) {
if (!Configuration.getConfig("decompile", Boolean.TRUE)) {
s = "//Decompilation skipped";
if (hilight) {
s = Highlighting.hilighMethod(s, this.method_info);
@@ -143,7 +143,7 @@ public class MethodBody implements Cloneable, Serializable {
MethodBody b = (MethodBody) Helper.deepCopy(this);
deobfuscated = b.code;
deobfuscated.markMappedOffsets();
if ((Boolean) Configuration.getConfig("autoDeobfuscate", true)) {
if (Configuration.getConfig("autoDeobfuscate", true)) {
try {
deobfuscated.removeTraps(constants, b, abc, scriptIndex, classIndex, isStatic, path);
} catch (Exception | StackOverflowError ex) {

View File

@@ -62,7 +62,7 @@ public class ActionWaitForFrame extends Action implements ActionStore {
}
skipped.add(a);
}
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
if (deobfuscate) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for (int i = 0; i < skipCount; i++) {

View File

@@ -75,7 +75,7 @@ public class ActionWaitForFrame2 extends Action implements ActionStore {
}
skipped.add(a);
}
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
if (deobfuscate) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for (int i = 0; i < skipCount; i++) {

View File

@@ -218,7 +218,7 @@ public class Main {
public void progress(int p) {
startWork(translate("work.reading.swf"), p);
}
}, (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
}, Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
locswf.addEventListener(new EventListener() {
@Override
public void handleEvent(String event, Object data) {
@@ -387,7 +387,7 @@ public class Main {
public static boolean saveFileDialog() {
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File((String) Configuration.getConfig("lastSaveDir", ".")));
fc.setCurrentDirectory(new File(Configuration.getConfig("lastSaveDir", ".")));
fc.setFileFilter(new FileFilter() {
@Override
public boolean accept(File f) {
@@ -425,7 +425,7 @@ public class Main {
public static boolean openFileDialog() {
fileTitle = null;
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File((String) Configuration.getConfig("lastOpenDir", ".")));
fc.setCurrentDirectory(new File(Configuration.getConfig("lastOpenDir", ".")));
fc.setFileFilter(new FileFilter() {
@Override
public boolean accept(File f) {
@@ -604,7 +604,7 @@ public class Main {
}
private static void offerAssociation() {
boolean offered = (Boolean) Configuration.getConfig("offeredAssociation", Boolean.FALSE);
boolean offered = Configuration.getConfig("offeredAssociation", Boolean.FALSE);
if (!offered) {
if (Platform.isWindows()) {
if ((!isAddedToContextMenu()) && View.showConfirmDialog(null, "Do you want to add FFDec to context menu of SWF files?\n(Can be changed later from main menu)", "Context menu", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
@@ -617,7 +617,7 @@ public class Main {
public static void initLang() {
if (Configuration.containsConfig("locale")) {
Locale.setDefault(Locale.forLanguageTag((String) Configuration.getConfig("locale", "en")));
Locale.setDefault(Locale.forLanguageTag(Configuration.getConfig("locale", "en")));
}
UIManager.put("OptionPane.okButtonText", AppStrings.translate("button.ok"));
UIManager.put("OptionPane.yesButtonText", AppStrings.translate("button.yes"));
@@ -751,7 +751,7 @@ public class Main {
View.setLookAndFeel();
if ((Boolean) Configuration.getConfig("cacheOnDisk", Boolean.TRUE)) {
if (Configuration.getConfig("cacheOnDisk", Boolean.TRUE)) {
Cache.setStorageType(Cache.STORAGE_FILES);
} else {
Cache.setStorageType(Cache.STORAGE_MEMORY);
@@ -914,7 +914,7 @@ public class Main {
boolean exportOK;
try {
printHeader();
SWF exfile = new SWF(new FileInputStream(inFile), (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
SWF exfile = new SWF(new FileInputStream(inFile), Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
exfile.addEventListener(new EventListener() {
@Override
public void handleEvent(String event, Object data) {
@@ -931,7 +931,7 @@ public class Main {
System.out.println("Exporting shapes...");
exfile.exportShapes(handler, outDir.getAbsolutePath() + File.separator + "shapes");
System.out.println("Exporting scripts...");
exfile.exportActionScript(handler, outDir.getAbsolutePath() + File.separator + "scripts", false, (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
exfile.exportActionScript(handler, outDir.getAbsolutePath() + File.separator + "scripts", false, Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
System.out.println("Exporting movies...");
exfile.exportMovies(handler, outDir.getAbsolutePath() + File.separator + "movies");
System.out.println("Exporting sounds...");
@@ -955,10 +955,10 @@ public class Main {
if ((pos + 5 < args.length) && (args[pos + 4].equals("-selectas3class"))) {
exportOK = true;
for (int i = pos + 5; i < args.length; i++) {
exportOK = exportOK && exfile.exportAS3Class(args[i], outDir.getAbsolutePath(), exportFormat.equals("pcode"), (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
exportOK = exportOK && exfile.exportAS3Class(args[i], outDir.getAbsolutePath(), exportFormat.equals("pcode"), Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
}
} else {
exportOK = !exfile.exportActionScript(handler, outDir.getAbsolutePath(), exportFormat.equals("pcode"), (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE)).isEmpty();
exportOK = !exfile.exportActionScript(handler, outDir.getAbsolutePath(), exportFormat.equals("pcode"), Configuration.getConfig("parallelSpeedUp", Boolean.TRUE)).isEmpty();
}
break;
case "movie":
@@ -982,11 +982,11 @@ public class Main {
exportOK = true;
break;
case "fla":
exfile.exportFla(handler, outDir.getAbsolutePath(), inFile.getName(), applicationName, applicationVerName, version, (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
exfile.exportFla(handler, outDir.getAbsolutePath(), inFile.getName(), applicationName, applicationVerName, version, Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
exportOK = true;
break;
case "xfl":
exfile.exportXfl(handler, outDir.getAbsolutePath(), inFile.getName(), applicationName, applicationVerName, version, (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
exfile.exportXfl(handler, outDir.getAbsolutePath(), inFile.getName(), applicationName, applicationVerName, version, Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
exportOK = true;
break;
default:
@@ -1170,7 +1170,7 @@ public class Main {
}
public static void autoCheckForUpdates() {
Calendar lastUpdatesCheckDate = (Calendar) Configuration.getConfig("lastUpdatesCheckDate", null);
Calendar lastUpdatesCheckDate = Configuration.getConfig("lastUpdatesCheckDate", null);
if ((lastUpdatesCheckDate == null) || (lastUpdatesCheckDate.getTime().getTime() < Calendar.getInstance().getTime().getTime() - 1000 * 60 * 60 * 24)) {
checkForUpdates();
}

View File

@@ -540,9 +540,9 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
rib.setApplicationMenu(mainMenu);
int w = (Integer) Configuration.getConfig("gui.window.width", 1000);
int w = Configuration.getConfig("gui.window.width", 1000);
int h = (Integer) Configuration.getConfig("gui.window.height", 700);
int h = Configuration.getConfig("gui.window.height", 700);
Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
if (w > dim.width) {
w = dim.width;
@@ -552,8 +552,8 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
}
setSize(w, h);
boolean maximizedHorizontal = (Boolean) Configuration.getConfig("gui.window.maximized.horizontal", false);
boolean maximizedVertical = (Boolean) Configuration.getConfig("gui.window.maximized.vertical", false);
boolean maximizedHorizontal = Configuration.getConfig("gui.window.maximized.horizontal", false);
boolean maximizedVertical = Configuration.getConfig("gui.window.maximized.vertical", false);
int state = 0;
if (maximizedHorizontal) {
@@ -661,7 +661,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
miDeobfuscation.addActionListener(this);
//autoDeobfuscateMenuItem = new JCheckBoxMenuItem(translate("menu.settings.autodeobfuscation"));
miAutoDeobfuscation.setSelected((Boolean) Configuration.getConfig("autoDeobfuscate", true));
miAutoDeobfuscation.setSelected(Configuration.getConfig("autoDeobfuscate", true));
miAutoDeobfuscation.addActionListener(this);
miAutoDeobfuscation.setActionCommand("AUTODEOBFUSCATE");
@@ -691,7 +691,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
menuTools.add(miSearchScript);
//miInternalViewer = new JCheckBox(translate("menu.settings.internalflashviewer"));
miInternalViewer.setSelected((Boolean) Configuration.getConfig("internalFlashViewer", (Boolean) (flashPanel == null)));
miInternalViewer.setSelected(Configuration.getConfig("internalFlashViewer", (Boolean) (flashPanel == null)));
if (flashPanel == null) {
miInternalViewer.setSelected(true);
miInternalViewer.setEnabled(false);
@@ -700,7 +700,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
miInternalViewer.addActionListener(this);
//miParallelSpeedUp = new JCheckBox(translate("menu.settings.parallelspeedup"));
miParallelSpeedUp.setSelected((Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
miParallelSpeedUp.setSelected(Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
miParallelSpeedUp.setActionCommand("PARALLELSPEEDUP");
miParallelSpeedUp.addActionListener(this);
@@ -716,18 +716,18 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
menuBar.add(menuTools);
//miDecompile = new JCheckBox(translate("menu.settings.disabledecompilation"));
miDecompile.setSelected(!(Boolean) Configuration.getConfig("decompile", Boolean.TRUE));
miDecompile.setSelected(!Configuration.getConfig("decompile", Boolean.TRUE));
miDecompile.setActionCommand("DISABLEDECOMPILATION");
miDecompile.addActionListener(this);
//miCacheDisk = new JCheckBox(translate("menu.settings.cacheOnDisk"));
miCacheDisk.setSelected((Boolean) Configuration.getConfig("cacheOnDisk", Boolean.TRUE));
miCacheDisk.setSelected(Configuration.getConfig("cacheOnDisk", Boolean.TRUE));
miCacheDisk.setActionCommand("CACHEONDISK");
miCacheDisk.addActionListener(this);
// miGotoMainClassOnStartup = new JCheckBox(translate("menu.settings.gotoMainClassOnStartup"));
miGotoMainClassOnStartup.setSelected((Boolean) Configuration.getConfig("gotoMainClassOnStartup", Boolean.FALSE));
miGotoMainClassOnStartup.setSelected(Configuration.getConfig("gotoMainClassOnStartup", Boolean.FALSE));
miGotoMainClassOnStartup.setActionCommand("GOTODOCUMENTCLASSONSTARTUP");
miGotoMainClassOnStartup.addActionListener(this);
@@ -1624,8 +1624,8 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
mui.setNormalIcon(View.getResizableIcon("buttonicon_256"));
mui.setClickIcon(View.getResizableIcon("buttonicon_down_256"));
}
splitPane1.setDividerLocation((Integer) Configuration.getConfig("gui.splitPane1.dividerLocation", getWidth() / 3));
int confDivLoc = (Integer) Configuration.getConfig("gui.splitPane2.dividerLocation", splitPane2.getHeight() * 3 / 5);
splitPane1.setDividerLocation(Configuration.getConfig("gui.splitPane1.dividerLocation", getWidth() / 3));
int confDivLoc = Configuration.getConfig("gui.splitPane2.dividerLocation", splitPane2.getHeight() * 3 / 5);
if (confDivLoc > splitPane2.getHeight() - 10) { //In older releases, divider location was saved when detailPanel was invisible too
confDivLoc = splitPane2.getHeight() * 3 / 5;
}
@@ -2168,7 +2168,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
for (int i = 0; i < tlsList.size(); i++) {
ScriptPack tls = tlsList.get(i);
Main.startWork(translate("work.exporting") + " " + (i + 1) + "/" + tlsList.size() + " " + tls.getPath() + " ...");
ret.add(tls.export(selFile, abcList, isPcode, (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE)));
ret.add(tls.export(selFile, abcList, isPcode, Configuration.getConfig("parallelSpeedUp", Boolean.TRUE)));
}
} else {
List<TagNode> allNodes = new ArrayList<>();
@@ -2376,7 +2376,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
ImageTag it = (ImageTag) tagObj;
if (it.importSupported()) {
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File((String) Configuration.getConfig("lastOpenDir", ".")));
fc.setCurrentDirectory(new File(Configuration.getConfig("lastOpenDir", ".")));
fc.setFileFilter(new FileFilter() {
@Override
public boolean accept(File f) {
@@ -2558,7 +2558,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
break;
case "EXPORTFLA":
JFileChooser fc = new JFileChooser();
String selDir = (String) Configuration.getConfig("lastOpenDir", ".");
String selDir = Configuration.getConfig("lastOpenDir", ".");
fc.setCurrentDirectory(new File(selDir));
if (!selDir.endsWith(File.separator)) {
selDir += File.separator;
@@ -2612,9 +2612,9 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
Helper.freeMem();
try {
if (compressed) {
swf.exportFla(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), Main.applicationName, Main.applicationVerName, Main.version, (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
swf.exportFla(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), Main.applicationName, Main.applicationVerName, Main.version, Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
} else {
swf.exportXfl(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), Main.applicationName, Main.applicationVerName, Main.version, (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
swf.exportXfl(errorHandler, selfile.getAbsolutePath(), new File(Main.file).getName(), Main.applicationName, Main.applicationVerName, Main.version, Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
}
} catch (IOException ex) {
View.showMessageDialog(null, translate("error.export") + ": " + ex.getLocalizedMessage(), translate("error"), JOptionPane.ERROR_MESSAGE);
@@ -2632,7 +2632,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
if (!export.cancelled) {
JFileChooser chooser = new JFileChooser();
if (Configuration.containsConfig("lastExportDir")) {
chooser.setCurrentDirectory(new java.io.File((String) Configuration.getConfig("lastExportDir", ".")));
chooser.setCurrentDirectory(new java.io.File(Configuration.getConfig("lastExportDir", ".")));
} else {
chooser.setCurrentDirectory(new File("."));
}
@@ -2661,7 +2661,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
swf.exportMovies(errorHandler, selFile + File.separator + "movies");
swf.exportSounds(errorHandler, selFile + File.separator + "sounds", isMp3OrWav, isMp3OrWav);
swf.exportBinaryData(errorHandler, selFile + File.separator + "binaryData");
swf.exportActionScript(errorHandler, selFile, isPcode, (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
swf.exportActionScript(errorHandler, selFile, isPcode, Configuration.getConfig("parallelSpeedUp", Boolean.TRUE));
}
} catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, "Error during export", ex);

View File

@@ -55,7 +55,7 @@ public class RenameDialog extends AppDialog implements ActionListener {
public RenameDialog() {
setSize(300, 150);
setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
int renameType = (Integer) Configuration.getConfig("lastRenameType", (Integer) 1);
int renameType = Configuration.getConfig("lastRenameType", 1);
ButtonGroup group = new ButtonGroup();
group.add(typeNumberRadioButton);
group.add(randomWordRadioButton);

View File

@@ -49,7 +49,7 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener {
cnt1.add(cnt, BorderLayout.CENTER);
String currentLanguage = (String) Configuration.getConfig("locale", Locale.getDefault().getLanguage());
String currentLanguage = Configuration.getConfig("locale", Locale.getDefault().getLanguage());
boolean found = false;
int enIndex = 0;
for (String code : languages) {

View File

@@ -246,7 +246,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Fr
}
splitPane.setDividerLocation((Integer) Configuration.getConfig("gui.avm2.splitPane.dividerLocation", splitPane.getWidth() * 1 / 2));
splitPane.setDividerLocation(Configuration.getConfig("gui.avm2.splitPane.dividerLocation", splitPane.getWidth() * 1 / 2));
}

View File

@@ -353,7 +353,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
}
if (!cache.contains(scriptLeaf)) {
for (int scriptTraitIndex : scriptLeaf.traitIndices) {
hilightedCodeBuf.append(script.traits.traits[scriptTraitIndex].convertPackaged(scriptLeaf.getPath().toString(), abcList, abc, false, false, scriptIndex, -1, true, new ArrayList<String>(), (Boolean) Configuration.getConfig("parallelSpeedUp", Boolean.TRUE)));
hilightedCodeBuf.append(script.traits.traits[scriptTraitIndex].convertPackaged(scriptLeaf.getPath().toString(), abcList, abc, false, false, scriptIndex, -1, true, new ArrayList<String>(), Configuration.getConfig("parallelSpeedUp", Boolean.TRUE)));
}
hilightedCode = hilightedCodeBuf.toString();

View File

@@ -284,7 +284,7 @@ public class ActionPanel extends JPanel implements ActionListener {
@Override
public void run() {
editor.setText("; " + translate("work.disassembling") + "...");
if ((Boolean) Configuration.getConfig("decompile", Boolean.TRUE)) {
if (Configuration.getConfig("decompile", Boolean.TRUE)) {
decompiledEditor.setText("//" + translate("work.waitingfordissasembly") + "...");
}
DisassemblyListener listener = new DisassemblyListener() {
@@ -310,7 +310,7 @@ public class ActionPanel extends JPanel implements ActionListener {
srcWithHex = Helper.hexToComments(lastDisasm);
srcNoHex = Helper.stripComments(lastDisasm);
setHex(hexButton.isSelected());
if ((Boolean) Configuration.getConfig("decompile", Boolean.TRUE)) {
if (Configuration.getConfig("decompile", Boolean.TRUE)) {
decompiledEditor.setText("//" + translate("work.decompiling") + "...");
String stripped = "";
if (!useCache) {
@@ -535,7 +535,7 @@ public class ActionPanel extends JPanel implements ActionListener {
}
public void initSplits() {
splitPane.setDividerLocation((Integer) Configuration.getConfig("gui.action.splitPane.dividerLocation", getWidth() / 2));
splitPane.setDividerLocation(Configuration.getConfig("gui.action.splitPane.dividerLocation", getWidth() / 2));
}
public void display() {

View File

@@ -169,7 +169,7 @@ public class DefineButtonTag extends CharacterTag implements ASMSource, BoundedT
ReReadableInputStream rri = new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
rri.setPos(prevLength);
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
List<Action> list = SWFInputStream.readActionList(listeners, 0, getPos() + hdrSize - prevLength, rri, version, prevLength, -1, toString()/*FIXME?*/);
if (deobfuscate) {
list = Action.removeNops(0, list, version, getPos() + hdrSize, toString()/*FIXME?*/);

View File

@@ -115,7 +115,7 @@ public class DoActionTag extends Tag implements ASMSource {
baos.write(actionBytes);
ReReadableInputStream rri = new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
rri.setPos(prevLength);
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
List<Action> list = SWFInputStream.readActionList(listeners, 0, getPos() - prevLength, rri, version, prevLength, -1, toString()/*FIXME?*/);
if (deobfuscate) {
list = Action.removeNops(0, list, version, getPos(), toString()/*FIXME?*/);

View File

@@ -124,7 +124,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
baos.write(actionBytes);
ReReadableInputStream rri = new ReReadableInputStream(new ByteArrayInputStream(baos.toByteArray()));
rri.setPos(prevLength);
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
List<Action> list = SWFInputStream.readActionList(listeners, 0, getPos() + 2 - prevLength, rri, version, prevLength, -1, toString()/*FIXME?*/);
if (deobfuscate) {
list = Action.removeNops(0, list, version, getPos() + 2, toString()/*FIXME?*/);

View File

@@ -169,7 +169,7 @@ public class BUTTONCONDACTION implements ASMSource, Exportable {
@Override
public List<Action> getActions(int version) {
try {
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
List<Action> list = SWFInputStream.readActionList(listeners, 0, getPos() + 4, new ReReadableInputStream(new ByteArrayInputStream(actionBytes)), version, 0, -1, toString()/*FIXME?*/);
if (deobfuscate) {
list = Action.removeNops(0, list, version, getPos() + 4, toString()/*FIXME?*/);

View File

@@ -167,7 +167,7 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable {
@Override
public List<Action> getActions(int version) {
try {
boolean deobfuscate = (Boolean) Configuration.getConfig("autoDeobfuscate", true);
boolean deobfuscate = Configuration.getConfig("autoDeobfuscate", true);
List<Action> list = SWFInputStream.readActionList(listeners, 0, getPos() + hdrPos, new ReReadableInputStream(new ByteArrayInputStream(actionBytes)), version, 0, -1, toString()/*FIXME?*/);
if (deobfuscate) {
list = Action.removeNops(0, list, version, getPos() + hdrPos, toString()/*FIXME?*/);