Class AXmlHandler
java.lang.Object
soot.jimple.infoflow.android.axml.AXmlHandler
AXmlHandler provides functionality to parse a byte compressed android
xml file and access all nodes.- Author:
- Stefan Haas, Mario Schlipf
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final IBinaryXMLFileParserThe parser used for actually reading out the binary XML fileprotected byte[]Contains the byte compressed xml which was parsed by thisAXmlHandler. -
Constructor Summary
ConstructorsConstructorDescriptionAXmlHandler(InputStream aXmlIs) Creates a newAXmlHandlerwhich parses theInputStream.AXmlHandler(InputStream aXmlIs, IBinaryXMLFileParser parser) Creates a newAXmlHandlerwhich parses theInputStream. -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetAttributeResourceId(String name) Returns the Android resource Id of the attribute which has the given name.Returns the Android xml document.getNodesWithTag(String tag) Returns a list containing all nodes of the xml document which have the given tag.byte[]Returns the xml document as a compressed android xml byte array.toString()protected StringReturns a textual representation of the given node and it's data.
-
Field Details
-
ANDROID_NAMESPACE
- See Also:
-
xml
protected byte[] xmlContains the byte compressed xml which was parsed by thisAXmlHandler. -
parser
The parser used for actually reading out the binary XML file
-
-
Constructor Details
-
AXmlHandler
Creates a newAXmlHandlerwhich parses theInputStream.- Parameters:
aXmlIs- InputStream reading a byte compressed android xml file- Throws:
IOException- if an I/O error occurs.
-
AXmlHandler
Creates a newAXmlHandlerwhich parses theInputStream.- Parameters:
aXmlIs- InputStream reading a byte compressed android xml fileparser- The parser implementation to be used- Throws:
IOException- if an I/O error occurs.
-
-
Method Details
-
getDocument
Returns the Android xml document.- Returns:
- the Android xml document
-
getNodesWithTag
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
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
-
toString
Returns a textual representation of the given node and it's data.- Parameters:
node- current node which will be printeddepth- for the padding (indent)- Returns:
- String representation of the given node, it's attributes and children
-