diff --git a/trunk/src/com/jpexs/browsers/cache/chrome/ChromeCache.java b/trunk/src/com/jpexs/browsers/cache/chrome/ChromeCache.java
index aa7a096a0..acf225885 100644
--- a/trunk/src/com/jpexs/browsers/cache/chrome/ChromeCache.java
+++ b/trunk/src/com/jpexs/browsers/cache/chrome/ChromeCache.java
@@ -56,7 +56,7 @@ public class ChromeCache implements CacheImplementation {
for (EntryStore en : entries) {
if (en.state == EntryStore.ENTRY_NORMAL) {
String key = en.getKey();
- if (key != null && !key.trim().equals("")) {
+ if (key != null && !key.trim().isEmpty()) {
ret.add(en);
}
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java b/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java
new file mode 100644
index 000000000..dd33cd89e
--- /dev/null
+++ b/trunk/src/com/jpexs/decompiler/flash/ApplicationInfo.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2013 JPEXS
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.jpexs.decompiler.flash;
+
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ *
+ * @author JPEXS
+ */
+public class ApplicationInfo {
+
+ public static final String applicationName = "JPEXS Free Flash Decompiler";
+ public static final String shortApplicationName = "FFDec";
+ public static final String vendor = "JPEXS";
+ public static String version = "";
+ public static String applicationVerName;
+ public static String shortApplicationVerName;
+ public static final String projectPage = "http://www.free-decompiler.com/flash";
+ public static String updatePageStub = "http://www.free-decompiler.com/flash/update.html?currentVersion=";
+ public static String updatePage;
+
+ static {
+ loadProperties();
+ }
+
+ private static void loadProperties() {
+ Properties prop = new Properties();
+ try {
+ prop.load(ApplicationInfo.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";
+ }
+ }
+
+}
diff --git a/trunk/src/com/jpexs/decompiler/flash/Configuration.java b/trunk/src/com/jpexs/decompiler/flash/Configuration.java
index b7aff0ea5..6e2b7de80 100644
--- a/trunk/src/com/jpexs/decompiler/flash/Configuration.java
+++ b/trunk/src/com/jpexs/decompiler/flash/Configuration.java
@@ -18,16 +18,22 @@ package com.jpexs.decompiler.flash;
import com.jpexs.proxy.Replacement;
import java.io.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
public class Configuration {
+ private static final String CONFIG_NAME = "config.bin";
+ private static final String REPLACEMENTS_NAME = "replacements.cfg";
+ private static final File unspecifiedFile = new File("unspecified");
+ private static File directory = unspecifiedFile;
+
public static final boolean DISPLAY_FILENAME = true;
public static boolean DEBUG_COPY = false;
public static boolean dump_tags = false;
@@ -92,6 +98,85 @@ public class Configuration {
}
};
+ private enum OSId {
+
+ WINDOWS, OSX, UNIX
+ }
+
+ private static OSId getOSId() {
+ PrivilegedAction doGetOSName = new PrivilegedAction() {
+ @Override
+ public String run() {
+ return System.getProperty("os.name");
+ }
+ };
+ OSId id = OSId.UNIX;
+ String osName = AccessController.doPrivileged(doGetOSName);
+ if (osName != null) {
+ if (osName.toLowerCase().startsWith("mac os x")) {
+ id = OSId.OSX;
+ } else if (osName.contains("Windows")) {
+ id = OSId.WINDOWS;
+ }
+ }
+ return id;
+ }
+
+ public static String getFFDecHome() throws IOException {
+ if (directory == unspecifiedFile) {
+ directory = null;
+ String userHome = null;
+ try {
+ userHome = System.getProperty("user.home");
+ } catch (SecurityException ignore) {
+ }
+ if (userHome != null) {
+ String applicationId = ApplicationInfo.shortApplicationName;
+ OSId osId = getOSId();
+ if (osId == OSId.WINDOWS) {
+ File appDataDir = null;
+ try {
+ String appDataEV = System.getenv("APPDATA");
+ if ((appDataEV != null) && (appDataEV.length() > 0)) {
+ appDataDir = new File(appDataEV);
+ }
+ } catch (SecurityException ignore) {
+ }
+ String vendorId = ApplicationInfo.vendor;
+ if ((appDataDir != null) && appDataDir.isDirectory()) {
+ // ${APPDATA}\{vendorId}\${applicationId}
+ String path = vendorId + "\\" + applicationId + "\\";
+ directory = new File(appDataDir, path);
+ } else {
+ // ${userHome}\Application Data\${vendorId}\${applicationId}
+ String path = "Application Data\\" + vendorId + "\\" + applicationId + "\\";
+ directory = new File(userHome, path);
+ }
+ } else if (osId == OSId.OSX) {
+ // ${userHome}/Library/Application Support/${applicationId}
+ String path = "Library/Application Support/" + applicationId + "/";
+ directory = new File(userHome, path);
+ } else {
+ // ${userHome}/.${applicationId}/
+ String path = "." + applicationId + "/";
+ directory = new File(userHome, path);
+ }
+ }
+ }
+ if (!directory.exists()) {
+ if (!directory.mkdirs()) {
+ if (!directory.exists()) {
+ throw new IOException("cannot create directory " + directory);
+ }
+ }
+ }
+ String ret = directory.getAbsolutePath();
+ if (!ret.endsWith(File.separator)) {
+ ret += File.separator;
+ }
+ return ret;
+ }
+
/**
* Saves replacements to file for future use
*/
@@ -166,13 +251,12 @@ public class Configuration {
return result;
}
- public static void unsetConfig(String cfg) {
- config.remove(cfg);
+ private static String getReplacementsFile() throws IOException {
+ return getFFDecHome() + REPLACEMENTS_NAME;
}
- public static void loadFromMap(Map map) {
- config.clear();
- config.putAll(map);
+ private static String getConfigFile() throws IOException {
+ return getFFDecHome() + CONFIG_NAME;
}
@SuppressWarnings("unchecked")
@@ -189,16 +273,16 @@ public class Configuration {
}
if (containsConfig("paralelSpeedUp")) {
setConfig("parallelSpeedUp", getConfig("paralelSpeedUp"));
- unsetConfig("paralelSpeedUp");
+ config.remove("paralelSpeedUp");
}
}
- public static void saveToFile(String file, String replacementsFile) {
+ private static void saveToFile(String file, String replacementsFile) {
try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file))) {
oos.writeObject(config);
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, "Cannot save configuration.", "Error", JOptionPane.ERROR_MESSAGE);
- Logger.getLogger(SWFInputStream.class.getName()).severe("Configuration directory is read only.");
+ Logger.getLogger(Configuration.class.getName()).severe("Configuration directory is read only.");
}
if (replacementsFile != null) {
saveReplacements(replacementsFile);
@@ -208,4 +292,16 @@ public class Configuration {
public static List getReplacements() {
return replacements;
}
+
+ public static void loadConfig() throws IOException {
+ loadFromFile(getConfigFile(), getReplacementsFile());
+ }
+
+ public static void saveConfig() {
+ try {
+ saveToFile(getConfigFile(), getReplacementsFile());
+ } catch (IOException ex) {
+ Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java
index 9816c25e7..7c4c23512 100644
--- a/trunk/src/com/jpexs/decompiler/flash/SWF.java
+++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java
@@ -141,7 +141,7 @@ import javax.imageio.ImageIO;
*
* @author JPEXS
*/
-public class SWF {
+public final class SWF {
/**
* Default version of SWF file format
@@ -479,52 +479,56 @@ public class SWF {
byte[] hdr = new byte[3];
fis.read(hdr);
String shdr = new String(hdr, "utf-8");
- if (shdr.equals("CWS")) {
- int version = fis.read();
- SWFInputStream sis = new SWFInputStream(fis, version, 4);
- long fileSize = sis.readUI32();
- SWFOutputStream sos = new SWFOutputStream(fos, version);
- sos.write("FWS".getBytes("utf-8"));
- sos.writeUI8(version);
- sos.writeUI32(fileSize);
- InflaterInputStream iis = new InflaterInputStream(fis);
- int i;
- while ((i = iis.read()) != -1) {
- fos.write(i);
- }
-
- fis.close();
- fos.close();
- } else if (shdr.equals("ZWS")) {
- int version = fis.read();
- SWFInputStream sis = new SWFInputStream(fis, version, 4);
- long fileSize = sis.readUI32();
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- sis.readUI32(); //outSize
- int propertiesSize = 5;
- byte[] lzmaProperties = new byte[propertiesSize];
- if (sis.read(lzmaProperties, 0, propertiesSize) != propertiesSize) {
- throw new IOException("LZMA:input .lzma file is too short");
- }
- SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
- if (!decoder.SetDecoderProperties(lzmaProperties)) {
- throw new IOException("LZMA:Incorrect stream properties");
- }
-
- if (!decoder.Code(sis, baos, fileSize - 8)) {
- throw new IOException("LZMA:Error in data stream");
- }
- try (SWFOutputStream sos = new SWFOutputStream(fos, version)) {
- sos.write("FWS".getBytes("utf-8"));
- sos.write(version);
- sos.writeUI32(fileSize);
- sos.write(baos.toByteArray());
- }
- fis.close();
- fos.close();
- } else {
- return false;
+ switch (shdr) {
+ case "CWS":
+ {
+ int version = fis.read();
+ SWFInputStream sis = new SWFInputStream(fis, version, 4);
+ long fileSize = sis.readUI32();
+ SWFOutputStream sos = new SWFOutputStream(fos, version);
+ sos.write("FWS".getBytes("utf-8"));
+ sos.writeUI8(version);
+ sos.writeUI32(fileSize);
+ InflaterInputStream iis = new InflaterInputStream(fis);
+ int i;
+ while ((i = iis.read()) != -1) {
+ fos.write(i);
+ }
+ fis.close();
+ fos.close();
+ break;
+ }
+ case "ZWS":
+ {
+ int version = fis.read();
+ SWFInputStream sis = new SWFInputStream(fis, version, 4);
+ long fileSize = sis.readUI32();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ sis.readUI32();
+ int propertiesSize = 5;
+ byte[] lzmaProperties = new byte[propertiesSize];
+ if (sis.read(lzmaProperties, 0, propertiesSize) != propertiesSize) {
+ throw new IOException("LZMA:input .lzma file is too short");
+ }
+ SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
+ if (!decoder.SetDecoderProperties(lzmaProperties)) {
+ throw new IOException("LZMA:Incorrect stream properties");
+ }
+ if (!decoder.Code(sis, baos, fileSize - 8)) {
+ throw new IOException("LZMA:Error in data stream");
+ }
+ try (SWFOutputStream sos = new SWFOutputStream(fos, version)) {
+ sos.write("FWS".getBytes("utf-8"));
+ sos.write(version);
+ sos.writeUI32(fileSize);
+ sos.write(baos.toByteArray());
+ }
+ fis.close();
+ fos.close();
+ break;
+ }
+ default:
+ return false;
}
} catch (FileNotFoundException ex) {
return false;
@@ -842,7 +846,7 @@ public class SWF {
expName = "";
}
if (expName.contains(".")) {
- expName = expName.substring(expName.lastIndexOf(".") + 1);
+ expName = expName.substring(expName.lastIndexOf('.') + 1);
}
if ((ct.getClass().getName() + "_" + expName).compareTo(addNode.tag.getClass().getName() + "_" + pathParts[pos]) > 0) {
break;
@@ -1023,7 +1027,7 @@ public class SWF {
private static void writeLE(OutputStream os, long val, int size) throws IOException {
for (int i = 0; i < size; i++) {
os.write((int) (val & 0xff));
- val = val >> 8;
+ val >>= 8;
}
}
@@ -1528,17 +1532,17 @@ public class SWF {
}
if (allVariableNamesStr.contains(ret)) {
exists = true;
- rndSize = rndSize + 1;
+ rndSize += 1;
continue loopfoo;
}
if (isReserved(ret)) {
exists = true;
- rndSize = rndSize + 1;
+ rndSize += 1;
continue;
}
if (deobfuscated.containsValue(ret)) {
exists = true;
- rndSize = rndSize + 1;
+ rndSize += 1;
continue;
}
} while (exists);
@@ -1856,13 +1860,13 @@ public class SWF {
String pkg = null;
String name = "";
if (n.contains(".")) {
- pkg = n.substring(0, n.lastIndexOf("."));
- name = n.substring(n.lastIndexOf(".") + 1);
+ pkg = n.substring(0, n.lastIndexOf('.'));
+ name = n.substring(n.lastIndexOf('.') + 1);
} else {
name = n;
}
boolean changed = false;
- if ((pkg != null) && (!pkg.equals(""))) {
+ if ((pkg != null) && (!pkg.isEmpty())) {
String changedPkg = deobfuscatePackage(pkg, renameType, selected);
if (changedPkg != null) {
changed = true;
@@ -1913,7 +1917,7 @@ public class SWF {
}
HashMap typeCounts = new HashMap<>();
- public int deobfuscateIdentifiers(RenameType renameType) {
+ public int deobfuscateIdentifiers(RenameType renameType) throws InterruptedException {
findFileAttributes();
if (fileAttributes == null) {
int cnt = 0;
@@ -1929,17 +1933,17 @@ public class SWF {
}
}
- public void renameAS2Identifier(String identifier, String newname) {
+ public void renameAS2Identifier(String identifier, String newname) throws InterruptedException {
Map selected = new HashMap<>();
selected.put(identifier, newname);
renameAS2Identifiers(null, selected);
}
- public int deobfuscateAS2Identifiers(RenameType renameType) {
+ public int deobfuscateAS2Identifiers(RenameType renameType) throws InterruptedException {
return renameAS2Identifiers(renameType, null);
}
- private int renameAS2Identifiers(RenameType renameType, Map selected) {
+ private int renameAS2Identifiers(RenameType renameType, Map selected) throws InterruptedException {
actionsMap = new HashMap<>();
allFunctions = new ArrayList<>();
allVariableNames = new ArrayList<>();
@@ -2092,7 +2096,7 @@ public class SWF {
informListeners("rename", "function " + fc + "/" + allFunctions.size());
if (fun instanceof ActionDefineFunction) {
ActionDefineFunction f = (ActionDefineFunction) fun;
- if (f.functionName.equals("")) { //anonymous function, leave as is
+ if (f.functionName.isEmpty()) { //anonymous function, leave as is
continue;
}
String changed = deobfuscateName(f.functionName, false, "function", renameType, selected);
@@ -2103,7 +2107,7 @@ public class SWF {
}
if (fun instanceof ActionDefineFunction2) {
ActionDefineFunction2 f = (ActionDefineFunction2) fun;
- if (f.functionName.equals("")) { //anonymous function, leave as is
+ if (f.functionName.isEmpty()) { //anonymous function, leave as is
continue;
}
String changed = deobfuscateName(f.functionName, false, "function", renameType, selected);
@@ -2524,7 +2528,6 @@ public class SWF {
f++;
}
}
- return;
}
public void removeTagFromTimeline(Tag toRemove, List timeline) {
diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java
index f07d642a9..a163a31b3 100644
--- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java
+++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java
@@ -471,7 +471,7 @@ public class SWFInputStream extends InputStream {
}
for (int bit = 0; bit < nBits; bit++) {
int nb = (tempByte >> (7 - bitPos)) & 1;
- ret = ret + (nb << (nBits - 1 - bit));
+ ret += (nb << (nBits - 1 - bit));
bitPos++;
if (bitPos == 8) {
bitPos = 0;
diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java
index a13c16192..2f0f84e05 100644
--- a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java
+++ b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java
@@ -236,7 +236,7 @@ public class SWFOutputStream extends OutputStream {
int sign = bits >> 31;
int exponent = (bits >> 22) & 0xff;
int mantisa = bits & 0x3FFFFF;
- mantisa = mantisa >> 13;
+ mantisa >>= 13;
writeUI16((sign << 15) + (exponent << 10) + mantisa);
}
@@ -248,7 +248,7 @@ public class SWFOutputStream extends OutputStream {
*/
public void writeEncodedU32(long value) throws IOException {
boolean loop = true;
- value = value & 0xFFFFFFFF;
+ value &= 0xFFFFFFFF;
do {
int ret = (int) (value & 0x7F);
if (value < 0x80) {
@@ -258,7 +258,7 @@ public class SWFOutputStream extends OutputStream {
ret += 0x80;
}
write(ret);
- value = value >> 7;
+ value >>= 7;
} while (loop);
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/TagNode.java b/trunk/src/com/jpexs/decompiler/flash/TagNode.java
index ac3384e32..2e77ef927 100644
--- a/trunk/src/com/jpexs/decompiler/flash/TagNode.java
+++ b/trunk/src/com/jpexs/decompiler/flash/TagNode.java
@@ -277,7 +277,7 @@ public class TagNode {
File dir = new File(outdir);
List ret = new ArrayList<>();
if (!outdir.endsWith(File.separator)) {
- outdir = outdir + File.separator;
+ outdir += File.separator;
}
List existingNames = new ArrayList<>();
for (TagNode node : nodeList) {
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java
index b6054b171..80fba2add 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java
@@ -99,7 +99,7 @@ public class ABC {
}
}
- public int removeTraps() {
+ public int removeTraps() throws InterruptedException {
int rem = 0;
for (int s = 0; s < script_info.length; s++) {
rem += script_info[s].removeTraps(s, this, "");
@@ -274,10 +274,10 @@ public class ABC {
String pkg = "";
String name = fullname;
if (fullname.contains(".")) {
- pkg = fullname.substring(0, fullname.lastIndexOf("."));
- name = fullname.substring(fullname.lastIndexOf(".") + 1);
+ pkg = fullname.substring(0, fullname.lastIndexOf('.'));
+ name = fullname.substring(fullname.lastIndexOf('.') + 1);
}
- if (!pkg.equals("")) {
+ if (!pkg.isEmpty()) {
int pkgStrIndex = constants.getStringId(pkg, true);
pkgStrIndex = deobfuscatePackageName(stringUsageTypes, stringUsages, namesMap, pkgStrIndex, renameType);
pkg = constants.constant_string[pkgStrIndex];
@@ -286,7 +286,7 @@ public class ABC {
nameStrIndex = deobfuscateName(stringUsageTypes, stringUsages, namespaceUsages, namesMap, nameStrIndex, true, renameType);
name = constants.constant_string[nameStrIndex];
String fullChanged = "";
- if (!pkg.equals("")) {
+ if (!pkg.isEmpty()) {
fullChanged = pkg + ".";
}
fullChanged += name;
@@ -823,18 +823,18 @@ public class ABC {
for (int i = 1; i < constants.constant_string.length; i++) {
if (constants.constant_string[i].equals(ret)) {
exists = true;
- rndSize = rndSize + 1;
+ rndSize += 1;
continue loopfoo;
}
}
if (isReserved(ret)) {
exists = true;
- rndSize = rndSize + 1;
+ rndSize += 1;
continue;
}
if (deobfuscated.containsValue(ret)) {
exists = true;
- rndSize = rndSize + 1;
+ rndSize += 1;
continue;
}
} while (exists);
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java
index c4a985adc..8b76d9fd9 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java
@@ -109,8 +109,8 @@ public class ABCInputStream extends InputStream {
do {
i = read();
nextByte = (i >> 7) == 1;
- i = i & 0x7f;
- ret = ret + (i << bytePos);
+ i &= 0x7f;
+ ret += (i << bytePos);
byteCount++;
bytePos += 7;
} while (nextByte);
@@ -125,7 +125,7 @@ public class ABCInputStream extends InputStream {
int ret = (read()) + (read() << 8) + (read() << 16);
if ((ret >> 23) == 1) {
- ret = ret | 0xff000000;
+ ret |= 0xff000000;
}
return ret;
@@ -144,8 +144,8 @@ public class ABCInputStream extends InputStream {
do {
i = read();
nextByte = (i >> 7) == 1;
- i = i & 0x7f;
- ret = ret + (i << bytePos);
+ i &= 0x7f;
+ ret += (i << bytePos);
byteCount++;
bytePos += 7;
if (bytePos == 35) {
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java
index c928c85a9..cfda6c601 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABCOutputStream.java
@@ -60,7 +60,7 @@ public class ABCOutputStream extends OutputStream {
public void writeU32(long value) throws IOException {
boolean loop = true;
- value = value & 0xFFFFFFFF;
+ value &= 0xFFFFFFFF;
do {
int ret = (int) (value & 0x7F);
if (value < 0x80) {
@@ -70,17 +70,17 @@ public class ABCOutputStream extends OutputStream {
ret += 0x80;
}
write(ret);
- value = value >> 7;
+ value >>= 7;
} while (loop);
}
public void writeS24(long value) throws IOException {
int ret = (int) (value & 0xff);
write(ret);
- value = value >> 8;
+ value >>= 8;
ret = (int) (value & 0xff);
write(ret);
- value = value >> 8;
+ value >>= 8;
ret = (int) (value & 0xff);
write(ret);
}
@@ -107,13 +107,13 @@ public class ABCOutputStream extends OutputStream {
}
if (bitcount == 35) {
- ret = ret & 0xf;
+ ret &= 0xf;
}
write(ret);
if (bitcount == 35) {
break;
}
- value = value >> 7;
+ value >>= 7;
} while (loop);
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ClassPath.java b/trunk/src/com/jpexs/decompiler/flash/abc/ClassPath.java
index 5ae2f7f19..7d1b8c737 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/ClassPath.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/ClassPath.java
@@ -34,7 +34,7 @@ public class ClassPath {
@Override
public String toString() {
- return (packageStr == null || packageStr.equals("")) ? className : packageStr + "." + className;
+ return (packageStr == null || packageStr.isEmpty()) ? className : packageStr + "." + className;
}
@Override
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java
index 1372a67fc..bf4edbadb 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java
@@ -99,7 +99,7 @@ public class ScriptPack {
return packageName.equals("") ? scriptName : packageName + "." + scriptName;
}*/
private static String makeDirPath(String packageName) {
- if (packageName.equals("")) {
+ if (packageName.isEmpty()) {
return "";
}
String[] pathParts;
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java
index e3f62e753..96b55b363 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java
@@ -1405,7 +1405,7 @@ public class AVM2Code implements Serializable {
ignoredIns = new ArrayList<>();
}
- public List toGraphTargetItems(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, HashMap localRegNames, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) {
+ public List toGraphTargetItems(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, HashMap localRegNames, Stack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) throws InterruptedException {
initToSource();
List list;
HashMap localRegs = new HashMap<>();
@@ -1654,7 +1654,7 @@ public class AVM2Code implements Serializable {
return ret;
}
- public int removeTraps(ConstantPool constants, Trait trait, MethodInfo info, MethodBody body, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path) {
+ public int removeTraps(ConstantPool constants, Trait trait, MethodInfo info, MethodBody body, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path) throws InterruptedException {
removeDeadCode(constants, trait, info, body);
List