diff options
Diffstat (limited to 'src/proguard/obfuscate')
26 files changed, 77 insertions, 77 deletions
diff --git a/src/proguard/obfuscate/AttributeShrinker.java b/src/proguard/obfuscate/AttributeShrinker.java index 0c3ab94..b1b6dd3 100644 --- a/src/proguard/obfuscate/AttributeShrinker.java +++ b/src/proguard/obfuscate/AttributeShrinker.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 diff --git a/src/proguard/obfuscate/AttributeUsageMarker.java b/src/proguard/obfuscate/AttributeUsageMarker.java index 32a512b..81a4554 100644 --- a/src/proguard/obfuscate/AttributeUsageMarker.java +++ b/src/proguard/obfuscate/AttributeUsageMarker.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 diff --git a/src/proguard/obfuscate/ClassObfuscator.java b/src/proguard/obfuscate/ClassObfuscator.java index 9e1a91c..516c889 100644 --- a/src/proguard/obfuscate/ClassObfuscator.java +++ b/src/proguard/obfuscate/ClassObfuscator.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 @@ -109,14 +109,14 @@ implements ClassVisitor, if (flattenPackageHierarchy != null && flattenPackageHierarchy.length() > 0) { - flattenPackageHierarchy += ClassConstants.INTERNAL_PACKAGE_SEPARATOR; + flattenPackageHierarchy += ClassConstants.PACKAGE_SEPARATOR; } // First append the package separator if necessary. if (repackageClasses != null && repackageClasses.length() > 0) { - repackageClasses += ClassConstants.INTERNAL_PACKAGE_SEPARATOR; + repackageClasses += ClassConstants.PACKAGE_SEPARATOR; } this.useMixedCaseClassNames = useMixedCaseClassNames; @@ -151,7 +151,7 @@ implements ClassVisitor, // the an outer class prefix, if any, or it may be the fixed base // package, if classes are to be repackaged. String newPackagePrefix = newClassName != null ? - newClassName + ClassConstants.INTERNAL_INNER_CLASS_SEPARATOR : + newClassName + ClassConstants.INNER_CLASS_SEPARATOR : newPackagePrefix(ClassUtil.internalPackagePrefix(programClass.getName())); // Come up with a new class name, numeric or ordinary. @@ -410,7 +410,7 @@ implements ClassVisitor, // Let the factory produce a package name. newPackagePrefix = newSuperPackagePrefix + packageNameFactory.nextName() + - ClassConstants.INTERNAL_PACKAGE_SEPARATOR; + ClassConstants.PACKAGE_SEPARATOR; } while (packagePrefixMap.containsValue(newPackagePrefix)); diff --git a/src/proguard/obfuscate/ClassRenamer.java b/src/proguard/obfuscate/ClassRenamer.java index 4c5e496..0a0974d 100644 --- a/src/proguard/obfuscate/ClassRenamer.java +++ b/src/proguard/obfuscate/ClassRenamer.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 diff --git a/src/proguard/obfuscate/DictionaryNameFactory.java b/src/proguard/obfuscate/DictionaryNameFactory.java index 4a7e28c..ffe6e41 100644 --- a/src/proguard/obfuscate/DictionaryNameFactory.java +++ b/src/proguard/obfuscate/DictionaryNameFactory.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 diff --git a/src/proguard/obfuscate/MapCleaner.java b/src/proguard/obfuscate/MapCleaner.java index d11f443..365ec15 100644 --- a/src/proguard/obfuscate/MapCleaner.java +++ b/src/proguard/obfuscate/MapCleaner.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,7 +20,7 @@ */ package proguard.obfuscate; -import proguard.classfile.*; +import proguard.classfile.Clazz; import proguard.classfile.util.SimplifiedVisitor; import proguard.classfile.visitor.ClassVisitor; diff --git a/src/proguard/obfuscate/MappingKeeper.java b/src/proguard/obfuscate/MappingKeeper.java index 7ab1e25..e955e53 100644 --- a/src/proguard/obfuscate/MappingKeeper.java +++ b/src/proguard/obfuscate/MappingKeeper.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 @@ -163,7 +163,7 @@ public class MappingKeeper implements MappingProcessor warningPrinter.print(ClassUtil.internalClassName(className), "Warning: " + className + - ": method '" + methodReturnType + " " + methodName + ClassConstants.EXTERNAL_METHOD_ARGUMENTS_OPEN + methodArguments + ClassConstants.EXTERNAL_METHOD_ARGUMENTS_CLOSE + + ": method '" + methodReturnType + " " + methodName + JavaConstants.METHOD_ARGUMENTS_OPEN + methodArguments + JavaConstants.METHOD_ARGUMENTS_CLOSE + "' is not being kept as '" + currentNewName + "', but remapped to '" + newMethodName + "'"); } diff --git a/src/proguard/obfuscate/MappingPrinter.java b/src/proguard/obfuscate/MappingPrinter.java index a28d10c..aab779f 100644 --- a/src/proguard/obfuscate/MappingPrinter.java +++ b/src/proguard/obfuscate/MappingPrinter.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 @@ -106,8 +106,7 @@ implements ClassVisitor, // Special cases: <clinit> and <init> are always kept unchanged. // We can ignore them here. String name = programMethod.getName(programClass); - if (name.equals(ClassConstants.INTERNAL_METHOD_NAME_CLINIT) || - name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT)) + if (ClassUtil.isInitializer(name)) { return; } diff --git a/src/proguard/obfuscate/MappingProcessor.java b/src/proguard/obfuscate/MappingProcessor.java index 92a916a..8047e8d 100644 --- a/src/proguard/obfuscate/MappingProcessor.java +++ b/src/proguard/obfuscate/MappingProcessor.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 diff --git a/src/proguard/obfuscate/MappingReader.java b/src/proguard/obfuscate/MappingReader.java index 51d14ac..88a13e0 100644 --- a/src/proguard/obfuscate/MappingReader.java +++ b/src/proguard/obfuscate/MappingReader.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 diff --git a/src/proguard/obfuscate/MemberNameCleaner.java b/src/proguard/obfuscate/MemberNameCleaner.java index 5205fee..5b7e16f 100644 --- a/src/proguard/obfuscate/MemberNameCleaner.java +++ b/src/proguard/obfuscate/MemberNameCleaner.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 diff --git a/src/proguard/obfuscate/MemberNameCollector.java b/src/proguard/obfuscate/MemberNameCollector.java index 1544901..bab9e95 100644 --- a/src/proguard/obfuscate/MemberNameCollector.java +++ b/src/proguard/obfuscate/MemberNameCollector.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 @@ -21,7 +21,7 @@ package proguard.obfuscate; import proguard.classfile.*; -import proguard.classfile.util.SimplifiedVisitor; +import proguard.classfile.util.*; import proguard.classfile.visitor.MemberVisitor; import java.util.Map; @@ -64,8 +64,7 @@ implements MemberVisitor // Special cases: <clinit> and <init> are always kept unchanged. // We can ignore them here. String name = member.getName(clazz); - if (name.equals(ClassConstants.INTERNAL_METHOD_NAME_CLINIT) || - name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT)) + if (ClassUtil.isInitializer(name)) { return; } diff --git a/src/proguard/obfuscate/MemberNameConflictFixer.java b/src/proguard/obfuscate/MemberNameConflictFixer.java index 68e7c05..00ac6f7 100644 --- a/src/proguard/obfuscate/MemberNameConflictFixer.java +++ b/src/proguard/obfuscate/MemberNameConflictFixer.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 @@ -81,8 +81,7 @@ public class MemberNameConflictFixer implements MemberVisitor // Special cases: <clinit> and <init> are always kept unchanged. // We can ignore them here. String name = programMethod.getName(programClass); - if (name.equals(ClassConstants.INTERNAL_METHOD_NAME_CLINIT) || - name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT)) + if (ClassUtil.isInitializer(name)) { return; } diff --git a/src/proguard/obfuscate/MemberNameFilter.java b/src/proguard/obfuscate/MemberNameFilter.java index 6d95270..dfff99a 100644 --- a/src/proguard/obfuscate/MemberNameFilter.java +++ b/src/proguard/obfuscate/MemberNameFilter.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 @@ -106,7 +106,7 @@ public class MemberNameFilter implements MemberVisitor return hasName(method) || (hasName(clazz) && - method.getName(clazz).equals(ClassConstants.INTERNAL_METHOD_NAME_INIT)); + method.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT)); } diff --git a/src/proguard/obfuscate/MemberObfuscator.java b/src/proguard/obfuscate/MemberObfuscator.java index adf590c..b5211ac 100644 --- a/src/proguard/obfuscate/MemberObfuscator.java +++ b/src/proguard/obfuscate/MemberObfuscator.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 @@ -72,8 +72,7 @@ implements MemberVisitor // Special cases: <clinit> and <init> are always kept unchanged. // We can ignore them here. String name = member.getName(clazz); - if (name.equals(ClassConstants.INTERNAL_METHOD_NAME_CLINIT) || - name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT)) + if (ClassUtil.isInitializer(name)) { return; } diff --git a/src/proguard/obfuscate/MemberSpecialNameFilter.java b/src/proguard/obfuscate/MemberSpecialNameFilter.java index 0eb4d2d..f8ab913 100644 --- a/src/proguard/obfuscate/MemberSpecialNameFilter.java +++ b/src/proguard/obfuscate/MemberSpecialNameFilter.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 diff --git a/src/proguard/obfuscate/MultiMappingProcessor.java b/src/proguard/obfuscate/MultiMappingProcessor.java index 051260f..e10c100 100644 --- a/src/proguard/obfuscate/MultiMappingProcessor.java +++ b/src/proguard/obfuscate/MultiMappingProcessor.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 diff --git a/src/proguard/obfuscate/NameFactory.java b/src/proguard/obfuscate/NameFactory.java index 97ebe5a..cb5f998 100644 --- a/src/proguard/obfuscate/NameFactory.java +++ b/src/proguard/obfuscate/NameFactory.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 diff --git a/src/proguard/obfuscate/NameFactoryResetter.java b/src/proguard/obfuscate/NameFactoryResetter.java index b04d12e..a6188a6 100644 --- a/src/proguard/obfuscate/NameFactoryResetter.java +++ b/src/proguard/obfuscate/NameFactoryResetter.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 diff --git a/src/proguard/obfuscate/NameMarker.java b/src/proguard/obfuscate/NameMarker.java index 5283ef3..376943f 100644 --- a/src/proguard/obfuscate/NameMarker.java +++ b/src/proguard/obfuscate/NameMarker.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 @@ -21,11 +21,11 @@ package proguard.obfuscate; import proguard.classfile.*; -import proguard.classfile.util.SimplifiedVisitor; -import proguard.classfile.constant.ClassConstant; -import proguard.classfile.constant.visitor.ConstantVisitor; import proguard.classfile.attribute.*; import proguard.classfile.attribute.visitor.*; +import proguard.classfile.constant.ClassConstant; +import proguard.classfile.constant.visitor.ConstantVisitor; +import proguard.classfile.util.*; import proguard.classfile.visitor.*; @@ -156,11 +156,9 @@ implements ClassVisitor, { String name = method.getName(clazz); - if (!name.equals(ClassConstants.INTERNAL_METHOD_NAME_CLINIT) && - !name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT)) + if (!ClassUtil.isInitializer(name)) { - MemberObfuscator.setFixedNewMemberName(method, - method.getName(clazz)); + MemberObfuscator.setFixedNewMemberName(method, name); } } } diff --git a/src/proguard/obfuscate/NumericNameFactory.java b/src/proguard/obfuscate/NumericNameFactory.java index b1e38b1..0a23f16 100644 --- a/src/proguard/obfuscate/NumericNameFactory.java +++ b/src/proguard/obfuscate/NumericNameFactory.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,9 +20,6 @@ */ package proguard.obfuscate; -import java.util.*; - - /** * This <code>NameFactory</code> generates unique numeric names, starting at * "1". diff --git a/src/proguard/obfuscate/Obfuscator.java b/src/proguard/obfuscate/Obfuscator.java index cc79b0d..b2758a7 100644 --- a/src/proguard/obfuscate/Obfuscator.java +++ b/src/proguard/obfuscate/Obfuscator.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 @@ -98,6 +98,16 @@ public class Obfuscator libraryClassPool.classesAccept(nameMarker); libraryClassPool.classesAccept(new AllMemberVisitor(nameMarker)); + // We also keep the names of all methods of classes that are returned + // by dynamic method invocations. They may return dynamic + // implementations of interfaces. The method names then have to match + // with the invoke dynamic names. + programClassPool.classesAccept( + new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_7, + new AllConstantVisitor( + new DynamicReturnedClassVisitor( + new AllMemberVisitor(nameMarker))))); + // Mark attributes that have to be kept. AttributeVisitor attributeUsageMarker = new NonEmptyAttributeFilter( @@ -105,7 +115,7 @@ public class Obfuscator AttributeVisitor optionalAttributeUsageMarker = configuration.keepAttributes == null ? null : - new AttributeNameFilter(new ListParser(new NameParser()).parse(configuration.keepAttributes), + new AttributeNameFilter(configuration.keepAttributes, attributeUsageMarker); programClassPool.classesAccept( @@ -227,20 +237,20 @@ public class Obfuscator // the hierarchy. new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( - new MemberAccessFilter(ClassConstants.INTERNAL_ACC_PRIVATE, 0, + new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new MemberNameCollector(configuration.overloadAggressively, descriptorMap)))), // Collect all non-private member names anywhere in the hierarchy. new ClassHierarchyTraveler(true, true, true, true, new AllMemberVisitor( - new MemberAccessFilter(0, ClassConstants.INTERNAL_ACC_PRIVATE, + new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new MemberNameCollector(configuration.overloadAggressively, descriptorMap)))), // Assign new names to all non-private members in this class. new AllMemberVisitor( - new MemberAccessFilter(0, ClassConstants.INTERNAL_ACC_PRIVATE, + new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new MemberObfuscator(configuration.overloadAggressively, nameFactory, descriptorMap))), @@ -261,7 +271,7 @@ public class Obfuscator // Collect all non-private member names higher up the hierarchy. new ClassHierarchyTraveler(false, true, true, false, new AllMemberVisitor( - new MemberAccessFilter(0, ClassConstants.INTERNAL_ACC_PRIVATE, + new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new MemberNameCollector(configuration.overloadAggressively, descriptorMap)))), @@ -272,7 +282,7 @@ public class Obfuscator // bugs #6691741 and #6684387, ProGuard bug #3471941, // and ProGuard test #1180). new ClassHierarchyTraveler(false, false, false, true, - new ClassAccessFilter(ClassConstants.INTERNAL_ACC_ABSTRACT, 0, + new ClassAccessFilter(ClassConstants.ACC_ABSTRACT, 0, new ClassHierarchyTraveler(false, false, true, false, new AllMemberVisitor( new MemberNameCollector(configuration.overloadAggressively, @@ -280,7 +290,7 @@ public class Obfuscator // Assign new names to all private members in this class. new AllMemberVisitor( - new MemberAccessFilter(ClassConstants.INTERNAL_ACC_PRIVATE, 0, + new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new MemberObfuscator(configuration.overloadAggressively, nameFactory, descriptorMap))), @@ -319,7 +329,7 @@ public class Obfuscator // the hierarchy. new ClassHierarchyTraveler(true, false, false, true, new AllMemberVisitor( - new MemberAccessFilter(ClassConstants.INTERNAL_ACC_PRIVATE, 0, + new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new MemberNameCollector(configuration.overloadAggressively, descriptorMap)))), @@ -327,7 +337,7 @@ public class Obfuscator // higher up the hierarchy. new ClassHierarchyTraveler(true, true, true, false, new AllMemberVisitor( - new MemberAccessFilter(0, ClassConstants.INTERNAL_ACC_PRIVATE, + new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new MemberNameCollector(configuration.overloadAggressively, descriptorMap)))), @@ -335,7 +345,7 @@ public class Obfuscator // in this class and higher up the hierarchy. new ClassHierarchyTraveler(true, true, true, false, new AllMemberVisitor( - new MemberAccessFilter(0, ClassConstants.INTERNAL_ACC_PRIVATE, + new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new MemberNameConflictFixer(configuration.overloadAggressively, descriptorMap, warningPrinter, @@ -360,14 +370,14 @@ public class Obfuscator // Collect all non-private member names higher up the hierarchy. new ClassHierarchyTraveler(false, true, true, false, new AllMemberVisitor( - new MemberAccessFilter(0, ClassConstants.INTERNAL_ACC_PRIVATE, + new MemberAccessFilter(0, ClassConstants.ACC_PRIVATE, new MemberNameCollector(configuration.overloadAggressively, descriptorMap)))), // Assign new names to all conflicting private members in this // class. new AllMemberVisitor( - new MemberAccessFilter(ClassConstants.INTERNAL_ACC_PRIVATE, 0, + new MemberAccessFilter(ClassConstants.ACC_PRIVATE, 0, new MemberNameConflictFixer(configuration.overloadAggressively, descriptorMap, warningPrinter, @@ -391,12 +401,12 @@ public class Obfuscator { System.err.println(" If you are sure the conflicts are harmless,"); System.err.println(" you could try your luck using the '-ignorewarnings' option."); - } + } - System.err.println(" (http://proguard.sourceforge.net/manual/troubleshooting.html#mappingconflict2)"); + System.err.println(" (http://proguard.sourceforge.net/manual/troubleshooting.html#mappingconflict2)"); - if (!configuration.ignoreWarnings) - { + if (!configuration.ignoreWarnings) + { throw new IOException("Please correct the above warnings first."); } } @@ -438,8 +448,7 @@ public class Obfuscator configuration.allowAccessModification) { programClassPool.classesAccept( - new AllConstantVisitor( - new AccessFixer())); + new AccessFixer()); // Fix the access flags of the inner classes information. programClassPool.classesAccept( diff --git a/src/proguard/obfuscate/ParameterNameMarker.java b/src/proguard/obfuscate/ParameterNameMarker.java index 22af125..fbe8a81 100644 --- a/src/proguard/obfuscate/ParameterNameMarker.java +++ b/src/proguard/obfuscate/ParameterNameMarker.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 @@ -23,7 +23,7 @@ package proguard.obfuscate; import proguard.classfile.*; import proguard.classfile.attribute.*; import proguard.classfile.attribute.visitor.AttributeVisitor; -import proguard.classfile.util.*; +import proguard.classfile.util.SimplifiedVisitor; /** * This AttributeVisitor trims and marks all local variable (type) table @@ -60,9 +60,9 @@ implements AttributeVisitor if (!AttributeUsageMarker.isUsed(localVariableTableAttribute) && hasParameters(clazz, method)) { - // Shift the entries that start at offset 0 to the front. + // Shift the entries that start at offset 0 to the front. int newIndex = 0; - + for (int index = 0; index < localVariableTableAttribute.u2localVariableTableLength; index++) { LocalVariableInfo localVariableInfo = @@ -92,9 +92,9 @@ implements AttributeVisitor if (!AttributeUsageMarker.isUsed(localVariableTypeTableAttribute) && hasParameters(clazz, method)) { - // Shift the entries that start at offset 0 to the front. + // Shift the entries that start at offset 0 to the front. int newIndex = 0; - + for (int index = 0; index < localVariableTypeTableAttribute.u2localVariableTypeTableLength; index++) { LocalVariableTypeInfo localVariableTypeInfo = @@ -109,7 +109,7 @@ implements AttributeVisitor // Trim the table. localVariableTypeTableAttribute.u2localVariableTypeTableLength = newIndex; - + // Mark the table if there are any entries. if (newIndex > 0) { @@ -123,6 +123,6 @@ implements AttributeVisitor private boolean hasParameters(Clazz clazz, Method method) { - return method.getDescriptor(clazz).charAt(1) != ClassConstants.INTERNAL_METHOD_ARGUMENTS_CLOSE; + return method.getDescriptor(clazz).charAt(1) != ClassConstants.METHOD_ARGUMENTS_CLOSE; } }
\ No newline at end of file diff --git a/src/proguard/obfuscate/SimpleNameFactory.java b/src/proguard/obfuscate/SimpleNameFactory.java index 0473852..c7e1a50 100644 --- a/src/proguard/obfuscate/SimpleNameFactory.java +++ b/src/proguard/obfuscate/SimpleNameFactory.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 diff --git a/src/proguard/obfuscate/SourceFileRenamer.java b/src/proguard/obfuscate/SourceFileRenamer.java index 248d18f..57ab009 100644 --- a/src/proguard/obfuscate/SourceFileRenamer.java +++ b/src/proguard/obfuscate/SourceFileRenamer.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 diff --git a/src/proguard/obfuscate/SpecialNameFactory.java b/src/proguard/obfuscate/SpecialNameFactory.java index 596f919..84bb55f 100644 --- a/src/proguard/obfuscate/SpecialNameFactory.java +++ b/src/proguard/obfuscate/SpecialNameFactory.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 |