Class InfoflowResultsSerializer

java.lang.Object
soot.jimple.infoflow.results.xml.InfoflowResultsSerializer

public class InfoflowResultsSerializer extends Object
Class for serializing FlowDroid results to XML
Author:
Steven Arzt
  • Field Details

    • FILE_FORMAT_VERSION

      public static final int FILE_FORMAT_VERSION
      See Also:
    • serializeTaintPath

      protected boolean serializeTaintPath
    • icfg

      protected IInfoflowCFG icfg
    • config

      protected InfoflowConfiguration config
    • startTime

      protected long startTime
  • Constructor Details

    • InfoflowResultsSerializer

      public InfoflowResultsSerializer(InfoflowConfiguration config)
      Creates a new instance of the InfoflowResultsSerializer class
      Parameters:
      config - The configuration of the data flow
    • InfoflowResultsSerializer

      public InfoflowResultsSerializer(IInfoflowCFG cfg, InfoflowConfiguration config)
      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 statements
      config - 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 serialize
      fileName - The target file name
      Throws:
      XMLStreamException - Thrown if the XML data cannot be written
      IOException - 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 out
      writer - 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 out
      writer - 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 out
      writer - 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 out
      writer - 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