FlowDroid icon indicating copy to clipboard operation
FlowDroid copied to clipboard

How to use XML files as configuration?

Open zjbthomas opened this issue 5 years ago • 2 comments

I notice FlowDroid now allows to use XML files as configuration. Is there an example on how to do it? Thanks!

zjbthomas avatar May 20 '20 23:05 zjbthomas

Have a look at the directory soot-infoflow-android\testXmlParser, there are a few XML files you can use as examples. The new format is much more expressive. You can, e.g., denote individual parameters as sinks, or only trigger a leak if a given access path reaches a given parameter. Same for sources, you can only taint specific access paths if you want.

StevenArzt avatar May 21 '20 21:05 StevenArzt

Here is an example of a config file:

<?xml version="1.0"?>
<configuration>
    <inputFiles>
        <targetAPK>/inputApk/</targetAPK>
       <sourceSinkFile>/sourceSinks.txt</sourceSinkFile>
        <androidPlatform>/platforms</androidPlatform>
        <outputFile>/outAnalysis</outputFile>
    </inputFiles>
    <androidConfiguration>
            <enableCallbacks>true</enableCallbacks>    
            <layoutMatchingMode>NoMatch</layoutMatchingMode>
            <mergeDexFiles>true</mergeDexFiles>
            <callbackSourceMode>SourceListOnly</callbackSourceMode>
            <callbackAnalysisTimeout>300</callbackAnalysisTimeout>
    </androidConfiguration>

    <iccConfiguration>
        <purifyResults>true</purifyResults>
    </iccConfiguration>

    <dataFlowConfiguration>
        <implicitFlowMode>NoImplicitFlows</implicitFlowMode>
        <enableStaticFields>false</enableStaticFields>
        <enableExceptions>false</enableExceptions>
        <flowSensitiveAliasing>false</flowSensitiveAliasing>
        <logSourcesAndSinks>false</logSourcesAndSinks>
        <pathReconstructionMode>Fast</pathReconstructionMode>
        <maxPathLength>1</maxPathLength>
        <enableReflection >true </enableReflection>
        <dataFlowTimeout>300</dataFlowTimeout>
        <pathReconstructionTimeout>300</pathReconstructionTimeout>
    </dataFlowConfiguration>
</configuration>

And for running the tool with a configuration file:

java -jar soot-infoflow-cmd-jar-with-dependencies.jar -c conf_file_path

where conf_file_path is the path for your conf file.

DRMALEK avatar Feb 16 '21 11:02 DRMALEK