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

Eric Bodden eric.bodden at ec-spride.de
Sat Oct 6 14:03:59 EDT 2012


Could it be that the super class of SQLiteOpenHelper or some interface
that it implements is matched by your exclusion filters?

Eric

On 6 October 2012 13:50, Henddher Pedroza <hpedro2 at uic.edu> wrote:
> Thank you Eric. I double checked and both SQLiteOpenHelper and Activity are
> included in android.jar.
>
> $ jar tvf android.jar
> ...
> 25310 Wed Jul 11 02:08:44 CDT 2012 android/app/Activity.class
> ...
> 2188 Wed Jul 11 02:08:46 CDT 2012
> android/database/sqlite/SQLiteOpenHelper.class
> ...
>
> The issue seems to be more complex that I originally realized:
> Some classes in my jar file make soot complain about hierarchy with either
> one of the 2 classes mentioned.
> IOW, ClassA in jar triggers the NPE at 151 with SQLiteOpenHelper while ClassB
> triggers it with Activity. Others are correctly identified in the hierarchy.
>
> Any suggestion?
> Perhaps the Options I am using are incorrect/incomplete?
> I am using something like this
>
>         Options.v().set_process_dir(Arrays.asList(new String[] { jarFile
> }));
>
>         String[] sootClassPathArray = new String[] {
> "/home/me/android-sdk-linux/platforms/android-16/android.jar",
> "/home/me/android-sdk-linux/add-ons/addon-google_apis-google-16/libs/maps.jar",
>                 jarFile
>         };
>
>         Options.v().set_whole_program(true);
>         Options.v().set_app(true);
>         Options.v().set_exclude(Arrays.asList(new String[] {
>                 "android.",
>                 "dalvik.",
>                 "com.google.android.",
>                 "com.android.",
>                 "org.apache.http.",
>                 "org.json.",
>                 "org.w3c.",
>                 "org.xml.",
>                 "org.xmlpull.",
>                 "junit.",
>         }));
> Options.v().set_soot_classpath(toPath(sootClassPathArray)); // toPath
> inserts ":" path separator as needed
>         Options.v().set_allow_phantom_refs(true); // allow missing classes
> in the hierarchy
>         Scene.v().loadNecessaryClasses();
>
>         hierarchy = Scene.v().getOrMakeFastHierarchy();
>
> ...
>
>
> On 10/06/2012 09:10 AM, Eric Bodden wrote:
>>
>> Hello.
>>
>> Could it be that android.database.sqlite.SQLiteOpenHelper is loaded as
>> a "phantom class" because it is not on your classpath?
>>
>> Eric
>>
>> On 5 October 2012 18:07, Henddher Pedroza <hpedro2 at uic.edu> wrote:
>>>
>>> Hello all,
>>>
>>> I am new to Soot. I am using 2.5.0
>>>
>>> I am trying to use Soot to analyze Android apps. I am using Soot
>>> framework (without phases).
>>>
>>> I am specifying sootClasspath as android.jar and my target jar, allowing
>>> phantom refs, and app mode. I am excluding all classes found in
>>> android.jar.
>>>
>>> I am trying to detect any class which derives from another class. When I
>>> use android.app.Activity as parent, it works ok. But when I use
>>> android.database.sqlite.SQLiteOpenHelper as parent,
>>> FastHierarchy.isSubclass throws NPE (line 151) because parentInterval is
>>> null.
>>>
>>> Any suggestion?
>>>
>>> Thanks in advance
>>>
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>>
>>
>



-- 
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