类 ConfigurationLogger
- java.lang.Object
-
- proguard.configuration.ConfigurationLogger
-
- 所有已实现的接口:
java.lang.Runnable
public class ConfigurationLogger extends java.lang.Object implements java.lang.RunnableThis class can be injected in applications to log information about reflection being used in the application code, and suggest appropriate ProGuard rules for keeping the reflected classes, methods and/or fields.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classConfigurationLogger.ClassInfoContainer of processing information of a class.static classConfigurationLogger.MemberInfo
-
字段概要
字段 修饰符和类型 字段 说明 static intALL_DECLARED_CONSTRUCTORS_KEPTstatic intALL_DECLARED_FIELDS_KEPTstatic intALL_DECLARED_METHODS_KEPTstatic intALL_PUBLIC_CONSTRUCTORS_KEPTstatic intALL_PUBLIC_FIELDS_KEPTstatic intALL_PUBLIC_METHODS_KEPTstatic intCLASS_KEPTstatic java.lang.StringCLASS_MAP_FILENAMEstatic intCLASS_SHRUNKstatic intMEMBER_KEPTstatic intMEMBER_SHRUNK
-
构造器概要
构造器 构造器 说明 ConfigurationLogger()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static voidcheckClass(java.lang.String reflectionClassName, java.lang.String reflectionMethodName, java.lang.String reflectedClassName, java.lang.String callingClassName)Check if a class that is loaded via reflection is kept and if not, log a keep rule suggestion for it.static voidcheckForName(java.lang.String reflectedClassName, java.lang.String callingClassName)Check if a class that is loaded via Class.forName() is kept and if not, log a keep rule suggestion for it.static voidcheckGetConstructor(java.lang.Class reflectedClass, java.lang.Class[] constructorParameters, java.lang.String callingClassName)Check if a constructor that is retrieved via Class.getConstructor() is kept and if not, log a keep rule suggestion for it.static voidcheckGetConstructor(java.lang.String reflectionMethodName, java.lang.Class reflectedClass, java.lang.Class[] constructorParameters, java.lang.String callingClassName)Check if a constructor that is retrieved via reflection is kept and if not, log a keep rule suggestion for it.static voidcheckGetConstructors(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the constructors of a class on which getConstructors() is called are all kept and if not, log a keep rule suggestion for it.static voidcheckGetDeclaredConstructor(java.lang.Class reflectedClass, java.lang.Class[] constructorParameters, java.lang.String callingClassName)Check if a constructor that is retrieved via Class.getDeclaredConstructor() is kept and if not, log a keep rule suggestion for it.static voidcheckGetDeclaredConstructors(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the constructors of a class on which getDeclaredConstructors() is called are all kept and if not, log a keep rule suggestion for it.static voidcheckGetDeclaredField(java.lang.Class reflectedClass, java.lang.String reflectedFieldName, java.lang.String callingClassName)Check if a field that is retrieved via Class.getDeclaredField() is kept and if not, log a keep rule suggestion for it.static voidcheckGetDeclaredFields(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the fields of a class whose fields are retrieved via Class.getDeclaredFields() are all kept and if not, log a keep rule suggestion for it.static voidcheckGetDeclaredMethod(java.lang.Class reflectedClass, java.lang.String reflectedMethodName, java.lang.Class[] reflectedMethodParameters, java.lang.String callingClassName)Check if a method that is retrieved via Class.getDeclaredMethod() is kept and if not, log a keep rule suggestion for it.static voidcheckGetDeclaredMethods(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the methods of a class on which getDeclaredMethods() is called are all kept and if not, log a keep rule suggestion for it.static voidcheckGetField(java.lang.Class reflectedClass, java.lang.String reflectedFieldName, java.lang.String callingClassName)Check if a field that is retrieved via Class.getField() is kept and if not, log a keep rule suggestion for it.static voidcheckGetFields(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the fields of a class whose fields are retrieved via Class.getFields() are all kept and if not, log a keep rule suggestion for it.static voidcheckGetMethod(java.lang.Class reflectedClass, java.lang.String reflectedMethodName, java.lang.Class[] reflectedMethodParameters, java.lang.String callingClassName)Check if a method that is retrieved via Class.getMethod() is kept and if not, log a keep rule suggestion for it.static voidcheckGetMethods(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the methods of a class on which getMethods() is called are all kept and if not, log a keep rule suggestion for it.static voidcheckLoadClass(java.lang.String reflectedClassName, java.lang.String callingClassName)Check if a class that is loaded via ClassLoader.loadClass() is kept and if not, log a keep rule suggestion for it.static voidloadClassMap(java.io.InputStream inputStream, java.util.Map<java.lang.String,ConfigurationLogger.ClassInfo> map)Load a classmap.txt file into a map.voidrun()
-
-
-
字段详细资料
-
CLASS_MAP_FILENAME
public static final java.lang.String CLASS_MAP_FILENAME
- 另请参阅:
- 常量字段值
-
CLASS_KEPT
public static final int CLASS_KEPT
- 另请参阅:
- 常量字段值
-
ALL_DECLARED_CONSTRUCTORS_KEPT
public static final int ALL_DECLARED_CONSTRUCTORS_KEPT
- 另请参阅:
- 常量字段值
-
ALL_PUBLIC_CONSTRUCTORS_KEPT
public static final int ALL_PUBLIC_CONSTRUCTORS_KEPT
- 另请参阅:
- 常量字段值
-
ALL_DECLARED_FIELDS_KEPT
public static final int ALL_DECLARED_FIELDS_KEPT
- 另请参阅:
- 常量字段值
-
ALL_PUBLIC_FIELDS_KEPT
public static final int ALL_PUBLIC_FIELDS_KEPT
- 另请参阅:
- 常量字段值
-
ALL_DECLARED_METHODS_KEPT
public static final int ALL_DECLARED_METHODS_KEPT
- 另请参阅:
- 常量字段值
-
ALL_PUBLIC_METHODS_KEPT
public static final int ALL_PUBLIC_METHODS_KEPT
- 另请参阅:
- 常量字段值
-
CLASS_SHRUNK
public static final int CLASS_SHRUNK
- 另请参阅:
- 常量字段值
-
MEMBER_KEPT
public static final int MEMBER_KEPT
- 另请参阅:
- 常量字段值
-
MEMBER_SHRUNK
public static final int MEMBER_SHRUNK
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
checkForName
public static void checkForName(java.lang.String reflectedClassName, java.lang.String callingClassName)Check if a class that is loaded via Class.forName() is kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClassName- the name of the class that is introspected.callingClassName- the class from which the reflection API is called.
-
checkLoadClass
public static void checkLoadClass(java.lang.String reflectedClassName, java.lang.String callingClassName)Check if a class that is loaded via ClassLoader.loadClass() is kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClassName- the name of the class that is introspected.callingClassName- the class from which the reflection API is called.
-
checkClass
public static void checkClass(java.lang.String reflectionClassName, java.lang.String reflectionMethodName, java.lang.String reflectedClassName, java.lang.String callingClassName)Check if a class that is loaded via reflection is kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClassName- the name of the class that is introspected.callingClassName- the class from which the reflection API is called.
-
checkGetField
public static void checkGetField(java.lang.Class reflectedClass, java.lang.String reflectedFieldName, java.lang.String callingClassName)Check if a field that is retrieved via Class.getField() is kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.reflectedFieldName- the field that is retrieved via reflection.callingClassName- the class from which the reflection API is called.
-
checkGetDeclaredField
public static void checkGetDeclaredField(java.lang.Class reflectedClass, java.lang.String reflectedFieldName, java.lang.String callingClassName)Check if a field that is retrieved via Class.getDeclaredField() is kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.reflectedFieldName- the field that is retrieved via reflection.callingClassName- the class from which the reflection API is called.
-
checkGetDeclaredFields
public static void checkGetDeclaredFields(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the fields of a class whose fields are retrieved via Class.getDeclaredFields() are all kept and if not, log a keep rule suggestion for it.- 参数:
callingClassName- the class from which the reflection API is called.reflectedClass- the class that is introspected.
-
checkGetFields
public static void checkGetFields(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the fields of a class whose fields are retrieved via Class.getFields() are all kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.callingClassName- the class from which the reflection API is called.
-
checkGetDeclaredConstructor
public static void checkGetDeclaredConstructor(java.lang.Class reflectedClass, java.lang.Class[] constructorParameters, java.lang.String callingClassName)Check if a constructor that is retrieved via Class.getDeclaredConstructor() is kept and if not, log a keep rule suggestion for it.
-
checkGetConstructor
public static void checkGetConstructor(java.lang.Class reflectedClass, java.lang.Class[] constructorParameters, java.lang.String callingClassName)Check if a constructor that is retrieved via Class.getConstructor() is kept and if not, log a keep rule suggestion for it.
-
checkGetConstructor
public static void checkGetConstructor(java.lang.String reflectionMethodName, java.lang.Class reflectedClass, java.lang.Class[] constructorParameters, java.lang.String callingClassName)Check if a constructor that is retrieved via reflection is kept and if not, log a keep rule suggestion for it.
-
checkGetDeclaredConstructors
public static void checkGetDeclaredConstructors(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the constructors of a class on which getDeclaredConstructors() is called are all kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.callingClassName- the class from which the reflection API is called.
-
checkGetConstructors
public static void checkGetConstructors(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the constructors of a class on which getConstructors() is called are all kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.callingClassName- the class from which the reflection API is called.
-
checkGetDeclaredMethod
public static void checkGetDeclaredMethod(java.lang.Class reflectedClass, java.lang.String reflectedMethodName, java.lang.Class[] reflectedMethodParameters, java.lang.String callingClassName)Check if a method that is retrieved via Class.getDeclaredMethod() is kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.reflectedMethodName- the method that is retrieved via reflection.reflectedMethodParameters- the parameters of the method that is retrieved via reflection.callingClassName- the class from which the reflection API is called.
-
checkGetMethod
public static void checkGetMethod(java.lang.Class reflectedClass, java.lang.String reflectedMethodName, java.lang.Class[] reflectedMethodParameters, java.lang.String callingClassName)Check if a method that is retrieved via Class.getMethod() is kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.reflectedMethodName- the method that is retrieved via reflection.reflectedMethodParameters- the parameters of the method that is retrieved via reflection.callingClassName- the class from which the reflection API is called.
-
checkGetDeclaredMethods
public static void checkGetDeclaredMethods(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the methods of a class on which getDeclaredMethods() is called are all kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.callingClassName- the class from which the reflection API is called.
-
checkGetMethods
public static void checkGetMethods(java.lang.Class reflectedClass, java.lang.String callingClassName)Check if the methods of a class on which getMethods() is called are all kept and if not, log a keep rule suggestion for it.- 参数:
reflectedClass- the class that is introspected.callingClassName- the class from which the reflection API is called.
-
run
public void run()
- 指定者:
run在接口中java.lang.Runnable
-
loadClassMap
public static void loadClassMap(java.io.InputStream inputStream, java.util.Map<java.lang.String,ConfigurationLogger.ClassInfo> map) throws java.io.IOExceptionLoad a classmap.txt file into a map.- 参数:
inputStream- Input stream from which to read the info.map- The map to load the info into.- 抛出:
java.io.IOException- If the input stream could not be read.
-
-