diff --git a/trunk/build.xml b/trunk/build.xml index 47d5b3834..db3c4a1ff 100644 --- a/trunk/build.xml +++ b/trunk/build.xml @@ -1,158 +1,44 @@ - - - - Builds project ASDec. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + Builds project FFDec + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/build_common.xml b/trunk/build_common.xml new file mode 100644 index 000000000..42c0dd3a1 --- /dev/null +++ b/trunk/build_common.xml @@ -0,0 +1,258 @@ + + + Builds project + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + gui + ${JARFILENAME}.jar + ${DISTRIBUTIONDIR}/${EXEFILENAME}.exe + + + + normal + http://java.com/download + + false + false + + ${EXEICON} + + + ${MINJAVAVERSION} + + preferJre + + + ${VERSIONNUMBER} + ${VERSION} + ${PRODUCTNAME} + ${VENDOR} + ${VERSIONNUMBER} + ${VERSION} + ${PRODUCTNAME} + + ${INTERNALNAME} + ${EXEFILENAME}.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/installer.iss b/trunk/installer.iss new file mode 100644 index 000000000..423289449 --- /dev/null +++ b/trunk/installer.iss @@ -0,0 +1,53 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "JPEXS Free Flash Decompiler" +#include "installer.cfg" +#define MyAppPublisher "JPEXS" +#define MyAppURL "http://www.free-decompiler.com/flash/" +#define MyAppExeName "ffdec.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{E618D276-6596-41F4-8A98-447D442A77DB} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={pf}\FFDec +DefaultGroupName={#MyAppName} +AllowNoIcons=yes +LicenseFile=dist\license.txt +OutputDir=releases +OutputBaseFilename=ffdec_{#MyAppVersion}_setup +Compression=lzma +SolidCompression=yes + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "dist\ffdec.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "dist\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "dist\ffdec.bat"; DestDir: "{app}"; Flags: ignoreversion +Source: "dist\ffdec.jar"; DestDir: "{app}"; Flags: ignoreversion +Source: "dist\license.txt"; DestDir: "{app}"; Flags: ignoreversion + +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" +Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/trunk/src/com/jpexs/decompiler/flash/Main.java b/trunk/src/com/jpexs/decompiler/flash/Main.java index de5e6e15c..0e409997c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/Main.java @@ -32,6 +32,7 @@ import java.awt.event.MouseEvent; import java.io.*; import java.net.Socket; import java.util.Calendar; +import java.util.Properties; import java.util.logging.ConsoleHandler; import java.util.logging.FileHandler; import java.util.logging.Level; @@ -61,12 +62,14 @@ public class Main { public static String file; public static String maskURL; public static SWF swf; - public static final String version = "1.5.0u1"; - public static final String applicationName = "JPEXS Free Flash Decompiler v." + version; + public static String version = ""; + public static final String applicationName = "JPEXS Free Flash Decompiler"; + public static String applicationVerName; public static final String shortApplicationName = "FFDec"; - public static final String shortApplicationVerName = shortApplicationName + " v." + version; + public static String shortApplicationVerName; public static final String projectPage = "http://www.free-decompiler.com/flash"; - public static final String updatePage = "http://www.free-decompiler.com/flash/?update=" + version; + public static String updatePageStub = "http://www.free-decompiler.com/flash/?update="; + public static String updatePage; public static final String vendor = "JPEXS"; public static LoadingDialog loadingDialog; public static ModeFrame modeFrame; @@ -76,6 +79,20 @@ public class Main { private static boolean commandLineMode = false; public static MainFrame mainFrame; + private static void loadProperties(){ + Properties prop = new Properties(); + try { + prop.load(Main.class.getResourceAsStream("/project.properties")); + version = prop.getProperty("version"); + applicationVerName = applicationName + " v."+version; + updatePage = updatePageStub + version; + shortApplicationVerName = shortApplicationName + " v." + version; + } catch (IOException ex) { + //ignore + version = "unknown"; + } + } + public static boolean isCommandLineMode() { return commandLineMode; } @@ -396,8 +413,8 @@ public class Main { } public static void printHeader() { - System.out.println(applicationName); - for (int i = 0; i < applicationName.length(); i++) { + System.out.println(applicationVerName); + for (int i = 0; i < applicationVerName.length(); i++) { System.out.print("-"); } System.out.println(); @@ -449,7 +466,8 @@ public class Main { * @param args the command line arguments */ public static void main(String[] args) throws IOException { - View.setLookAndFeel(); + loadProperties(); + View.setLookAndFeel(); Configuration.load(); int pos = 0; diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java index 6da44b4a3..a453fd2f7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java @@ -409,7 +409,7 @@ public class SWFOutputStream extends OutputStream { /** * Calculates number of bits needed for representing unsigned value * - * @param v Unsigned value + * @param value Unsigned value * @return Number of bits */ public static int getNeededBitsU(int value) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index 1184fd3c2..7468579dd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -113,7 +113,7 @@ public class Action implements GraphSourceItem { /** * Returns address of this action * - * @return + * @return address of this action */ public long getAddress() { return address; @@ -529,7 +529,7 @@ public class Action implements GraphSourceItem { * @param constantPool Constant pool * @param version SWF version * @param hex Add hexadecimal - * @return + * @return String of P-code source */ public String getASMSource(List container, List knownAddreses, List constantPool, int version, boolean hex) { return toString(); @@ -537,11 +537,11 @@ public class Action implements GraphSourceItem { /** * Translates this function to stack and output. - * * @param stack Stack - * @param constants Constant pool * @param output Output * @param regNames Register names + * @param variables Variables + * @param functions Functions */ public void translate(Stack stack, List output, java.util.HashMap regNames, HashMap variables, HashMap functions) { } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 2044fbaa8..8d55631b4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.Main; +import static com.jpexs.decompiler.flash.Main.applicationVerName; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.abc.gui.ABCPanel; @@ -224,7 +225,7 @@ public class MainFrame extends JFrame implements ActionListener, TreeSelectionLi Main.exit(); } }); - setTitle(Main.applicationName + (Main.DISPLAY_FILENAME ? " - " + Main.getFileTitle() : "")); + setTitle(Main.applicationVerName + (Main.DISPLAY_FILENAME ? " - " + Main.getFileTitle() : "")); JMenuBar menuBar = new JMenuBar(); JMenu menuFile = new JMenu("File"); @@ -1020,7 +1021,7 @@ public class MainFrame extends JFrame implements ActionListener, TreeSelectionLi } if (e.getActionCommand().equals("SAVEAS")) { if (Main.saveFileDialog()) { - setTitle(Main.applicationName + (Main.DISPLAY_FILENAME ? " - " + Main.getFileTitle() : "")); + setTitle(Main.applicationVerName + (Main.DISPLAY_FILENAME ? " - " + Main.getFileTitle() : "")); } } if (e.getActionCommand().equals("OPEN")) { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/player/jna/platform/win32/WinBase.java b/trunk/src/com/jpexs/decompiler/flash/gui/player/jna/platform/win32/WinBase.java index 5a940e9e9..cd7cb2b4f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/player/jna/platform/win32/WinBase.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/player/jna/platform/win32/WinBase.java @@ -584,8 +584,8 @@ public interface WinBase extends StdCallLibrary, WinDef, BaseTSD { * The SECURITY_ATTRIBUTES structure contains the security descriptor for an * object and specifies whether the handle retrieved by specifying this * structure is inheritable. This structure provides security settings for - * objects created by various functions, such as {@link Kernel32#CreateFile}, - * {@link Kernel32#CreatePipe}, or {@link Advapi32#RegCreateKeyEx}. + * objects created by various functions, such as Kernel32#CreateFile, + * Kernel32#CreatePipe, or Advapi32#RegCreateKeyEx. */ public static class SECURITY_ATTRIBUTES extends Structure { diff --git a/trunk/src/com/jpexs/decompiler/flash/helpers/Highlighting.java b/trunk/src/com/jpexs/decompiler/flash/helpers/Highlighting.java index c6e8b5dcb..fcd5cc98e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/helpers/Highlighting.java +++ b/trunk/src/com/jpexs/decompiler/flash/helpers/Highlighting.java @@ -113,7 +113,7 @@ public class Highlighting { * Beggining of hilight of method * * @param index - * @return + * @return Hilighted method begin */ public static String hilighMethodBegin(long index) { if (!doHighlight) { @@ -125,7 +125,7 @@ public class Highlighting { /** * Ending of hilight of method * - * @return + * @return Hilighted method end */ public static String hilighMethodEnd() { if (!doHighlight) { diff --git a/trunk/src/com/jpexs/decompiler/flash/types/SHAPE.java b/trunk/src/com/jpexs/decompiler/flash/types/SHAPE.java index 210e796b5..e05c3b66f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/SHAPE.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/SHAPE.java @@ -30,10 +30,10 @@ public class SHAPE { public List shapeRecords; /** - * EXPERIMENTAL + * Converts shape to SVG * - * @param shapeNum - * @return + * @param shapeNum Type of DefineShape + * @return String with XML representation of this shape (SVG) */ public String toSVG(int shapeNum) { return SHAPERECORD.shapeToSVG(shapeNum, null, null, numFillBits, numLineBits, shapeRecords); diff --git a/trunk/src/com/jpexs/decompiler/flash/types/SHAPEWITHSTYLE.java b/trunk/src/com/jpexs/decompiler/flash/types/SHAPEWITHSTYLE.java index d3804e140..51429a433 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/SHAPEWITHSTYLE.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/SHAPEWITHSTYLE.java @@ -32,10 +32,10 @@ public class SHAPEWITHSTYLE { public List shapeRecords; /** - * EXPERIMENTAL + * Converts shape to SVG * - * @param shapeNum - * @return + * @param shapeNum Type of DefineShape + * @return String with XML representation of this shape (SVG) */ public String toSVG(int shapeNum) { return SHAPERECORD.shapeToSVG(shapeNum, fillStyles, lineStyles, numFillBits, numLineBits, shapeRecords); diff --git a/trunk/testlib/junit-4.8.2.jar b/trunk/testlib/junit-4.8.2.jar deleted file mode 100644 index 5b4bb849a..000000000 Binary files a/trunk/testlib/junit-4.8.2.jar and /dev/null differ diff --git a/trunk/testlib/testng-6.8.jar b/trunk/testlib/testng-6.8.jar new file mode 100644 index 000000000..dd6c8bbf3 Binary files /dev/null and b/trunk/testlib/testng-6.8.jar differ