diff options
Diffstat (limited to 'src/proguard/KeepClassSpecification.java')
-rw-r--r-- | src/proguard/KeepClassSpecification.java | 98 |
1 files changed, 56 insertions, 42 deletions
diff --git a/src/proguard/KeepClassSpecification.java b/src/proguard/KeepClassSpecification.java index a6215c5..6c46271 100644 --- a/src/proguard/KeepClassSpecification.java +++ b/src/proguard/KeepClassSpecification.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu) * * 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 @@ -29,6 +29,7 @@ public class KeepClassSpecification extends ClassSpecification { public final boolean markClasses; public final boolean markConditionally; + public final boolean markDescriptorClasses; public final boolean allowShrinking; public final boolean allowOptimization; public final boolean allowObfuscation; @@ -36,47 +37,57 @@ public class KeepClassSpecification extends ClassSpecification /** * Creates a new KeepClassSpecification for all possible classes. - * @param markClasses specifies whether to mark the classes. - * If false, only class members are marked. - * If true, the classes are marked as well. - * @param markConditionally specifies whether to mark the classes and - * class members conditionally. If true, classes - * and class members are marked, on the condition - * that all specified class members are present. - * @param allowShrinking specifies whether shrinking is allowed. - * @param allowOptimization specifies whether optimization is allowed. - * @param allowObfuscation specifies whether obfuscation is allowed. + * @param markClasses specifies whether to mark the classes. + * If false, only class members are marked. + * If true, the classes are marked as well. + * @param markConditionally specifies whether to mark the classes and + * class members conditionally. If true, + * classes and class members are marked, on + * the condition that all specified class + * members are present. + * @param markDescriptorClasses specifies whether to mark the classes in + * the descriptors of the marked class members. + * @param allowShrinking specifies whether shrinking is allowed. + * @param allowOptimization specifies whether optimization is allowed. + * @param allowObfuscation specifies whether obfuscation is allowed. */ public KeepClassSpecification(boolean markClasses, boolean markConditionally, + boolean markDescriptorClasses, boolean allowShrinking, boolean allowOptimization, boolean allowObfuscation) { - this.markClasses = markClasses; - this.markConditionally = markConditionally; - this.allowShrinking = allowShrinking; - this.allowOptimization = allowOptimization; - this.allowObfuscation = allowObfuscation; + this.markClasses = markClasses; + this.markConditionally = markConditionally; + this.markDescriptorClasses = markDescriptorClasses; + this.allowShrinking = allowShrinking; + this.allowOptimization = allowOptimization; + this.allowObfuscation = allowObfuscation; } /** * Creates a new KeepClassSpecification. - * @param markClasses specifies whether to mark the classes. - * If false, only class members are marked. - * If true, the classes are marked as well. - * @param markConditionally specifies whether to mark the classes and - * class members conditionally. If true, classes - * and class members are marked, on the condition - * that all specified class members are present. - * @param allowShrinking specifies whether shrinking is allowed. - * @param allowOptimization specifies whether optimization is allowed. - * @param allowObfuscation specifies whether obfuscation is allowed. - * @param classSpecification the specification of classes and class members. + * @param markClasses specifies whether to mark the classes. + * If false, only class members are marked. + * If true, the classes are marked as well. + * @param markConditionally specifies whether to mark the classes and + * class members conditionally. If true, + * classes and class members are marked, on + * the condition that all specified class + * members are present. + * @param markDescriptorClasses specifies whether to mark the classes in + * the descriptors of the marked class members. + * @param allowShrinking specifies whether shrinking is allowed. + * @param allowOptimization specifies whether optimization is allowed. + * @param allowObfuscation specifies whether obfuscation is allowed. + * @param classSpecification the specification of classes and class + * members. */ public KeepClassSpecification(boolean markClasses, boolean markConditionally, + boolean markDescriptorClasses, boolean allowShrinking, boolean allowOptimization, boolean allowObfuscation, @@ -84,11 +95,12 @@ public class KeepClassSpecification extends ClassSpecification { super(classSpecification); - this.markClasses = markClasses; - this.markConditionally = markConditionally; - this.allowShrinking = allowShrinking; - this.allowOptimization = allowOptimization; - this.allowObfuscation = allowObfuscation; + this.markClasses = markClasses; + this.markConditionally = markConditionally; + this.markDescriptorClasses = markDescriptorClasses; + this.allowShrinking = allowShrinking; + this.allowOptimization = allowOptimization; + this.allowObfuscation = allowObfuscation; } @@ -104,22 +116,24 @@ public class KeepClassSpecification extends ClassSpecification KeepClassSpecification other = (KeepClassSpecification)object; return - this.markClasses == other.markClasses && - this.markConditionally == other.markConditionally && - this.allowShrinking == other.allowShrinking && - this.allowOptimization == other.allowOptimization && - this.allowObfuscation == other.allowObfuscation && + this.markClasses == other.markClasses && + this.markConditionally == other.markConditionally && + this.markDescriptorClasses == other.markDescriptorClasses && + this.allowShrinking == other.allowShrinking && + this.allowOptimization == other.allowOptimization && + this.allowObfuscation == other.allowObfuscation && super.equals(other); } public int hashCode() { return - (markClasses ? 0 : 1) ^ - (markConditionally ? 0 : 2) ^ - (allowShrinking ? 0 : 4) ^ - (allowOptimization ? 0 : 8) ^ - (allowObfuscation ? 0 : 16) ^ + (markClasses ? 0 : 1) ^ + (markConditionally ? 0 : 2) ^ + (markDescriptorClasses ? 0 : 4) ^ + (allowShrinking ? 0 : 8) ^ + (allowOptimization ? 0 : 16) ^ + (allowObfuscation ? 0 : 32) ^ super.hashCode(); } |