diff options
Diffstat (limited to 'src/proguard/ProGuard.java')
-rw-r--r-- | src/proguard/ProGuard.java | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/proguard/ProGuard.java b/src/proguard/ProGuard.java index f9dbf54..b35921c 100644 --- a/src/proguard/ProGuard.java +++ b/src/proguard/ProGuard.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 @@ -20,16 +20,16 @@ */ package proguard; -import proguard.classfile.ClassPool; -import proguard.classfile.editor.ClassElementSorter; +import proguard.classfile.*; +import proguard.classfile.attribute.visitor.AllAttributeVisitor; +import proguard.classfile.editor.*; import proguard.classfile.visitor.*; import proguard.obfuscate.Obfuscator; -import proguard.optimize.*; +import proguard.optimize.Optimizer; import proguard.preverify.*; import proguard.shrink.Shrinker; import java.io.*; -import java.util.Properties; /** * Tool for shrinking, optimizing, obfuscating, and preverifying Java classes. @@ -38,7 +38,7 @@ import java.util.Properties; */ public class ProGuard { - public static final String VERSION = "ProGuard, version 4.10"; + public static final String VERSION = "ProGuard, version 5.1"; private final Configuration configuration; private ClassPool programClassPool = new ClassPool(); @@ -69,6 +69,8 @@ public class ProGuard printConfiguration(); } + new ConfigurationChecker(configuration).check(); + if (configuration.programJars != null && configuration.programJars.hasOutput() && new UpToDateChecker(configuration).check()) @@ -78,6 +80,14 @@ public class ProGuard readInput(); + if (configuration.shrink || + configuration.optimize || + configuration.obfuscate || + configuration.preverify) + { + clearPreverification(); + } + if (configuration.printSeeds != null || configuration.shrink || configuration.optimize || @@ -336,6 +346,19 @@ public class ProGuard /** + * Clears any JSE preverification information from the program classes. + */ + private void clearPreverification() + { + programClassPool.classesAccept( + new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_6, + new AllMethodVisitor( + new AllAttributeVisitor( + new NamedAttributeDeleter(ClassConstants.ATTR_StackMapTable))))); + } + + + /** * Performs the preverification step. */ private void preverify() |