Class SystemClassHandler

java.lang.Object
soot.jimple.infoflow.util.SystemClassHandler

public class SystemClassHandler extends Object
Utility class for checking whether methods belong to system classes
Author:
Steven Arzt
  • Constructor Details

    • SystemClassHandler

      public SystemClassHandler()
  • Method Details

    • v

      public static SystemClassHandler v()
      Gets the global system class handler instance
      Returns:
      The global system class handler instance
    • setInstance

      public static void setInstance(SystemClassHandler instance)
      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

      public boolean isClassInSystemPackage(String className)
      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

      public boolean isTaintVisible(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. 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 taint
      method - 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