Package com.yworks.yguard.obf
Class Cl
- java.lang.Object
-
- com.yworks.yguard.obf.TreeItem
-
- com.yworks.yguard.obf.PkCl
-
- com.yworks.yguard.obf.Cl
-
- All Implemented Interfaces:
NameListDown,NameListUp
- Direct Known Subclasses:
PlaceholderCl
public class Cl extends PkCl implements NameListUp, NameListDown
Tree item representing a class or interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCl.ClassResolverThe interface Class resolver.
-
Constructor Summary
Constructors Constructor Description Cl(TreeItem parent, boolean isInnerClass, java.lang.String name, java.lang.String superClass, java.lang.String[] superInterfaces, int modifiers, ObfuscationConfig obfuscationConfig)Ctor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CladdClass(Cl cl)Add an inner class, used when copying inner classes from a placeholder.CladdClass(java.lang.Object[] classInfo)Add an inner class.FdaddField(FieldInfo fieldInfo)Add a field.MdaddMethod(MethodInfo methodInfo)Add a method.CladdPlaceholderClass(java.lang.String name)Add a placeholder class.java.util.SetgetAttributesToKeep()Gets attributes to keep.static Cl.ClassResolvergetClassResolver()Get class resolver class resolver.FdgetField(java.lang.String name)Get a field by name.java.util.EnumerationgetFieldEnum()Get an Enumeration of fields.java.lang.StringgetFieldObfNameDown(Cl caller, java.lang.String name)Is the field reserved because of its reservation down the class hierarchy?java.lang.StringgetFieldObfNameUp(java.lang.String name)Get obfuscated field name from list, or null if no mapping exists.java.lang.StringgetFieldOutNameUp(java.lang.String name)Get output field name from list, or null if no mapping exists.intgetInnerClassModifier(java.lang.String fqn)Get inner class modifier int.java.lang.String[]getInterfaces()Get interfaces string [ ].LineNumberTableMappergetLineNumberTableMapper()Gets line number table mapper.MdgetMethod(java.lang.String name, java.lang.String descriptor)Get a method by name.java.util.EnumerationgetMethodEnum()Get an Enumeration of methods.java.lang.StringgetMethodObfNameDown(Cl caller, java.lang.String name, java.lang.String descriptor)Is the method reserved because of its reservation down the class hierarchy?java.lang.StringgetMethodObfNameUp(java.lang.String name, java.lang.String descriptor)Get obfuscated method name from list, or null if no mapping exists.java.lang.StringgetMethodOutNameUp(java.lang.String name, java.lang.String descriptor)Get output method name from list, or null if no mapping exists.ObfuscationConfiggetObfuscationConfig()Gets obfuscation config.java.lang.StringgetSourceFileMapping()Gets source file mapping.java.lang.StringgetSuperClass()Get super class string.booleanhasAsSuper(java.lang.String queryName)Does this class have the specified class in its super chain?booleanisInnerClass()Is this an inner class?booleanisNRWildcardMatch(java.lang.String pattern)Is this class's name a non-recursive match to the wildcard pattern?booleanisSourceFileMappingSet()Is source file mapping set boolean.booleanisWildcardMatch(java.lang.String pattern)Is this class's name a match to the wildcard pattern?voidresetResolve()Prepare for resolve of a class entry by resetting flags.voidresolveOptimally()Resolve a class entry - set obfuscation permissions based on super class and interfaces.static voidsetClassResolver(Cl.ClassResolver res)Set class resolver.voidsetInnerClassModifiers(java.util.Map map)Set inner class modifiers.voidsetLineNumberTableMapper(LineNumberTableMapper lineNumberTableMapper)Sets line number table mapper.static voidsetPedantic(boolean val)Set pedantic.voidsetSourceFileMapping(java.lang.String sourceFileMapping)Sets source file mapping.voidsetupNameListDowns()Set up reverse list of reserved names prior to resolving classes.-
Methods inherited from class com.yworks.yguard.obf.PkCl
addAllClasses, addClass, addPlaceholderClass, generateNames, generateNames, getAllClassEnum, getClass, getClassCount, getClassEnum
-
Methods inherited from class com.yworks.yguard.obf.TreeItem
getFullInName, getFullOutName, getInName, getModifiers, getObfName, getOutName, getParent, isFixed, isFromScript, isFromScriptMap, isMatch, isNRMatch, isSynthetic, setFromScript, setFromScriptMap, setOutName, setParent
-
-
-
-
Constructor Detail
-
Cl
public Cl(TreeItem parent, boolean isInnerClass, java.lang.String name, java.lang.String superClass, java.lang.String[] superInterfaces, int modifiers, ObfuscationConfig obfuscationConfig)
Ctor.- Parameters:
parent- the parentisInnerClass- the is inner classname- the namesuperClass- the super classsuperInterfaces- the super interfacesmodifiers- the modifiersobfuscationConfig- the obfuscation config
-
-
Method Detail
-
getAttributesToKeep
public java.util.Set getAttributesToKeep()
Gets attributes to keep.- Returns:
- the attributes to keep
-
getClassResolver
public static Cl.ClassResolver getClassResolver()
Get class resolver class resolver.- Returns:
- the class resolver
-
setPedantic
public static void setPedantic(boolean val)
Set pedantic.- Parameters:
val- the val
-
setClassResolver
public static void setClassResolver(Cl.ClassResolver res)
Set class resolver.- Parameters:
res- the res
-
getLineNumberTableMapper
public LineNumberTableMapper getLineNumberTableMapper()
Gets line number table mapper.- Returns:
- the line number table mapper
-
setLineNumberTableMapper
public void setLineNumberTableMapper(LineNumberTableMapper lineNumberTableMapper)
Sets line number table mapper.- Parameters:
lineNumberTableMapper- the line number table mapper
-
getSourceFileMapping
public java.lang.String getSourceFileMapping()
Gets source file mapping.- Returns:
- the source file mapping
-
setSourceFileMapping
public void setSourceFileMapping(java.lang.String sourceFileMapping)
Sets source file mapping.- Parameters:
sourceFileMapping- the source file mapping
-
isSourceFileMappingSet
public boolean isSourceFileMappingSet()
Is source file mapping set boolean.- Returns:
- the boolean
-
getSuperClass
public java.lang.String getSuperClass()
Get super class string.- Returns:
- the string
-
getInterfaces
public java.lang.String[] getInterfaces()
Get interfaces string [ ].- Returns:
- the string [ ]
-
setInnerClassModifiers
public void setInnerClassModifiers(java.util.Map map)
Set inner class modifiers.- Parameters:
map- the map
-
getInnerClassModifier
public int getInnerClassModifier(java.lang.String fqn)
Get inner class modifier int.- Parameters:
fqn- the fqn- Returns:
- the int
-
isInnerClass
public boolean isInnerClass()
Is this an inner class?- Returns:
- the boolean
-
getMethod
public Md getMethod(java.lang.String name, java.lang.String descriptor)
Get a method by name.- Parameters:
name- the namedescriptor- the descriptor- Returns:
- the method
-
getField
public Fd getField(java.lang.String name)
Get a field by name.- Parameters:
name- the name- Returns:
- the field
-
getMethodEnum
public java.util.Enumeration getMethodEnum()
Get an Enumeration of methods.- Returns:
- the method enum
-
getFieldEnum
public java.util.Enumeration getFieldEnum()
Get an Enumeration of fields.- Returns:
- the field enum
-
isWildcardMatch
public boolean isWildcardMatch(java.lang.String pattern)
Is this class's name a match to the wildcard pattern?- Parameters:
pattern- the pattern- Returns:
- the boolean
-
isNRWildcardMatch
public boolean isNRWildcardMatch(java.lang.String pattern)
Is this class's name a non-recursive match to the wildcard pattern?- Parameters:
pattern- the pattern- Returns:
- the boolean
-
hasAsSuper
public boolean hasAsSuper(java.lang.String queryName) throws java.lang.ClassNotFoundExceptionDoes this class have the specified class in its super chain?- Parameters:
queryName- the query name- Returns:
- the boolean
- Throws:
java.lang.ClassNotFoundException- the class not found exception
-
addClass
public Cl addClass(java.lang.Object[] classInfo)
Add an inner class.
-
addClass
public Cl addClass(Cl cl)
Add an inner class, used when copying inner classes from a placeholder.- Parameters:
cl- the cl- Returns:
- the cl
-
addPlaceholderClass
public Cl addPlaceholderClass(java.lang.String name)
Add a placeholder class.- Specified by:
addPlaceholderClassin classPkCl- Parameters:
name- the name- Returns:
- the cl
-
addMethod
public Md addMethod(MethodInfo methodInfo)
Add a method.- Parameters:
methodInfo- the method info- Returns:
- the md
-
addField
public Fd addField(FieldInfo fieldInfo)
Add a field.- Parameters:
fieldInfo- the field info- Returns:
- the fd
-
resetResolve
public void resetResolve()
Prepare for resolve of a class entry by resetting flags.
-
setupNameListDowns
public void setupNameListDowns()
Set up reverse list of reserved names prior to resolving classes.
-
resolveOptimally
public void resolveOptimally() throws java.lang.ClassNotFoundExceptionResolve a class entry - set obfuscation permissions based on super class and interfaces. Overload method and field names maximally.- Throws:
java.lang.ClassNotFoundException- the class not found exception
-
getMethodOutNameUp
public java.lang.String getMethodOutNameUp(java.lang.String name, java.lang.String descriptor) throws java.lang.ClassNotFoundExceptionGet output method name from list, or null if no mapping exists.- Specified by:
getMethodOutNameUpin interfaceNameListUp- Parameters:
name- the namedescriptor- the descriptor- Returns:
- the method out name up
- Throws:
java.lang.ClassNotFoundException- the class not found exception
-
getMethodObfNameUp
public java.lang.String getMethodObfNameUp(java.lang.String name, java.lang.String descriptor) throws java.lang.ClassNotFoundExceptionGet obfuscated method name from list, or null if no mapping exists.- Specified by:
getMethodObfNameUpin interfaceNameListUp- Parameters:
name- the namedescriptor- the descriptor- Returns:
- the method obf name up
- Throws:
java.lang.ClassNotFoundException- the class not found exception
-
getFieldOutNameUp
public java.lang.String getFieldOutNameUp(java.lang.String name) throws java.lang.ClassNotFoundExceptionGet output field name from list, or null if no mapping exists.- Specified by:
getFieldOutNameUpin interfaceNameListUp- Parameters:
name- the name- Returns:
- the field out name up
- Throws:
java.lang.ClassNotFoundException- the class not found exception
-
getFieldObfNameUp
public java.lang.String getFieldObfNameUp(java.lang.String name) throws java.lang.ClassNotFoundExceptionGet obfuscated field name from list, or null if no mapping exists.- Specified by:
getFieldObfNameUpin interfaceNameListUp- Parameters:
name- the name- Returns:
- the field obf name up
- Throws:
java.lang.ClassNotFoundException- the class not found exception
-
getMethodObfNameDown
public java.lang.String getMethodObfNameDown(Cl caller, java.lang.String name, java.lang.String descriptor) throws java.lang.ClassNotFoundException
Is the method reserved because of its reservation down the class hierarchy?- Specified by:
getMethodObfNameDownin interfaceNameListDown- Parameters:
caller- the callername- the namedescriptor- the descriptor- Returns:
- the method obf name down
- Throws:
java.lang.ClassNotFoundException- the class not found exception
-
getFieldObfNameDown
public java.lang.String getFieldObfNameDown(Cl caller, java.lang.String name) throws java.lang.ClassNotFoundException
Is the field reserved because of its reservation down the class hierarchy?- Specified by:
getFieldObfNameDownin interfaceNameListDown- Parameters:
caller- the callername- the name- Returns:
- the field obf name down
- Throws:
java.lang.ClassNotFoundException- the class not found exception
-
getObfuscationConfig
public ObfuscationConfig getObfuscationConfig()
Gets obfuscation config.- Returns:
- the obfuscation config
-
-