[Soot-list] Excluding support classes in an APK file

Arzt, Steven steven.arzt at sit.fraunhofer.de
Mon Apr 24 14:25:16 EDT 2017


Hi Mian,

Which version of Soot do you use? Does this happen with the current nightly build?

You can try to set a breakpoint in Scene.isExcluded() to see why your classes are not excluded. This method is called whenever a class is loaded. I hope this sheds some light on the problem. We definitely do use the exclusion feature in various projects and it seems to work there.

Best regards,
  Steven

-----Original Message-----
From: Mian Wan [mailto:mianwan at usc.edu] 
Sent: Monday, April 24, 2017 8:14 PM
To: Arzt, Steven <steven.arzt at sit.fraunhofer.de>
Cc: soot-list at cs.mcgill.ca
Subject: Re: [Soot-list] Excluding support classes in an APK file

Hi Steven,

I tried your solution, the number of application class didn’t change. I used the following code to record the number of application classes.

Scene scene = Scene.v();
int numClasses = 0;
// first, create an empty set for each class/interface for (SootClass c : scene.getClasses()) {
    numClasses++;
    if (c.isApplicationClass()) {
        appClasses.add(c);
    }
}
System.out.println(“ All classes: " + numClasses); System.out.println(" App: " + appClasses.size());

I tried "-x", “android.*” and "-x", “android.support.v4.app.*”.  Neither of them works.

Thanks for your help,

Mian

> On Apr 24, 2017, at 4:25 AM, Arzt, Steven <steven.arzt at sit.fraunhofer.de> wrote:
> 
> Hi Mian,
> 
> You need an asterisk in the end, i.e., "-x", "android.*".
> 
> Best regards,
>  Steven
> 
> -----Original Message-----
> From: Soot-list [mailto:soot-list-bounces at cs.mcgill.ca] On Behalf Of 
> Mian Wan
> Sent: Sunday, April 23, 2017 11:44 AM
> To: soot-list at cs.mcgill.ca
> Subject: [Soot-list] Excluding support classes in an APK file
> 
> Hi, all.
> 
> As we know, Soot will treat all classes in an APK file as application classes. I tried to use the -x excluding option to make those classes, like “android.support.*” and “com.google.*”,  as library classes. 
> 
> I tried the following options, but the excluding option doesn’t work. The application class number is still 5000+.
> 
> String[] sootArgs = {
>        "-w",
>        "-f", "n", // no output
>        "-keep-line-number",
>        "-allow-phantom-refs",
>        "-process-dir", Configs.apk,
>        "-src-prec", "apk",
>        "-android-jars", Configs.androidJar,
>        "-x", "android.",
>        "-x", "com.google."  
> };
> 
> I tried the option in both the command line and the Options.v().set_exclude() API. Is there any way I can minimize the application class number for my analysis?
> 
> Thanks,
> 
> Mian
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mailman.CS.McGill
> .CA_mailman_listinfo_soot-2Dlist&d=DwIGaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=o4jEba-USrGfT74PzOfgZg&m=b4pDWU34p3zgSz_sWWCbzVaIUYE7YRSsRdtvk9OqCCs&s=YTgNIPva5KQoeLWll-vDLcpQWrw8Ub9K3InvSM8uMh0&e=



More information about the Soot-list mailing list