From 9942e031ce5efcc9eef483704edba6edbe17eaa9 Mon Sep 17 00:00:00 2001 From: Eric Lafortune Date: Sun, 23 Oct 2016 23:10:50 +0200 Subject: [PATCH] Created ProGuard version 5.3.1. --- buildscripts/maven/ant/pom.xml | 2 +- buildscripts/maven/base/pom.xml | 2 +- buildscripts/maven/gradle/pom.xml | 2 +- buildscripts/maven/gui/pom.xml | 2 +- buildscripts/maven/pom.xml | 2 +- buildscripts/maven/retrace/pom.xml | 2 +- buildscripts/maven/wtk/pom.xml | 2 +- examples/annotations/lib/annotations.jar | Bin 6123 -> 6123 bytes src/proguard/ProGuard.java | 2 +- src/proguard/gui/GUIResources.properties | 2 +- src/proguard/retrace/ReTrace.java | 2 +- src/proguard/util/AndMatcher.java | 8 +++---- src/proguard/util/ConstantMatcher.java | 4 ++-- src/proguard/util/EmptyStringMatcher.java | 6 +++--- src/proguard/util/ExtensionMatcher.java | 11 +++++----- src/proguard/util/FixedStringMatcher.java | 12 +++++++---- src/proguard/util/ListMatcher.java | 6 +++--- src/proguard/util/NotMatcher.java | 6 +++--- src/proguard/util/OrMatcher.java | 8 +++---- src/proguard/util/SettableMatcher.java | 6 +++--- src/proguard/util/StringMatcher.java | 21 +++++++++++++++---- src/proguard/util/VariableStringMatcher.java | 16 +++++++------- 22 files changed, 70 insertions(+), 54 deletions(-) diff --git a/buildscripts/maven/ant/pom.xml b/buildscripts/maven/ant/pom.xml index 46be3a6..e77a191 100644 --- a/buildscripts/maven/ant/pom.xml +++ b/buildscripts/maven/ant/pom.xml @@ -7,7 +7,7 @@ net.sf.proguard proguard-parent - 5.3 + 5.3.1 ../pom.xml proguard-anttask diff --git a/buildscripts/maven/base/pom.xml b/buildscripts/maven/base/pom.xml index e2694e6..be16f62 100644 --- a/buildscripts/maven/base/pom.xml +++ b/buildscripts/maven/base/pom.xml @@ -7,7 +7,7 @@ net.sf.proguard proguard-parent - 5.3 + 5.3.1 ../pom.xml proguard-base diff --git a/buildscripts/maven/gradle/pom.xml b/buildscripts/maven/gradle/pom.xml index 35e9751..489ddcc 100644 --- a/buildscripts/maven/gradle/pom.xml +++ b/buildscripts/maven/gradle/pom.xml @@ -7,7 +7,7 @@ net.sf.proguard proguard-parent - 5.3 + 5.3.1 ../pom.xml proguard-gradle diff --git a/buildscripts/maven/gui/pom.xml b/buildscripts/maven/gui/pom.xml index 8af2093..07beee9 100644 --- a/buildscripts/maven/gui/pom.xml +++ b/buildscripts/maven/gui/pom.xml @@ -7,7 +7,7 @@ net.sf.proguard proguard-parent - 5.3 + 5.3.1 ../pom.xml proguard-gui diff --git a/buildscripts/maven/pom.xml b/buildscripts/maven/pom.xml index 0d4ee54..63349ba 100644 --- a/buildscripts/maven/pom.xml +++ b/buildscripts/maven/pom.xml @@ -7,7 +7,7 @@ net.sf.proguard proguard-parent - 5.3 + 5.3.1 pom [${project.groupId}] ${project.artifactId} ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. diff --git a/buildscripts/maven/retrace/pom.xml b/buildscripts/maven/retrace/pom.xml index 4165392..e983d75 100644 --- a/buildscripts/maven/retrace/pom.xml +++ b/buildscripts/maven/retrace/pom.xml @@ -7,7 +7,7 @@ net.sf.proguard proguard-parent - 5.3 + 5.3.1 ../pom.xml proguard-retrace diff --git a/buildscripts/maven/wtk/pom.xml b/buildscripts/maven/wtk/pom.xml index ca4c862..1dde705 100644 --- a/buildscripts/maven/wtk/pom.xml +++ b/buildscripts/maven/wtk/pom.xml @@ -7,7 +7,7 @@ net.sf.proguard proguard-parent - 5.3 + 5.3.1 ../pom.xml proguard-wtk-plugin diff --git a/examples/annotations/lib/annotations.jar b/examples/annotations/lib/annotations.jar index d289250ddddd860410fcd62e2ff3869bae1624ff..53bb8998e829d691f69dd7d90bc109d49600b2d8 100644 GIT binary patch delta 282 zcmaE@|5~3nz?+#xgn@&DgJI#e@QJ)u%pl6EnR&ss@QoMz83lo~Cj%0Yn;a-Cz1f?| zj1i<{a|?4MgzFM)`- z3+6F`95Z=`kOi3jEMyO|a_5{;6gd@SUiAX3!TqGP!KNE=n(~hFPV0xlx cJedA08V#lc#bUwqMzJ_BEhL@+rfbFX07bcFT>t<8 delta 282 zcmaE@|5~3nz?+#xgn@&DgQ1nxWFoH>Gl=qPW^Q3M*?7U9Q4mObG9UrD$$`Sso4uLL z7(q%lw=hRS7!O#2Aq+FNAPA$I9V+sWBNZaz$(0OYtmlq}F!*`nAdCV&sK^EW5{QVq zU>+mLF_U))S%B%!LiQjlCz}d~faxA#PcVH$I1)^oh=fAKMZ&@KGm!`|?I`LCrYDNV cgXzzr(O^1IEEY^}6pI7XLgE=h_705a)GJpcdz diff --git a/src/proguard/ProGuard.java b/src/proguard/ProGuard.java index 792dbf7..0ed0075 100644 --- a/src/proguard/ProGuard.java +++ b/src/proguard/ProGuard.java @@ -39,7 +39,7 @@ import java.io.*; */ public class ProGuard { - public static final String VERSION = "ProGuard, version 5.3"; + public static final String VERSION = "ProGuard, version 5.3.1"; private final Configuration configuration; private ClassPool programClassPool = new ClassPool(); diff --git a/src/proguard/gui/GUIResources.properties b/src/proguard/gui/GUIResources.properties index d7d8491..637f119 100644 --- a/src/proguard/gui/GUIResources.properties +++ b/src/proguard/gui/GUIResources.properties @@ -25,7 +25,7 @@ preverification = Preverification # # Panel titles. # -welcome = Welcome to ProGuard, version 5.3 +welcome = Welcome to ProGuard, version 5.3.1 options = Options keepAdditional = Keep additional classes and class members keepNamesAdditional = Keep additional class names and class member names diff --git a/src/proguard/retrace/ReTrace.java b/src/proguard/retrace/ReTrace.java index f1dacb5..c6141e9 100644 --- a/src/proguard/retrace/ReTrace.java +++ b/src/proguard/retrace/ReTrace.java @@ -33,7 +33,7 @@ import java.util.*; */ public class ReTrace { - private static final String USAGE = "Usage: java proguard.ReTrace [-regex ] [-verbose] []"; + private static final String USAGE = "Usage: java proguard.retrace.ReTrace [-regex ] [-verbose] []"; private static final String REGEX_OPTION = "-regex"; private static final String VERBOSE_OPTION = "-verbose"; diff --git a/src/proguard/util/AndMatcher.java b/src/proguard/util/AndMatcher.java index 52fcfe1..f2df428 100644 --- a/src/proguard/util/AndMatcher.java +++ b/src/proguard/util/AndMatcher.java @@ -26,7 +26,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class AndMatcher implements StringMatcher +public class AndMatcher extends StringMatcher { private final StringMatcher matcher1; private final StringMatcher matcher2; @@ -41,9 +41,9 @@ public class AndMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { - return matcher1.matches(string) && - matcher2.matches(string); + return matcher1.matches(string, offset, length) && + matcher2.matches(string, offset, length); } } diff --git a/src/proguard/util/ConstantMatcher.java b/src/proguard/util/ConstantMatcher.java index 50290e6..2e383f3 100644 --- a/src/proguard/util/ConstantMatcher.java +++ b/src/proguard/util/ConstantMatcher.java @@ -25,7 +25,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class ConstantMatcher implements StringMatcher +public class ConstantMatcher extends StringMatcher { private boolean matches; @@ -41,7 +41,7 @@ public class ConstantMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { return matches; } diff --git a/src/proguard/util/EmptyStringMatcher.java b/src/proguard/util/EmptyStringMatcher.java index fabd903..62c067c 100644 --- a/src/proguard/util/EmptyStringMatcher.java +++ b/src/proguard/util/EmptyStringMatcher.java @@ -25,12 +25,12 @@ package proguard.util; * * @author Eric Lafortune */ -public class EmptyStringMatcher implements StringMatcher +public class EmptyStringMatcher extends StringMatcher { // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { - return string.length() == 0; + return length == 0; } } diff --git a/src/proguard/util/ExtensionMatcher.java b/src/proguard/util/ExtensionMatcher.java index 80a2281..1cdc502 100644 --- a/src/proguard/util/ExtensionMatcher.java +++ b/src/proguard/util/ExtensionMatcher.java @@ -26,7 +26,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class ExtensionMatcher implements StringMatcher +public class ExtensionMatcher extends StringMatcher { private final String extension; @@ -43,9 +43,9 @@ public class ExtensionMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { - return endsWithIgnoreCase(string, extension); + return endsWithIgnoreCase(string, offset, length, extension); } @@ -53,11 +53,10 @@ public class ExtensionMatcher implements StringMatcher * Returns whether the given string ends with the given suffix, ignoring its * case. */ - private static boolean endsWithIgnoreCase(String string, String suffix) + private static boolean endsWithIgnoreCase(String string, int offset, int length, String suffix) { - int stringLength = string.length(); int suffixLength = suffix.length(); - return string.regionMatches(true, stringLength - suffixLength, suffix, 0, suffixLength); + return string.regionMatches(true, offset + length - suffixLength, suffix, 0, suffixLength); } } diff --git a/src/proguard/util/FixedStringMatcher.java b/src/proguard/util/FixedStringMatcher.java index 4594714..ac0c64c 100644 --- a/src/proguard/util/FixedStringMatcher.java +++ b/src/proguard/util/FixedStringMatcher.java @@ -26,7 +26,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class FixedStringMatcher implements StringMatcher +public class FixedStringMatcher extends StringMatcher { private final String fixedString; private final StringMatcher nextMatcher; @@ -47,10 +47,14 @@ public class FixedStringMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { - return string.startsWith(fixedString) && + int fixedStringLength = fixedString.length(); + return length >= fixedStringLength && + string.startsWith(fixedString, offset) && (nextMatcher == null || - nextMatcher.matches(string.substring(fixedString.length()))); + nextMatcher.matches(string, + offset + fixedStringLength, + length - fixedStringLength)); } } diff --git a/src/proguard/util/ListMatcher.java b/src/proguard/util/ListMatcher.java index 431e8bd..49b61e1 100644 --- a/src/proguard/util/ListMatcher.java +++ b/src/proguard/util/ListMatcher.java @@ -28,7 +28,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class ListMatcher implements StringMatcher +public class ListMatcher extends StringMatcher { private final StringMatcher[] matchers; private final boolean[] negate; @@ -49,13 +49,13 @@ public class ListMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { // Check the list of matchers. for (int index = 0; index < matchers.length; index++) { StringMatcher matcher = matchers[index]; - if (matcher.matches(string)) + if (matcher.matches(string, offset, length)) { return negate == null || !negate[index]; diff --git a/src/proguard/util/NotMatcher.java b/src/proguard/util/NotMatcher.java index 6178406..1654761 100644 --- a/src/proguard/util/NotMatcher.java +++ b/src/proguard/util/NotMatcher.java @@ -26,7 +26,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class NotMatcher implements StringMatcher +public class NotMatcher extends StringMatcher { private final StringMatcher matcher; @@ -39,8 +39,8 @@ public class NotMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { - return !matcher.matches(string); + return !matcher.matches(string, offset, length); } } diff --git a/src/proguard/util/OrMatcher.java b/src/proguard/util/OrMatcher.java index 5a607c4..07fd48e 100644 --- a/src/proguard/util/OrMatcher.java +++ b/src/proguard/util/OrMatcher.java @@ -26,7 +26,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class OrMatcher implements StringMatcher +public class OrMatcher extends StringMatcher { private final StringMatcher matcher1; private final StringMatcher matcher2; @@ -41,9 +41,9 @@ public class OrMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { - return matcher1.matches(string) || - matcher2.matches(string); + return matcher1.matches(string, offset, length) || + matcher2.matches(string, offset, length); } } diff --git a/src/proguard/util/SettableMatcher.java b/src/proguard/util/SettableMatcher.java index 1ca744f..35fab6e 100644 --- a/src/proguard/util/SettableMatcher.java +++ b/src/proguard/util/SettableMatcher.java @@ -26,7 +26,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class SettableMatcher implements StringMatcher +public class SettableMatcher extends StringMatcher { private StringMatcher matcher; @@ -39,8 +39,8 @@ public class SettableMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { - return matcher.matches(string); + return matcher.matches(string, offset, length); } } diff --git a/src/proguard/util/StringMatcher.java b/src/proguard/util/StringMatcher.java index c95df37..c5d11bb 100644 --- a/src/proguard/util/StringMatcher.java +++ b/src/proguard/util/StringMatcher.java @@ -22,17 +22,30 @@ package proguard.util; /** - * This interface provides a method to determine whether strings match a given - * criterion, which is specified by the implementation. + * This abstract class provides methods to determine whether strings match + * a given criterion, which is specified by the implementation. * * @author Eric Lafortune */ -public interface StringMatcher +public abstract class StringMatcher { /** * Checks whether the given string matches. * @param string the string to match. * @return a boolean indicating whether the string matches the criterion. */ - public boolean matches(String string); + public boolean matches(String string) + { + return matches(string, 0, string.length()); + } + + + /** + * Checks whether the given substring matches. + * @param string the string to match. + * @param offset the start offset of the substring. + * @param length the length of the substring. + * @return a boolean indicating whether the substring matches the criterion. + */ + protected abstract boolean matches(String string, int offset, int length); } diff --git a/src/proguard/util/VariableStringMatcher.java b/src/proguard/util/VariableStringMatcher.java index e8f314a..87b73bf 100644 --- a/src/proguard/util/VariableStringMatcher.java +++ b/src/proguard/util/VariableStringMatcher.java @@ -26,7 +26,7 @@ package proguard.util; * * @author Eric Lafortune */ -public class VariableStringMatcher implements StringMatcher +public class VariableStringMatcher extends StringMatcher { private final char[] allowedCharacters; private final char[] disallowedCharacters; @@ -50,15 +50,15 @@ public class VariableStringMatcher implements StringMatcher // Implementations for StringMatcher. - public boolean matches(String string) + protected boolean matches(String string, int offset, int length) { - if (string.length() < minimumLength) + if (length < minimumLength) { return false; } // Check the first minimum number of characters. - for (int index = 0; index < minimumLength; index++) + for (int index = offset; index < offset + minimumLength; index++) { if (!isAllowedCharacter(string.charAt(index))) { @@ -66,12 +66,12 @@ public class VariableStringMatcher implements StringMatcher } } - int maximumLength = Math.min(this.maximumLength, string.length()); + int maximumLength = Math.min(this.maximumLength, length); // Check the remaining characters, up to the maximum number. - for (int index = minimumLength; index < maximumLength; index++) + for (int index = offset + minimumLength; index < offset + maximumLength; index++) { - if (nextMatcher.matches(string.substring(index))) + if (nextMatcher.matches(string, index, length + offset - index)) { return true; } @@ -83,7 +83,7 @@ public class VariableStringMatcher implements StringMatcher } // Check the remaining characters in the string. - return nextMatcher.matches(string.substring(maximumLength)); + return nextMatcher.matches(string, offset + maximumLength, length - maximumLength); }