Class LayoutFileParser

java.lang.Object
soot.jimple.infoflow.android.resources.AbstractResourceParser
soot.jimple.infoflow.android.resources.LayoutFileParser

public class LayoutFileParser extends AbstractResourceParser
Parser for analyzing the layout XML files inside an android application
Author:
Steven Arzt
  • Field Details

    • userControls

      protected final soot.util.MultiMap<String,AndroidLayoutControl> userControls
    • callbackMethods

      protected final soot.util.MultiMap<String,String> callbackMethods
    • includeDependencies

      protected final soot.util.MultiMap<String,String> includeDependencies
    • fragments

      protected final soot.util.MultiMap<String,soot.SootClass> fragments
    • packageName

      protected final String packageName
    • resParser

      protected final ARSCFileParser resParser
    • scViewGroup

      protected soot.SootClass scViewGroup
    • scView

      protected soot.SootClass scView
    • scWebView

      protected soot.SootClass scWebView
  • Constructor Details

  • Method Details

    • parseLayoutFile

      public void parseLayoutFile(File apkFile)
      Parses all layout XML files in the given APK file and loads the IDs of the user controls in it. This method only registers a Soot phase that is run when the Soot packs are next run
      Parameters:
      apkFile - The APK file in which to look for user controls
    • parseLayoutFileDirect

      public void parseLayoutFileDirect(File apkFile)
      Parses all layout XML files in the given APK file and loads the IDs of the user controls in it. This method directly executes the analyses witout registering any Soot phases.
      Parameters:
      apkFile - The APK file in which to look for user controls
    • parseLayoutNode

      protected void parseLayoutNode(String layoutFile, AXmlNode rootNode)
      Parses the layout file with the given root node
      Parameters:
      layoutFile - The full path and file name of the file being parsed
      rootNode - The root node from where to start parsing
    • getUserControlsByID

      public Map<Integer,AndroidLayoutControl> getUserControlsByID()
      Gets the user controls found in the layout XML file. The result is a mapping from the id to the respective layout control.
      Returns:
      The layout controls found in the XML file.
    • getUserControls

      public soot.util.MultiMap<String,AndroidLayoutControl> getUserControls()
      Gets the user controls found in the layout XML file. The result is a mapping from the file name in which the control was found to the respective layout control.
      Returns:
      The layout controls found in the XML file.
    • getCallbackMethods

      public soot.util.MultiMap<String,String> getCallbackMethods()
      Gets the callback methods found in the layout XML file. The result is a mapping from the file name to the set of found callback methods.
      Returns:
      The callback methods found in the XML file.
    • getFragments

      public soot.util.MultiMap<String,soot.SootClass> getFragments()
      Gets the fragments found in the layout XML file. The result is a mapping from the activity class to the set of found fragments ids.
      Returns:
      The fragments found in the XML file.
    • getLoadOnlySensitiveControls

      public boolean getLoadOnlySensitiveControls()
      Gets whether this analysis shall only collect sensitive controls such as password fields
      Returns:
      True if this analysis shall only collect sensitive controls, otherwise false
    • setControlFactory

      public void setControlFactory(LayoutControlFactory controlFactory)
      Sets the layout control factory to use for creating new layout controls
      Parameters:
      controlFactory - The layout control factory