Skip to content

FlowdroidUtils

Jordan Samhi edited this page Aug 22, 2023 · 2 revisions

FlowdroidUtils 🧰

The FlowdroidUtils class is part of the AndroSpecter library and serves as a utility class for initializing and running Flowdroid analyses on Android apps.

Class Definition

Constructors

The class offers one constructor:

  1. public FlowdroidUtils(String apkPath): Constructs a new FlowdroidUtils object with the given APK path.

Methods

  • public SetupApplication initializeFlowdroid(String platformPath, IInfoflowConfig config, String CallGraphAlgo): Initializes a Flowdroid analysis on an Android app using the provided parameters, returning the SetupApplication object representing the analysis.
  • public Set<String> runTaintAnalysis(Set<AndroidMethod> sources, Set<AndroidMethod> sinks): Runs the taint analysis on the provided set of sources and sinks, returning a set of strings, each describing a path from a source to a sink.
  • public String getPackageName(): Returns the package name of the Android application, or null if the Manifest file could not be processed.

Usage

Here is an example of how to use the FlowdroidUtils class to initialize and run taint analysis:

FlowdroidUtils flowdroid = new FlowdroidUtils("path/to/app.apk");
SetupApplication sa = flowdroid.initializeFlowdroid("path/to/platform", null, "SPARK");
Set<String> results = flowdroid.runTaintAnalysis(sources, sinks);

for(String result : results) {
    System.out.println(result);
}