removed some unnecessary parameters + small fixes

This commit is contained in:
honfika@gmail.com
2015-10-21 08:54:25 +02:00
parent a093b2580e
commit 099bffdf68
70 changed files with 270 additions and 158 deletions

View File

@@ -58,6 +58,10 @@ public class IdentifiersDeobfuscation {
private static final Pattern IDENTIFIER_PATTERN = Pattern.compile("^[" + VALID_FIRST_CHARACTERS + "][" + VALID_NEXT_CHARACTERS + "]*$");
private static final Pattern VALID_NAME_PATTERN_DOT = Pattern.compile("^[a-zA-Z_\\$][a-zA-Z0-9_.\\$]*$");
private static final Pattern IDENTIFIER_PATTERN_DOT = Pattern.compile("^[" + VALID_FIRST_CHARACTERS + "][" + VALID_NEXT_CHARACTERS + ".]*$");
public static final String FOO_CHARACTERS = "bcdfghjklmnpqrstvwz";
public static final String FOO_JOIN_CHARACTERS = "aeiouy";
@@ -228,6 +232,28 @@ public class IdentifiersDeobfuscation {
return null;
}
public static boolean isValidNameWithDot(boolean as3, String s, String... exceptions) {
for (String e : exceptions) {
if (e.equals(s)) {
return true;
}
}
if (isReservedWord(s, as3)) {
return false;
}
// simple fast test
if (VALID_NAME_PATTERN_DOT.matcher(s).matches()) {
return true;
}
// unicode test
if (IDENTIFIER_PATTERN_DOT.matcher(s).matches()) {
return true;
}
return false;
}
public static boolean isValidName(boolean as3, String s, String... exceptions) {
for (String e : exceptions) {
if (e.equals(s)) {