Package soot.jimple.infoflow.util
Class SystemClassHandler
java.lang.Object
soot.jimple.infoflow.util.SystemClassHandler
Utility class for checking whether methods belong to system classes
- Author:
- Steven Arzt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisClassInSystemPackage(String className) Checks whether the given class name belongs to a system packagebooleanisClassInSystemPackage(soot.SootClass clazz) Checks whether the given class belongs to a system packagebooleanisClassInSystemPackage(soot.Type type) Checks whether the type belongs to a system packagebooleanisStubImplementation(soot.Body body) Checks whether the given method body is a stub implementation and can safely be overwrittenbooleanisTaintVisible(AccessPath taintedPath, soot.SootMethod method) If the base object is tainted and in a system class, but we reference some field in an application object derived from the system class, no tainting happens.voidsetExcludeSystemComponents(boolean excludeSystemComponents) Sets whether components in system or framework-related packages shall be excluded from the analysisstatic voidsetInstance(SystemClassHandler instance) Overwrites the global system class handler instancestatic SystemClassHandlerv()Gets the global system class handler instance
-
Constructor Details
-
SystemClassHandler
public SystemClassHandler()
-
-
Method Details
-
v
Gets the global system class handler instance- Returns:
- The global system class handler instance
-
setInstance
Overwrites the global system class handler instance- Parameters:
instance- The new the global system class handler instance
-
isClassInSystemPackage
public boolean isClassInSystemPackage(soot.SootClass clazz) Checks whether the given class belongs to a system package- Parameters:
clazz- The class to check- Returns:
- True if the given class belongs to a system package, otherwise false
-
isClassInSystemPackage
Checks whether the given class name belongs to a system package- Parameters:
className- The class name to check- Returns:
- True if the given class name belongs to a system package, otherwise false
-
isClassInSystemPackage
public boolean isClassInSystemPackage(soot.Type type) Checks whether the type belongs to a system package- Parameters:
type- The type to check- Returns:
- True if the given type belongs to a system package, otherwise false
-
isTaintVisible
If the base object is tainted and in a system class, but we reference some field in an application object derived from the system class, no tainting happens. The system class cannot access or know about user-code fields. This leaves reflection aside, but we don't support reflection anyway.- Parameters:
taintedPath- The access path of the incoming taintmethod- The method that gets called- Returns:
- True if the given taint is visible to the callee, otherwise false
-
setExcludeSystemComponents
public void setExcludeSystemComponents(boolean excludeSystemComponents) Sets whether components in system or framework-related packages shall be excluded from the analysis- Parameters:
excludeSystemComponents- True to exclude components in system packages from the analysis, false otherwise
-
isStubImplementation
public boolean isStubImplementation(soot.Body body) Checks whether the given method body is a stub implementation and can safely be overwritten- Parameters:
body- The body to check- Returns:
- True if the given method body is a stub implementation, otherwise false
-