Class AXmlHandler

java.lang.Object
soot.jimple.infoflow.android.axml.AXmlHandler

public class AXmlHandler extends Object
AXmlHandler provides functionality to parse a byte compressed android xml file and access all nodes.
Author:
Stefan Haas, Mario Schlipf
  • Field Details

    • ANDROID_NAMESPACE

      public static final String ANDROID_NAMESPACE
      See Also:
    • xml

      protected byte[] xml
      Contains the byte compressed xml which was parsed by this AXmlHandler.
    • parser

      protected final IBinaryXMLFileParser parser
      The parser used for actually reading out the binary XML file
  • Constructor Details

  • Method Details

    • getDocument

      public AXmlDocument getDocument()
      Returns the Android xml document.
      Returns:
      the Android xml document
    • getNodesWithTag

      public List<AXmlNode> getNodesWithTag(String tag)
      Returns a list containing all nodes of the xml document which have the given tag.
      Parameters:
      tag - the tag being search for
      Returns:
      list pointing on all nodes which have the given tag.
    • toByteArray

      public byte[] toByteArray()
      Returns the xml document as a compressed android xml byte array. This will consider all changes made to the root node and it's children.
      Returns:
      android byte compressed xml
    • getAttributeResourceId

      public static int getAttributeResourceId(String name)
      Returns the Android resource Id of the attribute which has the given name. See the android.R.attr class
      Parameters:
      name - the attribute's name.
      Returns:
      the resource Id defined by Android or -1 if the attribute does not exist.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      protected String toString(AXmlNode node, int depth)
      Returns a textual representation of the given node and it's data.
      Parameters:
      node - current node which will be printed
      depth - for the padding (indent)
      Returns:
      String representation of the given node, it's attributes and children