Java Code Examples for proguard.classfile.ClassPool#classesAcceptAlphabetically()
The following examples show how to use
proguard.classfile.ClassPool#classesAcceptAlphabetically() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeedPrinter.java From proguard with GNU General Public License v2.0 | 5 votes |
/** * Prints out the seeds for the classes in the given program class pool. * @param configuration the configuration containing the keep options. * @throws IOException if an IO error occurs while writing the configuration. */ public void write(Configuration configuration, ClassPool programClassPool, ClassPool libraryClassPool) throws IOException { // Check if we have at least some keep commands. if (configuration.keep == null) { throw new IOException("You have to specify '-keep' options if you want to write out kept elements with '-printseeds'."); } // Clean up any old processing info. programClassPool.classesAccept(new ClassCleaner()); libraryClassPool.classesAccept(new ClassCleaner()); // Create a visitor for printing out the seeds. We're printing out // the program elements that are preserved against shrinking, // optimization, or obfuscation. KeepMarker keepMarker = new KeepMarker(); ClassPoolVisitor classPoolvisitor = new KeepClassSpecificationVisitorFactory(true, true, true) .createClassPoolVisitor(configuration.keep, keepMarker, keepMarker, keepMarker, null); // Mark the seeds. programClassPool.accept(classPoolvisitor); libraryClassPool.accept(classPoolvisitor); // Print out the seeds. SimpleClassPrinter printer = new SimpleClassPrinter(false, printWriter); programClassPool.classesAcceptAlphabetically( new MultiClassVisitor( new KeptClassFilter(printer), new AllMemberVisitor(new KeptMemberFilter(printer)) )); }
Example 2
Source File: SeedPrinter.java From java-n-IDE-for-Android with Apache License 2.0 | 5 votes |
/** * Prints out the seeds for the classes in the given program class pool. * @param configuration the configuration containing the keep options. * @throws IOException if an IO error occurs while writing the configuration. */ public void write(Configuration configuration, ClassPool programClassPool, ClassPool libraryClassPool) throws IOException { // Check if we have at least some keep commands. if (configuration.keep == null) { throw new IOException("You have to specify '-keep' options for the shrinking step."); } // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); libraryClassPool.classesAccept(new ClassCleaner()); // Create a visitor for printing out the seeds. We're printing out // the program elements that are preserved against shrinking, // optimization, or obfuscation. KeepMarker keepMarker = new KeepMarker(); ClassPoolVisitor classPoolvisitor = ClassSpecificationVisitorFactory.createClassPoolVisitor(configuration.keep, keepMarker, keepMarker, true, true, true); // Mark the seeds. programClassPool.accept(classPoolvisitor); libraryClassPool.accept(classPoolvisitor); // Print out the seeds. SimpleClassPrinter printer = new SimpleClassPrinter(false, ps); programClassPool.classesAcceptAlphabetically(new MultiClassVisitor( new ClassVisitor[] { new KeptClassFilter(printer), new AllMemberVisitor(new KeptMemberFilter(printer)) })); }
Example 3
Source File: SeedPrinter.java From proguard with GNU General Public License v2.0 | 5 votes |
/** * Prints out the seeds for the classes in the given program class pool. * @param configuration the configuration containing the keep options. * @throws IOException if an IO error occurs while writing the configuration. */ public void write(Configuration configuration, ClassPool programClassPool, ClassPool libraryClassPool) throws IOException { // Check if we have at least some keep commands. if (configuration.keep == null) { throw new IOException("You have to specify '-keep' options for the shrinking step."); } // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); libraryClassPool.classesAccept(new ClassCleaner()); // Create a visitor for printing out the seeds. We're printing out // the program elements that are preserved against shrinking, // optimization, or obfuscation. KeepMarker keepMarker = new KeepMarker(); ClassPoolVisitor classPoolvisitor = ClassSpecificationVisitorFactory.createClassPoolVisitor(configuration.keep, keepMarker, keepMarker, true, true, true); // Mark the seeds. programClassPool.accept(classPoolvisitor); libraryClassPool.accept(classPoolvisitor); // Print out the seeds. SimpleClassPrinter printer = new SimpleClassPrinter(false, ps); programClassPool.classesAcceptAlphabetically(new MultiClassVisitor( new ClassVisitor[] { new KeptClassFilter(printer), new AllMemberVisitor(new KeptMemberFilter(printer)) })); }
Example 4
Source File: SeedPrinter.java From bazel with Apache License 2.0 | 5 votes |
/** * Prints out the seeds for the classes in the given program class pool. * @param configuration the configuration containing the keep options. * @throws IOException if an IO error occurs while writing the configuration. */ public void write(Configuration configuration, ClassPool programClassPool, ClassPool libraryClassPool) throws IOException { // Check if we have at least some keep commands. if (configuration.keep == null) { throw new IOException("You have to specify '-keep' options for the shrinking step."); } // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); libraryClassPool.classesAccept(new ClassCleaner()); // Create a visitor for printing out the seeds. We're printing out // the program elements that are preserved against shrinking, // optimization, or obfuscation. KeepMarker keepMarker = new KeepMarker(); ClassPoolVisitor classPoolvisitor = ClassSpecificationVisitorFactory.createClassPoolVisitor(configuration.keep, keepMarker, keepMarker, true, true, true); // Mark the seeds. programClassPool.accept(classPoolvisitor); libraryClassPool.accept(classPoolvisitor); // Print out the seeds. SimpleClassPrinter printer = new SimpleClassPrinter(false, ps); programClassPool.classesAcceptAlphabetically(new MultiClassVisitor( new ClassVisitor[] { new KeptClassFilter(printer), new AllMemberVisitor(new KeptMemberFilter(printer)) })); }