[Soot-list] [Soot][FlowDroid] Running FlowDroid in whole-program mode (-w)

Arzt, Steven steven.arzt at sit.fraunhofer.de
Thu Mar 1 03:45:44 EST 2018


Hi Umar,

How do you use the FlowDroid API? Do you call constructCallgraph() on SetupApplication? Which options do you set in the InfoflowAndroidConfiguration object? What is the stack trace of the exception? I need your code, not what is in FlowDroid. There are many ways to configure FlowDroid, so it’s hard to tell anything without knowing how you use the API.

Best regards,
  Steven

From: Umar Farooq [mailto:ufaro001 at ucr.edu]
Sent: Thursday, March 1, 2018 1:37 AM
To: Arzt, Steven <steven.arzt at sit.fraunhofer.de>
Cc: soot-list at cs.mcgill.ca
Subject: Re: [Soot-list] [Soot][FlowDroid] Running FlowDroid in whole-program mode (-w)

Hello Steven,

I am using FlowDroid API, The "SetupApplication" class has method "initializeSoot" that is responsible to initialize soot, I have tried to set the flag for whole program but it seems it is not working. Please, see the code below.


private void initializeSoot(boolean constructCallgraph) {

        logger.info("Initializing Soot...");



        final String androidJar = config.getAnalysisFileConfig().getAndroidPlatformDir();

        final String apkFileLocation = config.getAnalysisFileConfig().getTargetAPKFile();



        // Clean up any old Soot instance we may have

        G.reset();



        Options.v().set_no_bodies_for_excluded(true);

        Options.v().set_allow_phantom_refs(true);

        if (config.getWriteOutputFiles())

            Options.v().set_output_format(Options.output_format_jimple);

        else

            Options.v().set_output_format(Options.output_format_none);

        Options.v().set_whole_program(constructCallgraph);

        Options.v().set_process_dir(Collections.singletonList(apkFileLocation));

        if (forceAndroidJar)

            Options.v().set_force_android_jar(androidJar);

        else

            Options.v().set_android_jars(androidJar);

        Options.v().set_src_prec(Options.src_prec_apk_class_jimple);

        Options.v().set_keep_line_number(false);

        Options.v().set_keep_offset(false);

        Options.v().set_throw_analysis(Options.throw_analysis_dalvik);

        Options.v().set_process_multiple_dex(config.getMergeDexFiles());

        Options.v().set_whole_program(true);

        System.out.println("Soot Initialization called");

Thanks,
Umar

On Wed, Feb 28, 2018 at 11:58 AM, Umar Farooq <ufaro001 at ucr.edu<mailto:ufaro001 at ucr.edu>> wrote:
Hello Steven,

I am using FlowDroid API, The "SetupApplication" class has method "initializeSoot" that is responsible to initialize soot, I have tried to set the flag for whole program but it seems it is not working. Please, see my code in attachment.

Thanks,
Umar

On Wed, Feb 28, 2018 at 1:48 AM, Arzt, Steven <steven.arzt at sit.fraunhofer.de<mailto:steven.arzt at sit.fraunhofer.de>> wrote:
Hi Umar,

How do you attempt to run FlowDroid? Do you use the FlowDroid API or the command-line program? Please show your command line or your code with which you invoke FlowDroid.

Best regards,
  Steven

From: Soot-list [mailto:soot-list-bounces at cs.mcgill.ca<mailto:soot-list-bounces at cs.mcgill.ca>] On Behalf Of Umar Farooq
Sent: Wednesday, February 28, 2018 2:33 AM
To: soot-list at cs.mcgill.ca<mailto:soot-list at cs.mcgill.ca>
Subject: [Soot-list] [Soot][FlowDroid] Running FlowDroid in whole-program mode (-w)

Hi All,

I want to run FlowDroid in whole program mode, I have tried to call "soot.options.Options.v().set_whole_program(true);" it can work for soot but not for FlowDroid. I need to load all the bodies level classes but I am getting this message.

"The data flow analysis has failed. Error message: This operation requires resolving level BODIES but android.support.v7.app.AppCompatActivity is at resolving level SIGNATURES
If you are extending Soot, try to add the following call before calling soot.Main.main(..):
Scene.v().addBasicClass(android.support.v7.app.AppCompatActivity,BODIES);
Otherwise, try whole-program mode (-w)."


Thanks,
Umar


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20180301/96d3c5de/attachment-0001.html>


More information about the Soot-list mailing list