Fixed FLA Export - AS2 - Sprite linkage to class

This commit is contained in:
Jindra Petřík
2023-03-19 22:43:41 +01:00
parent ed57d71e81
commit 6ef01643c1
13 changed files with 253 additions and 28 deletions
@@ -857,6 +857,10 @@ public abstract class Action implements GraphSourceItem {
return actionsToTree(insideDoInitAction, insideFunction, new HashMap<>(), new HashMap<>(), new HashMap<>(), actions, version, staticOperation, path, charset);
}
public static GraphTextWriter actionsToSource(final ASMSource asm, final List<Action> actions, final String path, GraphTextWriter writer, String charset) throws InterruptedException {
return Action.actionsToSource(asm, actions, path, writer, charset, new ArrayList<>());
}
/**
* Converts list of actions to ActionScript source code
*
@@ -864,10 +868,12 @@ public abstract class Action implements GraphSourceItem {
* @param actions List of actions
* @param path
* @param writer
* @param charset
* @param treeOperations
* @return
* @throws java.lang.InterruptedException
*/
public static GraphTextWriter actionsToSource(final ASMSource asm, final List<Action> actions, final String path, GraphTextWriter writer, String charset) throws InterruptedException {
public static GraphTextWriter actionsToSource(final ASMSource asm, final List<Action> actions, final String path, GraphTextWriter writer, String charset, List<ActionTreeOperation> treeOperations) throws InterruptedException {
writer.suspendMeasure();
List<GraphTargetItem> tree = null;
Throwable convertException = null;
@@ -882,6 +888,9 @@ public abstract class Action implements GraphSourceItem {
boolean insideDoInitAction = (asm instanceof DoInitActionTag);
List<GraphTargetItem> tree = actionsToTree(insideDoInitAction, false, new HashMap<>(), new HashMap<>(), new HashMap<>(), actions, version, staticOperation, path, charset);
SWFDecompilerPlugin.fireActionTreeCreated(tree, swf);
for (ActionTreeOperation treeOperation:treeOperations) {
treeOperation.run(tree);
}
if (Configuration.autoDeobfuscate.get()) {
new ActionDeobfuscator().actionTreeCreated(tree, swf);
}
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2010-2023 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.
*/
package com.jpexs.decompiler.flash.action;
import com.jpexs.decompiler.graph.GraphTargetItem;
import java.util.List;
/**
*
* @author JPEXS
*/
public interface ActionTreeOperation {
public void run(List<GraphTargetItem> tree);
}