[Soot-list] Help with FastHierarchy.isSubclass(SootClass child, SootClass parent)

Eric Bodden eric.bodden at ec-spride.de
Wed Oct 10 04:04:23 EDT 2012


Hello.

I think the problem is that you are explicitly setting Soot's
classpath. This overrides the default classpath, which contains the
correct android.jar. You can add the -pp option to have your classpath
prepended to that default classpath instead. (see online doc)

Eric

On 9 October 2012 15:56, Henddher Pedroza <hpedro2 at uic.edu> wrote:
> Thanks again Eric, but I am confused:
>
> I have a jar file containing all classes I want to analyze. This jar
> contains an Android app so all classes not present in the jar are assumed to
> be part of the target platform; therefore, all these other classes should be
> available in "android.jar" part of Android SDK.
>
> My code looks like this:
>
> Options.v().set_process_dir(Arrays.asList(new String[] { "myAndroidApp.jar"
> })); // (1)
> Options.v().set_soot_classpath("./android.jar:./myAndroidApp.jar"); // (2)
> Options.v().set_exclude(Arrays.asList(new String[] { "android." })); // (3)
>
> The intention is to perform analysis in all classes found in
> myAndroidApp.jar, such classes will have references to classes in
> "android.jar" but none of the classes in "android.jar" will be analyzed -
> And I expect all classes in "android.jar" to be fully loaded by Soot but not
> analyzed.
>
> Am I using the settings incorrectly?
>
> I tried removing (3) and it made no difference; Soot still threw NPE at 151.
>
> - Henddher
>
>
> On 10/06/2012 02:50 PM, Eric Bodden wrote:
>>>
>>> I thought excluding classes would just instruct Soot to skip analysis of
>>> them.
>>
>> No, soot won't load that class.
>>
>>> In my case, anything that starts with "android." would not be analyzed
>>> but any included class (all in my jar because of "set_process_dir") that
>>> uses excluded classes would still be analyzed. Right?
>>
>> That sounds right.
>>
>>> I can see that only the classes in my jar are being analyzed (I loop
>>> through
>>> Scene.v().getApplicationClasses())
>>> Am I not using exclude/include correctly?
>>
>> Well it really depends on your use case, what "correct" really means.
>>
>>> On the other hand, if exclusion was indeed the issue, why would some
>>> classes
>>> in my jar trigger the NPE and not all of them
>>
>> Because for some classes the super class is excluded (and thus null)
>>
>> but not for others.
>>
>> Eric
>
>



-- 
Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list