本文整理汇总了Java中proguard.optimize.KeepMarker类的典型用法代码示例。如果您正苦于以下问题:Java KeepMarker类的具体用法?Java KeepMarker怎么用?Java KeepMarker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
KeepMarker类属于proguard.optimize包,在下文中一共展示了KeepMarker类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitProgramClass
import proguard.optimize.KeepMarker; //导入依赖的package包/类
public void visitProgramClass(ProgramClass programClass)
{
// If the class is not final/interface/abstract,
// and it is not being kept,
// and it doesn't have any subclasses,
// then make it final.
if ((programClass.u2accessFlags & (ClassConstants.INTERNAL_ACC_FINAL |
ClassConstants.INTERNAL_ACC_INTERFACE |
ClassConstants.INTERNAL_ACC_ABSTRACT)) == 0 &&
!KeepMarker.isKept(programClass) &&
programClass.subClasses == null)
{
programClass.u2accessFlags |= ClassConstants.INTERNAL_ACC_FINAL;
// Visit the class, if required.
if (extraClassVisitor != null)
{
extraClassVisitor.visitProgramClass(programClass);
}
}
}
示例2: checkClassSpecifications
import proguard.optimize.KeepMarker; //导入依赖的package包/类
/**
* Checks the classes mentioned in the given keep specifications, printing
* notes if necessary.
*/
public void checkClassSpecifications(List keepSpecifications)
{
// Clean up any old visitor info.
programClassPool.classesAccept(new ClassCleaner());
libraryClassPool.classesAccept(new ClassCleaner());
// Create a visitor for marking the seeds.
KeepMarker keepMarker = new KeepMarker();
ClassPoolVisitor classPoolvisitor =
ClassSpecificationVisitorFactory.createClassPoolVisitor(keepSpecifications,
keepMarker,
keepMarker,
false,
true,
true);
// Mark the seeds.
programClassPool.accept(classPoolvisitor);
libraryClassPool.accept(classPoolvisitor);
// Print out notes about argument types that are not being kept in
// class members that are being kept.
programClassPool.classesAccept(
new AllMemberVisitor(
new KeptMemberFilter(this)));
}
示例3: visitProgramClass
import proguard.optimize.KeepMarker; //导入依赖的package包/类
public void visitProgramClass(ProgramClass programClass)
{
if (!KeepMarker.isKept(programClass))
{
notePrinter.print(referencingClass.getName(),
programClass.getName(),
"Note: the configuration keeps the entry point '" +
ClassUtil.externalClassName(referencingClass.getName()) +
" { " +
(isField ?
ClassUtil.externalFullFieldDescription(0,
referencingMember.getName(referencingClass),
referencingMember.getDescriptor(referencingClass)) :
ClassUtil.externalFullMethodDescription(referencingClass.getName(),
0,
referencingMember.getName(referencingClass),
referencingMember.getDescriptor(referencingClass))) +
"; }', but not the descriptor class '" +
ClassUtil.externalClassName(programClass.getName()) +
"'");
}
}
示例4: visitProgramClass
import proguard.optimize.KeepMarker; //导入依赖的package包/类
public void visitProgramClass(ProgramClass programClass)
{
// If the class is not final/interface/abstract,
// and it is not being kept,
// and it doesn't have any subclasses,
// then make it final.
if ((programClass.u2accessFlags & (ClassConstants.ACC_FINAL |
ClassConstants.ACC_INTERFACE |
ClassConstants.ACC_ABSTRACT)) == 0 &&
!KeepMarker.isKept(programClass) &&
programClass.subClasses == null)
{
programClass.u2accessFlags |= ClassConstants.ACC_FINAL;
// Visit the class, if required.
if (extraClassVisitor != null)
{
extraClassVisitor.visitProgramClass(programClass);
}
}
}
示例5: write
import proguard.optimize.KeepMarker; //导入依赖的package包/类
/**
* 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))
}));
}
示例6: visitProgramField
import proguard.optimize.KeepMarker; //导入依赖的package包/类
public void visitProgramField(ProgramClass programClass, ProgramField programField)
{
if (!KeepMarker.isKept(programField))
{
FieldOptimizationInfo.setFieldOptimizationInfo(programClass,
programField);
}
}
示例7: visitProgramMethod
import proguard.optimize.KeepMarker; //导入依赖的package包/类
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
{
if (!KeepMarker.isKept(programMethod))
{
MethodOptimizationInfo.setMethodOptimizationInfo(programClass,
programMethod);
}
}
示例8: visitProgramClass
import proguard.optimize.KeepMarker; //导入依赖的package包/类
public void visitProgramClass(ProgramClass programClass)
{
if (!KeepMarker.isKept(programClass))
{
ClassOptimizationInfo.setClassOptimizationInfo(programClass);
}
}
示例9: visitProgramMethod
import proguard.optimize.KeepMarker; //导入依赖的package包/类
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
{
String name = programMethod.getName(programClass);
// If the method is not already private/static/final/abstract,
// and it is not a constructor,
// and its class is final,
// or it is not being kept and it is not overridden,
// then make it final.
if ((programMethod.u2accessFlags & (ClassConstants.INTERNAL_ACC_PRIVATE |
ClassConstants.INTERNAL_ACC_STATIC |
ClassConstants.INTERNAL_ACC_FINAL |
ClassConstants.INTERNAL_ACC_ABSTRACT)) == 0 &&
!name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT) &&
((programClass.u2accessFlags & ClassConstants.INTERNAL_ACC_FINAL) != 0 ||
(!KeepMarker.isKept(programMethod) &&
(programClass.subClasses == null ||
!memberFinder.isOverriden(programClass, programMethod)))))
{
programMethod.u2accessFlags |= ClassConstants.INTERNAL_ACC_FINAL;
// Visit the method, if required.
if (extraMemberVisitor != null)
{
extraMemberVisitor.visitProgramMethod(programClass, programMethod);
}
}
}
示例10: visitProgramMethod
import proguard.optimize.KeepMarker; //导入依赖的package包/类
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
{
String name = programMethod.getName(programClass);
// If the method is not already private/static/final/abstract,
// and it is not a constructor,
// and its class is final,
// or it is not being kept and it is not overridden,
// then make it final.
if ((programMethod.u2accessFlags & (ClassConstants.ACC_PRIVATE |
ClassConstants.ACC_STATIC |
ClassConstants.ACC_FINAL |
ClassConstants.ACC_ABSTRACT)) == 0 &&
!name.equals(ClassConstants.METHOD_NAME_INIT) &&
((programClass.u2accessFlags & ClassConstants.ACC_FINAL) != 0 ||
(!KeepMarker.isKept(programMethod) &&
(programClass.subClasses == null ||
!memberFinder.isOverriden(programClass, programMethod)))))
{
programMethod.u2accessFlags |= ClassConstants.ACC_FINAL;
// Visit the method, if required.
if (extraMemberVisitor != null)
{
extraMemberVisitor.visitProgramMethod(programClass, programMethod);
}
}
}