mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-29 18:34:42 +00:00
properly interrupt on timeout
This commit is contained in:
@@ -35,7 +35,7 @@ public class RetryTask {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public void run() throws IOException {
|
||||
public void run() throws IOException, InterruptedException {
|
||||
boolean retry;
|
||||
do {
|
||||
retry = false;
|
||||
|
||||
@@ -25,5 +25,5 @@ import java.io.IOException;
|
||||
@FunctionalInterface
|
||||
public interface RunnableIOEx {
|
||||
|
||||
public void run() throws IOException;
|
||||
public void run() throws IOException, InterruptedException;
|
||||
}
|
||||
|
||||
@@ -1238,9 +1238,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
swf.assignClassesToSymbols();
|
||||
System.out.println(cnt + " identifiers renamed.");
|
||||
swf.saveTo(fos);
|
||||
} catch (InterruptedException ex) {
|
||||
return false;
|
||||
} catch (IOException ex) {
|
||||
} catch (InterruptedException | IOException ex) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -2129,12 +2127,12 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void exportFla(AbortRetryIgnoreHandler handler, String outfile, String swfName, String generator, String generatorVerName, String generatorVersion, boolean parallel, FLAVersion version) throws IOException {
|
||||
public void exportFla(AbortRetryIgnoreHandler handler, String outfile, String swfName, String generator, String generatorVerName, String generatorVersion, boolean parallel, FLAVersion version) throws IOException, InterruptedException {
|
||||
XFLConverter.convertSWF(handler, this, swfName, outfile, true, generator, generatorVerName, generatorVersion, parallel, version);
|
||||
clearAllCache();
|
||||
}
|
||||
|
||||
public void exportXfl(AbortRetryIgnoreHandler handler, String outfile, String swfName, String generator, String generatorVerName, String generatorVersion, boolean parallel, FLAVersion version) throws IOException {
|
||||
public void exportXfl(AbortRetryIgnoreHandler handler, String outfile, String swfName, String generator, String generatorVerName, String generatorVersion, boolean parallel, FLAVersion version) throws IOException, InterruptedException {
|
||||
XFLConverter.convertSWF(handler, this, swfName, outfile, false, generator, generatorVerName, generatorVersion, parallel, version);
|
||||
clearAllCache();
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
appendTo(writer, traits, exportMode, parallel);
|
||||
}
|
||||
|
||||
public File export(String directory, ScriptExportSettings exportSettings, boolean parallel) throws IOException {
|
||||
public File export(String directory, ScriptExportSettings exportSettings, boolean parallel) throws IOException, InterruptedException {
|
||||
File file = null;
|
||||
|
||||
if (!exportSettings.singleFile) {
|
||||
@@ -212,12 +212,8 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
}
|
||||
|
||||
try (FileTextWriter writer = exportSettings.singleFile ? null : new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(file))) {
|
||||
try {
|
||||
FileTextWriter writer2 = exportSettings.singleFile ? exportSettings.singleFileWriter : writer;
|
||||
toSource(writer2, abc.script_info.get(scriptIndex).traits.traits, exportSettings.mode, parallel);
|
||||
} catch (InterruptedException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
FileTextWriter writer2 = exportSettings.singleFile ? exportSettings.singleFileWriter : writer;
|
||||
toSource(writer2, abc.script_info.get(scriptIndex).traits.traits, exportSettings.mode, parallel);
|
||||
} catch (FileNotFoundException ex) {
|
||||
logger.log(Level.SEVERE, "The file path is probably too long", ex);
|
||||
}
|
||||
|
||||
@@ -1355,25 +1355,21 @@ public class AVM2Code implements Cloneable {
|
||||
|
||||
private Map<Integer, Set<Integer>> killedRegs = new HashMap<>();
|
||||
|
||||
public void calcKilledStats(MethodBody body) {
|
||||
public void calcKilledStats(MethodBody body) throws InterruptedException {
|
||||
killedRegs.clear();
|
||||
try {
|
||||
HashMap<Integer, List<Integer>> vis = visitCode(body);
|
||||
for (int k = 0; k < code.size(); k++) {
|
||||
if (vis.get(k).isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (code.get(k).definition instanceof KillIns) {
|
||||
int regid = code.get(k).operands[0];
|
||||
if (!killedRegs.containsKey(regid)) {
|
||||
killedRegs.put(regid, new HashSet<>());
|
||||
}
|
||||
killedRegs.get(regid).add(k);
|
||||
}
|
||||
}
|
||||
HashMap<Integer, List<Integer>> vis = visitCode(body);
|
||||
|
||||
} catch (InterruptedException ex) {
|
||||
// ignored
|
||||
for (int k = 0; k < code.size(); k++) {
|
||||
if (vis.get(k).isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (code.get(k).definition instanceof KillIns) {
|
||||
int regid = code.get(k).operands[0];
|
||||
if (!killedRegs.containsKey(regid)) {
|
||||
killedRegs.put(regid, new HashSet<>());
|
||||
}
|
||||
killedRegs.get(regid).add(k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ public class AVM2DeobfuscatorRegisters extends AVM2DeobfuscatorSimple {
|
||||
}
|
||||
}
|
||||
|
||||
private int getFirstRegisterSetter(Reference<AVM2Instruction> assignment, int classIndex, boolean isStatic, int scriptIndex, ABC abc, AVM2ConstantPool cpool, Trait trait, MethodInfo minfo, MethodBody body, Set<Integer> ignoredRegisters, Set<Integer> ignoredGets) {
|
||||
private int getFirstRegisterSetter(Reference<AVM2Instruction> assignment, int classIndex, boolean isStatic, int scriptIndex, ABC abc, AVM2ConstantPool cpool, Trait trait, MethodInfo minfo, MethodBody body, Set<Integer> ignoredRegisters, Set<Integer> ignoredGets) throws InterruptedException {
|
||||
AVM2Code code = body.getCode();
|
||||
Map<Integer, GraphTargetItem> ret = new HashMap<>();
|
||||
|
||||
@@ -165,7 +165,7 @@ public class AVM2DeobfuscatorRegisters extends AVM2DeobfuscatorSimple {
|
||||
return visitCode(assignment, new HashSet<>(), new TranslateStack("deo"), classIndex, isStatic, body, scriptIndex, abc, code, 0, code.code.size() - 1, res, ignoredRegisters, ignoredGets);
|
||||
}
|
||||
|
||||
private int visitCode(Reference<AVM2Instruction> assignment, Set<Integer> visited, TranslateStack stack, int classIndex, boolean isStatic, MethodBody body, int scriptIndex, ABC abc, AVM2Code code, int idx, int endIdx, ExecutionResult result, Set<Integer> ignored, Set<Integer> ignoredGets) {
|
||||
private int visitCode(Reference<AVM2Instruction> assignment, Set<Integer> visited, TranslateStack stack, int classIndex, boolean isStatic, MethodBody body, int scriptIndex, ABC abc, AVM2Code code, int idx, int endIdx, ExecutionResult result, Set<Integer> ignored, Set<Integer> ignoredGets) throws InterruptedException {
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
AVM2LocalData localData = newLocalData(scriptIndex, abc, abc.constants, body, isStatic, classIndex);
|
||||
localData.localRegs.put(0, new NullAVM2Item(null));//this
|
||||
@@ -193,7 +193,7 @@ public class AVM2DeobfuscatorRegisters extends AVM2DeobfuscatorSimple {
|
||||
|
||||
action.translate(localData, stack, output, Graph.SOP_USE_STATIC, "");
|
||||
|
||||
//if (!(def instanceof KillIns))
|
||||
//if (!(def instanceof KillIns))
|
||||
if (def instanceof SetLocalTypeIns) {
|
||||
int regId = ((SetLocalTypeIns) def).getRegisterId(action);
|
||||
if (!ignored.contains(regId)) {
|
||||
@@ -295,6 +295,8 @@ public class AVM2DeobfuscatorRegisters extends AVM2DeobfuscatorSimple {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (Exception ex) {
|
||||
//ignore
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ public class AVM2DeobfuscatorSimple implements SWFDecompilerListener {
|
||||
return localData;
|
||||
}
|
||||
|
||||
private void executeActions(Map<Integer, GraphTargetItem> staticRegs, int classIndex, boolean isStatic, MethodBody body, int scriptIndex, ABC abc, AVM2Code code, int idx, int endIdx, ExecutionResult result, List<AVM2Instruction> inlineIns) {
|
||||
private void executeActions(Map<Integer, GraphTargetItem> staticRegs, int classIndex, boolean isStatic, MethodBody body, int scriptIndex, ABC abc, AVM2Code code, int idx, int endIdx, ExecutionResult result, List<AVM2Instruction> inlineIns) throws InterruptedException {
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
AVM2LocalData localData = newLocalData(scriptIndex, abc, abc.constants, body, isStatic, classIndex);
|
||||
|
||||
@@ -393,6 +393,8 @@ public class AVM2DeobfuscatorSimple implements SWFDecompilerListener {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (Exception ex) {
|
||||
//ignore
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
private final int executionLimit = 30000;
|
||||
|
||||
@Override
|
||||
public void actionListParsed(ActionList actions, SWF swf) {
|
||||
public void actionListParsed(ActionList actions, SWF swf) throws InterruptedException {
|
||||
combinePushs(actions);
|
||||
Map<String, Object> fakeFunctions = getFakeFunctionResults(actions);
|
||||
removeUnreachableActions(actions);
|
||||
@@ -117,19 +117,19 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean rereadActionList(ActionList actions, SWF swf) {
|
||||
private boolean rereadActionList(ActionList actions, SWF swf) throws InterruptedException {
|
||||
byte[] actionBytes = Action.actionsToBytes(actions, true, SWF.DEFAULT_VERSION);
|
||||
try {
|
||||
SWFInputStream rri = new SWFInputStream(swf, actionBytes);
|
||||
ActionList newActions = ActionListReader.readActionList(new ArrayList<>(), rri, SWF.DEFAULT_VERSION, 0, actionBytes.length, "", -1);
|
||||
actions.setActions(newActions);
|
||||
} catch (IOException | InterruptedException ex) {
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(ActionDeobfuscator.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean removeObfuscationIfs(ActionList actions, Map<String, Object> fakeFunctions) {
|
||||
private boolean removeObfuscationIfs(ActionList actions, Map<String, Object> fakeFunctions) throws InterruptedException {
|
||||
if (actions.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
return cPool;
|
||||
}
|
||||
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ActionConstantPool constantPool, ExecutionResult result, Map<String, Object> fakeFunctions) {
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ActionConstantPool constantPool, ExecutionResult result, Map<String, Object> fakeFunctions) throws InterruptedException {
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
ActionLocalData localData = new ActionLocalData();
|
||||
FixItemCounterTranslateStack stack = new FixItemCounterTranslateStack("");
|
||||
@@ -384,11 +384,11 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (EmptyStackException | TranslateException | InterruptedException ex) {
|
||||
} catch (EmptyStackException | TranslateException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, Object> getFakeFunctionResults(ActionList actions) {
|
||||
private Map<String, Object> getFakeFunctionResults(ActionList actions) throws InterruptedException {
|
||||
/*
|
||||
DefineFunction "fakeName" 0 {
|
||||
Push 1777
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
private final int executionLimit = 30000;
|
||||
|
||||
@Override
|
||||
public void actionListParsed(ActionList actions, SWF swf) {
|
||||
public void actionListParsed(ActionList actions, SWF swf) throws InterruptedException {
|
||||
removeGetTimes(actions);
|
||||
removeObfuscationIfs(actions);
|
||||
}
|
||||
@@ -125,7 +125,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removeObfuscationIfs(ActionList actions) {
|
||||
private boolean removeObfuscationIfs(ActionList actions) throws InterruptedException {
|
||||
if (actions.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -270,7 +270,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
return result;
|
||||
}
|
||||
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ExecutionResult result) {
|
||||
private void executeActions(ActionList actions, int idx, int endIdx, ExecutionResult result) throws InterruptedException {
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
ActionLocalData localData = new ActionLocalData();
|
||||
FixItemCounterTranslateStack stack = new FixItemCounterTranslateStack("");
|
||||
@@ -361,7 +361,7 @@ public class ActionDeobfuscatorSimple implements SWFDecompilerListener {
|
||||
result.stack.addAll(stack);
|
||||
}
|
||||
}
|
||||
} catch (EmptyStackException | TranslateException | InterruptedException ex) {
|
||||
} catch (EmptyStackException | TranslateException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
@@ -27,8 +28,6 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SourceGenerator;
|
||||
import com.jpexs.decompiler.graph.model.LocalData;
|
||||
import java.util.List;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -44,15 +43,11 @@ public class FSCommandActionItem extends ActionItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
|
||||
writer.append("fscommand");
|
||||
writer.spaceBeforeCallParenthesies(1);
|
||||
writer.append("(");
|
||||
writer.append("(");
|
||||
try {
|
||||
command.appendTo(writer, localData);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(FSCommandActionItem.class.getName()).log(Level.SEVERE, null, ex);
|
||||
command.appendTo(writer, localData);
|
||||
return writer.append(")");
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.List;
|
||||
*/
|
||||
public class BinaryDataExporter {
|
||||
|
||||
public List<File> exportBinaryData(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, BinaryDataExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportBinaryData(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, BinaryDataExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (tags.isEmpty()) {
|
||||
return ret;
|
||||
@@ -72,6 +72,7 @@ public class BinaryDataExporter {
|
||||
fos.write(((DefineBinaryDataTag) t).binaryData.getRangeData());
|
||||
}
|
||||
}, handler).run();
|
||||
|
||||
ret.add(file);
|
||||
|
||||
if (evl != null) {
|
||||
|
||||
@@ -56,7 +56,7 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class FontExporter {
|
||||
|
||||
public List<File> exportFonts(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, final FontExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportFonts(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, final FontExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (tags.isEmpty()) {
|
||||
return ret;
|
||||
|
||||
@@ -91,7 +91,7 @@ public class FrameExporter {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(FrameExporter.class.getName());
|
||||
|
||||
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, SWF swf, int containerId, List<Integer> frames, ButtonExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, SWF swf, int containerId, List<Integer> frames, ButtonExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
FrameExportMode fem;
|
||||
switch (settings.mode) {
|
||||
case BMP:
|
||||
@@ -111,7 +111,7 @@ public class FrameExporter {
|
||||
return exportFrames(handler, outdir, swf, containerId, frames, fes, evl);
|
||||
}
|
||||
|
||||
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, SWF swf, int containerId, List<Integer> frames, SpriteExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, SWF swf, int containerId, List<Integer> frames, SpriteExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
FrameExportMode fem;
|
||||
switch (settings.mode) {
|
||||
case PNG:
|
||||
@@ -143,7 +143,7 @@ public class FrameExporter {
|
||||
return exportFrames(handler, outdir, swf, containerId, frames, fes, evl);
|
||||
}
|
||||
|
||||
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, final SWF swf, int containerId, List<Integer> frames, final FrameExportSettings settings, final EventListener evl) throws IOException {
|
||||
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, final SWF swf, int containerId, List<Integer> frames, final FrameExportSettings settings, final EventListener evl) throws IOException, InterruptedException {
|
||||
final List<File> ret = new ArrayList<>();
|
||||
if (swf.tags.isEmpty()) {
|
||||
return ret;
|
||||
|
||||
@@ -42,7 +42,7 @@ import java.util.List;
|
||||
*/
|
||||
public class ImageExporter {
|
||||
|
||||
public List<File> exportImages(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, ImageExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportImages(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, ImageExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (tags.isEmpty()) {
|
||||
return ret;
|
||||
|
||||
@@ -51,7 +51,7 @@ import java.util.Set;
|
||||
public class MorphShapeExporter {
|
||||
|
||||
//TODO: implement morphshape export. How to handle 65536 frames?
|
||||
public List<File> exportMorphShapes(AbortRetryIgnoreHandler handler, final String outdir, List<Tag> tags, final MorphShapeExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportMorphShapes(AbortRetryIgnoreHandler handler, final String outdir, List<Tag> tags, final MorphShapeExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (tags.isEmpty()) {
|
||||
return ret;
|
||||
|
||||
@@ -48,7 +48,7 @@ import java.util.List;
|
||||
*/
|
||||
public class MovieExporter {
|
||||
|
||||
public List<File> exportMovies(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, final MovieExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportMovies(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, final MovieExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (tags.isEmpty()) {
|
||||
return ret;
|
||||
|
||||
@@ -57,7 +57,7 @@ import java.util.Set;
|
||||
*/
|
||||
public class ShapeExporter {
|
||||
|
||||
public List<File> exportShapes(AbortRetryIgnoreHandler handler, final String outdir, List<Tag> tags, final ShapeExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportShapes(AbortRetryIgnoreHandler handler, final String outdir, List<Tag> tags, final ShapeExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (tags.isEmpty()) {
|
||||
return ret;
|
||||
|
||||
@@ -52,7 +52,7 @@ import java.util.List;
|
||||
*/
|
||||
public class SoundExporter {
|
||||
|
||||
public List<File> exportSounds(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, final SoundExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportSounds(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, final SoundExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (tags.isEmpty()) {
|
||||
return ret;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TextExporter {
|
||||
|
||||
public static final String TEXT_EXPORT_FILENAME_PLAIN = "textsplain.txt";
|
||||
|
||||
public List<File> exportTexts(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, final TextExportSettings settings, EventListener evl) throws IOException {
|
||||
public List<File> exportTexts(AbortRetryIgnoreHandler handler, String outdir, List<Tag> tags, final TextExportSettings settings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (tags.isEmpty()) {
|
||||
return ret;
|
||||
|
||||
@@ -74,7 +74,7 @@ public class AS2ScriptExporter {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
private List<File> exportAS2Scripts(AbortRetryIgnoreHandler handler, String outdir, Map<String, ASMSource> asms, ScriptExportSettings exportSettings, EventListener evl) throws IOException {
|
||||
private List<File> exportAS2Scripts(AbortRetryIgnoreHandler handler, String outdir, Map<String, ASMSource> asms, ScriptExportSettings exportSettings, EventListener evl) throws IOException, InterruptedException {
|
||||
List<File> ret = new ArrayList<>();
|
||||
if (!outdir.endsWith(File.separator)) {
|
||||
outdir += File.separator;
|
||||
@@ -111,7 +111,7 @@ public class AS2ScriptExporter {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private File exportAS2Script(AbortRetryIgnoreHandler handler, String outdir, ASMSource asm, ScriptExportSettings exportSettings, EventListener evl, AtomicInteger index, int count, String name) throws IOException {
|
||||
private File exportAS2Script(AbortRetryIgnoreHandler handler, String outdir, ASMSource asm, ScriptExportSettings exportSettings, EventListener evl, AtomicInteger index, int count, String name) throws IOException, InterruptedException {
|
||||
boolean retry;
|
||||
do {
|
||||
retry = false;
|
||||
@@ -157,6 +157,7 @@ public class AS2ScriptExporter {
|
||||
|
||||
return file;
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (IOException | OutOfMemoryError | TranslateException | StackOverflowError ex) {
|
||||
logger.log(Level.SEVERE, "Decompilation error in script: " + name, ex);
|
||||
if (handler != null) {
|
||||
|
||||
@@ -58,9 +58,14 @@ public class AS3ScriptExporter {
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
for (ScriptPack item : packs) {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
throw new InterruptedException();
|
||||
}
|
||||
|
||||
if (!item.isSimple && Configuration.ignoreCLikePackages.get()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ExportPackTask task = new ExportPackTask(handler, cnt, packs.size(), item.getClassPath(), item, outdir, exportSettings, parallel, evl);
|
||||
ret.add(task.call());
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ExportPackTask implements Callable<File> {
|
||||
public File call() throws Exception {
|
||||
RunnableIOExResult<File> rio = new RunnableIOExResult<File>() {
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
public void run() throws IOException, InterruptedException {
|
||||
startTime = System.currentTimeMillis();
|
||||
this.result = pack.export(directory, exportSettings, parallel);
|
||||
stopTime = System.currentTimeMillis();
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.helpers;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
@@ -30,7 +31,7 @@ public interface SWFDecompilerListener {
|
||||
|
||||
void swfParsed(SWF swf);
|
||||
|
||||
|
||||
void actionListParsed(ActionList actions, SWF swf) throws InterruptedException;
|
||||
|
||||
void abcParsed(ABC abc, SWF swf);
|
||||
|
||||
|
||||
@@ -2287,7 +2287,7 @@ public class XFLConverter {
|
||||
return ret.toString();
|
||||
}
|
||||
|
||||
private static void writeFile(AbortRetryIgnoreHandler handler, final byte[] data, final String file) throws IOException {
|
||||
private static void writeFile(AbortRetryIgnoreHandler handler, final byte[] data, final String file) throws IOException, InterruptedException {
|
||||
new RetryTask(() -> {
|
||||
try (FileOutputStream fos = new FileOutputStream(file)) {
|
||||
fos.write(data);
|
||||
@@ -2654,7 +2654,7 @@ public class XFLConverter {
|
||||
return ret.toString();
|
||||
}
|
||||
|
||||
public static void convertSWF(AbortRetryIgnoreHandler handler, SWF swf, String swfFileName, String outfile, boolean compressed, String generator, String generatorVerName, String generatorVersion, boolean parallel, FLAVersion flaVersion) throws IOException {
|
||||
public static void convertSWF(AbortRetryIgnoreHandler handler, SWF swf, String swfFileName, String outfile, boolean compressed, String generator, String generatorVerName, String generatorVersion, boolean parallel, FLAVersion flaVersion) throws IOException, InterruptedException {
|
||||
|
||||
FileAttributesTag fa = swf.getFileAttributes();
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
*/
|
||||
@@ -41,6 +41,7 @@ public abstract class GraphSource implements Serializable {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
throw new InterruptedException();
|
||||
}
|
||||
|
||||
boolean debugMode = false;
|
||||
while (((endIp == -1) || (ip < endIp)) && (ip < size())) {
|
||||
refs.get(ip).add(lastIp);
|
||||
|
||||
Reference in New Issue
Block a user