Package soot.jimple.infoflow.results.xml
Class InfoflowResultsSerializer
java.lang.Object
soot.jimple.infoflow.results.xml.InfoflowResultsSerializer
Class for serializing FlowDroid results to XML
- Author:
- Steven Arzt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InfoflowConfigurationstatic final intprotected IInfoflowCFGprotected booleanprotected long -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the InfoflowResultsSerializer classInfoflowResultsSerializer(IInfoflowCFG cfg, InfoflowConfiguration config) Creates a new instance of the InfoflowResultsSerializer class -
Method Summary
Modifier and TypeMethodDescriptionvoidserialize(InfoflowResults results, String fileName) Serializes the given FlowDroid result object into the given filevoidsetSerializeTaintPath(boolean serialize) Sets whether the taint propagation path shall be serialized along with the respective data flow resultprotected voidwriteAccessPath(AccessPath accessPath, XMLStreamWriter writer) Writes the given access path into the given XML stream writerprotected voidwriteAdditionalSinkInfo(ResultSinkInfo sink, XMLStreamWriter writer) Derived classes can override this method to write out additional information about a data flow sinkprotected voidwriteAdditionalSourceInfo(ResultSourceInfo source, XMLStreamWriter writer) Derived classes can override this method to write out additional information about a data flow sourceprotected voidwriteDataFlows(InfoflowResults results, XMLStreamWriter writer) Writes the given data flow results into the given XML stream writer
-
Field Details
-
FILE_FORMAT_VERSION
public static final int FILE_FORMAT_VERSION- See Also:
-
serializeTaintPath
protected boolean serializeTaintPath -
icfg
-
config
-
startTime
protected long startTime
-
-
Constructor Details
-
InfoflowResultsSerializer
Creates a new instance of the InfoflowResultsSerializer class- Parameters:
config- The configuration of the data flow
-
InfoflowResultsSerializer
Creates a new instance of the InfoflowResultsSerializer class- Parameters:
cfg- The control flow graph to be used for obtaining additional information such as the methods containing source or sink statementsconfig- The configuration of the data flow
-
-
Method Details
-
serialize
public void serialize(InfoflowResults results, String fileName) throws XMLStreamException, IOException Serializes the given FlowDroid result object into the given file- Parameters:
results- The result object to serializefileName- The target file name- Throws:
XMLStreamException- Thrown if the XML data cannot be writtenIOException- Thrown if the target file could not be written
-
writeDataFlows
protected void writeDataFlows(InfoflowResults results, XMLStreamWriter writer) throws XMLStreamException Writes the given data flow results into the given XML stream writer- Parameters:
results- The results to write outwriter- The stream writer into which to write the results- Throws:
XMLStreamException- Thrown if the XML data cannot be written
-
writeAdditionalSourceInfo
protected void writeAdditionalSourceInfo(ResultSourceInfo source, XMLStreamWriter writer) throws XMLStreamException Derived classes can override this method to write out additional information about a data flow source- Parameters:
source- The source information to write outwriter- The stream writer into which to write the results- Throws:
XMLStreamException- Thrown if the XML data cannot be written
-
writeAdditionalSinkInfo
protected void writeAdditionalSinkInfo(ResultSinkInfo sink, XMLStreamWriter writer) throws XMLStreamException Derived classes can override this method to write out additional information about a data flow sink- Parameters:
sink- The sink information to write outwriter- The stream writer into which to write the results- Throws:
XMLStreamException- Thrown if the XML data cannot be written
-
writeAccessPath
protected void writeAccessPath(AccessPath accessPath, XMLStreamWriter writer) throws XMLStreamException Writes the given access path into the given XML stream writer- Parameters:
accessPath- The access path to write outwriter- The stream writer into which to write the data- Throws:
XMLStreamException- Thrown if the XML data cannot be written
-
setSerializeTaintPath
public void setSerializeTaintPath(boolean serialize) Sets whether the taint propagation path shall be serialized along with the respective data flow result- Parameters:
serialize- True if taint propagation paths shall be serialized, otherwise false
-