allow to create swf from code only / export SWF to "Java code", which generates the SWF

This commit is contained in:
honfika@gmail.com
2015-01-17 12:17:03 +01:00
parent 30a3bc1e3e
commit 07eaafdc55
64 changed files with 841 additions and 259 deletions

View File

@@ -12,7 +12,8 @@
* 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;
import com.jpexs.decompiler.flash.abc.ABC;
@@ -81,10 +82,10 @@ public class RecompileTest {
Configuration.autoDeobfuscate.set(false);
try {
SWF swf = new SWF(new BufferedInputStream(new FileInputStream(TESTDATADIR + File.separator + filename)), false);
SWF swf = new SWF(new BufferedInputStream(new FileInputStream(TESTDATADIR + File.separator + filename)), false);
if (swf.isAS3()) {
boolean dotest = false;
List<ABC> allAbcs = new ArrayList<>();
List<ABC> allAbcs = new ArrayList<>();
for (ABCContainerTag ct : swf.getAbcList()) {
allAbcs.add(ct.getABC());
}
for (ABC abc : allAbcs) {
@@ -101,7 +102,7 @@ public class RecompileTest {
}
System.out.println("Recompiling:" + en.getKey().toString() + "...");
System.out.println("Recompiling:" + en.getKey().toString() + "...");
en.getValue().toSource(htw, swf.getAbcList(), abc.script_info.get(s).traits.traits, ScriptExportMode.AS, false);
String original = htw.toString();
com.jpexs.decompiler.flash.abc.avm2.parser.script.ActionScriptParser.compile(original, abc, allAbcs, false, en.getKey().className + ".as", abc.instance_info.size());
//remove last compiled script: