format proxy code, allow to change swf on the fly

This commit is contained in:
2014-09-01 16:56:55 +02:00
parent 8325d07b24
commit ed53ba9d0f
37 changed files with 1847 additions and 2267 deletions
@@ -27,6 +27,8 @@ import com.jpexs.decompiler.flash.action.ActionList;
*/
public interface SWFDecompilerListener {
byte[] proxyFileCatched(byte[] data);
void swfParsed(SWF swf);
void actionListParsed(ActionList actions, SWF swf);
@@ -80,6 +80,22 @@ public class SWFDecompilerPlugin {
}
}
public static byte[] fireProxyFileCatched(byte[] data) {
byte[] result = null;
for (SWFDecompilerListener listener : listeners) {
try {
byte[] newResult = listener.proxyFileCatched(data);
if (newResult != null) {
result = newResult;
data = newResult;
}
} catch (Throwable e) {
logger.log(Level.SEVERE, "Failed to call plugin method proxyFileCatched.", e);
}
}
return result;
}
public static boolean fireSwfParsed(SWF swf) {
for (SWFDecompilerListener listener : listeners) {
try {