From 3fcf0fbafb0e9f8846d47e21873eb244f6de2bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Thu, 3 Apr 2014 17:17:27 +0200 Subject: [PATCH] Issue #554 Fixed not saving DefineSprite changes Issue #494 Fixed nightly builds updates --- .../decompiler/flash/ApplicationInfo.java | 6 ++--- .../com/jpexs/decompiler/flash/gui/Main.java | 4 ++- .../jpexs/decompiler/flash/gui/MainPanel.java | 27 ------------------- .../flash/tags/DefineSpriteTag.java | 13 +++++++++ .../com/jpexs/decompiler/flash/tags/Tag.java | 2 +- 5 files changed, 20 insertions(+), 32 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java b/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java index 248defe42..9eaf153f5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java +++ b/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java @@ -30,7 +30,7 @@ public class ApplicationInfo { public static final String VENDOR = "JPEXS"; public static String version = ""; public static String build = ""; - public static String nightly = ""; + public static boolean nightly = false; public static String applicationVerName; public static String shortApplicationVerName; public static final String PROJECT_PAGE = "http://www.free-decompiler.com/flash"; @@ -47,8 +47,8 @@ public class ApplicationInfo { prop.load(ApplicationInfo.class.getResourceAsStream("/project.properties")); version = prop.getProperty("version"); build = prop.getProperty("build"); - nightly = prop.getProperty("nightly"); - if (nightly.equals("true")) { + nightly = prop.getProperty("nightly").equals("true"); + if (nightly) { version = version + " nightly build " + build; } } catch (IOException | NullPointerException ex) { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java index 36631cd5b..01477243d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.SWFSourceInfo; import com.jpexs.decompiler.flash.SearchMode; import com.jpexs.decompiler.flash.Version; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.parser.script.ActionScriptParser; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.console.CommandLineArgumentParser; import com.jpexs.decompiler.flash.console.ContextMenuTools; @@ -61,6 +62,7 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.lang.reflect.Field; import java.net.Socket; +import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -1050,7 +1052,7 @@ public class Main { Socket sock = new Socket("www.free-decompiler.com", 80); OutputStream os = sock.getOutputStream(); String currentLoc = Configuration.locale.get("en"); - os.write(("GET /flash/update.html?action=check¤tVersion=" + ApplicationInfo.version + "¤tBuild=" + ApplicationInfo.build + "¤tNightly=" + ApplicationInfo.nightly + " HTTP/1.1\r\n" + os.write(("GET /flash/update.html?action=check¤tVersion=" + URLEncoder.encode(ApplicationInfo.version,"UTF-8") + "¤tBuild=" + URLEncoder.encode(ApplicationInfo.build,"UTF-8") + "¤tNightly=" + (ApplicationInfo.nightly?"1":"0") + " HTTP/1.1\r\n" + "Host: www.free-decompiler.com\r\n" + "X-Accept-Versions: " + acceptVersions + "\r\n" + "X-Update-Major: " + UPDATE_SYSTEM_MAJOR + "\r\n" diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 45eb2da43..c8739831f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -20,14 +20,11 @@ import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; import com.jpexs.decompiler.flash.AppStrings; import com.jpexs.decompiler.flash.ApplicationInfo; import com.jpexs.decompiler.flash.SWF; -import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.RenameType; import com.jpexs.decompiler.flash.abc.ScriptPack; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitClass; -import com.jpexs.decompiler.flash.action.Action; -import com.jpexs.decompiler.flash.action.parser.pcode.ASMParser; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.exporters.modes.BinaryDataExportMode; import com.jpexs.decompiler.flash.exporters.modes.FontExportMode; @@ -74,21 +71,10 @@ import com.jpexs.decompiler.flash.tags.DefineSoundTag; import com.jpexs.decompiler.flash.tags.DefineSpriteTag; import com.jpexs.decompiler.flash.tags.DefineText2Tag; import com.jpexs.decompiler.flash.tags.DefineTextTag; -import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag; -import com.jpexs.decompiler.flash.tags.DoActionTag; -import com.jpexs.decompiler.flash.tags.DoInitActionTag; -import com.jpexs.decompiler.flash.tags.EndTag; -import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.JPEGTablesTag; -import com.jpexs.decompiler.flash.tags.PlaceObject2Tag; -import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag; -import com.jpexs.decompiler.flash.tags.ShowFrameTag; -import com.jpexs.decompiler.flash.tags.SoundStreamBlockTag; import com.jpexs.decompiler.flash.tags.SymbolClassTag; import com.jpexs.decompiler.flash.tags.Tag; -import com.jpexs.decompiler.flash.tags.VideoFrameTag; import com.jpexs.decompiler.flash.tags.base.ASMSource; -import com.jpexs.decompiler.flash.tags.base.AloneTag; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.ButtonTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; @@ -99,12 +85,10 @@ import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.tags.base.ImageTag; import com.jpexs.decompiler.flash.tags.base.MissingCharacterHandler; import com.jpexs.decompiler.flash.tags.base.MorphShapeTag; -import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag; import com.jpexs.decompiler.flash.tags.base.ShapeTag; import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag; import com.jpexs.decompiler.flash.tags.base.SoundTag; import com.jpexs.decompiler.flash.tags.base.TextTag; -import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; import com.jpexs.decompiler.flash.tags.text.ParseException; import com.jpexs.decompiler.flash.timeline.DepthState; import com.jpexs.decompiler.flash.timeline.Frame; @@ -117,12 +101,8 @@ import com.jpexs.decompiler.flash.treenodes.ContainerNode; import com.jpexs.decompiler.flash.treenodes.FrameNode; import com.jpexs.decompiler.flash.treenodes.TagNode; import com.jpexs.decompiler.flash.treenodes.TreeNode; -import com.jpexs.decompiler.flash.types.GLYPHENTRY; import com.jpexs.decompiler.flash.types.MATRIX; import com.jpexs.decompiler.flash.types.RECT; -import com.jpexs.decompiler.flash.types.RGB; -import com.jpexs.decompiler.flash.types.TEXTRECORD; -import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD; import com.jpexs.decompiler.flash.types.sound.SoundFormat; import com.jpexs.decompiler.flash.xfl.FLAVersion; import com.jpexs.helpers.CancellableWorker; @@ -156,23 +136,16 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.io.BufferedOutputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Random; -import java.util.Set; import java.util.concurrent.CancellationException; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index 2491c051c..4d485507d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -314,4 +314,17 @@ public class DefineSpriteTag extends CharacterTag implements Container, Drawable public Shape getOutline(int frame, int time, int ratio, DepthState stateUnderCursor, int mouseButton, Matrix transformation) { return getTimeline().getOutline(frame, time, ratio, stateUnderCursor, mouseButton, transformation); } + + @Override + public boolean isModified() { + if(super.isModified()){ + return true; + } + for(Tag t:subTags){ + if(t.isModified()){ + return true; + } + } + return false; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java index faa0e86a1..8ca941d09 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -307,7 +307,7 @@ public class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializ } public byte[] getDataOrOriginalData() { - if (modified) { + if (isModified()) { return getData(); } return data;