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

Henddher Pedroza hpedro2 at uic.edu
Sat Oct 6 14:14:14 EDT 2012


Hmmm... I don't know ...

The package of SQLiteOpenHelper is "android.database.sqlite" which would 
be excluded by "android."

I thought excluding classes would just instruct Soot to skip analysis of 
them. 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?
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?

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?

Thanks

On 10/06/2012 01:03 PM, Eric Bodden wrote:
> 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
>>>
>>>
>
>



More information about the Soot-list mailing list