[Soot-list] Basic question
Henddher Pedroza
hpedro2 at uic.edu
Mon Oct 15 10:48:36 EDT 2012
Hello Eric.
I figured out what was the issue:
FastHierarchy.isSubclass throws exception when parent is an interface.
In my configuration, I check hierarchy of all classes in
myandroidapp.jar. I just added a check in my code to avoid checking
hierarchy of application-classes that are interfaces - which is
explicitly noted in the javadocs.
Originally, I was using getSubclassesOf() but it didn't resolve cases
like this:
A <- B <- C (A is superclass of B; B is superclass of C)
fastHierarchy.getSubclassesOf(A); // returned only B but not C.
(which I am still curious about)
Hence, I switched to isSubclassOf but failed to realize the interface
limitation listed in javadoc.
Once again, thanks a lot.
- Henddher
On 10/14/2012 11:17 PM, Eric Bodden wrote:
> Ok, can you wrap this up for me into a test case and email it to me? I
> will take a look as soon as I get the chance. Please include all the
> command line options you use.
>
> Eric
>
>
> On 15 October 2012 01:05, Henddher Pedroza <hpedro2 at uic.edu> wrote:
>> Hello Eric
>>
>> The example I cited used addBasicClass(). And yes, I thought of applying
>> brute force and adding each class in "android.jar" to the list of soot
>> classes before calling loadNecessaryClasses().
>>
>> But it turned out that this "brute force" approach is equivalent to setting
>> soot-classpath containing "android.jar" and "myandroidapp.jar".
>>
>> Here is my resulting configuration:
>>
>> Options.v().set_soot_classpath("android.jar:myandroidapp.jar");
>> Options.v().set_process_dir(Arrays.asList("myandroidapp.jar"));
>> Scene.v().loadNecessaryClasses();
>>
>> And, unfortunately, it exposes the FastHierarchy.isSubclass() issue I first
>> reported. So I guess we can now rule out soot-classpath being incorrect.
>>
>> So I am back to square one.
>>
>> java.lang.NullPointerException
>> at soot.FastHierarchy$Interval.isSubrange(FastHierarchy.java:83)
>> at soot.FastHierarchy.isSubclass(FastHierarchy.java:151)
>> at edu.uic.cs.hpedro2.MiscTest.test_sootclasspath2(MiscTest.java:202)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at junit.framework.TestCase.runTest(TestCase.java:154)
>> at junit.framework.TestCase.runBare(TestCase.java:127)
>>
>> (I'll reply to my 1st post to stay in topic)
>>
>>
>> On 10/14/2012 03:59 PM, Eric Bodden wrote:
>>> Hello.
>>>
>>>> Yesterday, I tried this successfully though it would be tedious to
>>>> specify
>>>> all classes found in the android.jar (and extensions).
>>> What do you mean by "specifying all classes"? That's not the idea...
>>>
>>> Eric
>>
>
>
More information about the Soot-list
mailing list