[Soot-list] Basic question

Henddher Pedroza hpedro2 at uic.edu
Sun Oct 14 12:36:20 EDT 2012


Thank you Eric!

I will try that.

Yesterday, I tried this successfully though it would be tedious to 
specify all classes found in the android.jar (and extensions).

//        Options.v().set_whole_program(true);
//        Options.v().set_app(true);
         Options.v().set_soot_classpath(sootAnalyzer.toPath(DIRS));
//        Scene.v().loadBasicClasses();
         Scene.v().addBasicClass("android.util.Log", SootClass.BODIES);
         Scene.v().loadNecessaryClasses();

         try {
             Chain<SootClass> classes = Scene.v().getClasses();
             for (SootClass sc : classes) {
                 System.out.println(sc);
             }
         }
         catch (Exception e) {
             e.printStackTrace();
             fail();
         }

         try {
             Scene.v().getMethod(METHOD_android_util_Log_e);
         }
         catch (Exception e) {
             e.printStackTrace();
             fail();
         }


On 10/14/2012 03:55 AM, Eric Bodden wrote:
> Hello.
>
> Setting an explicit classpath in Soot is really easy. Just provide it
> after the -cp flag and do NOT use the -pp option. In this case Soot
> will be looking on the provided classpath only, which means that it
> has to be complete. As an alternative you can also call
> Options.v().set_soot_classpath(...). I don't think you would be
> needing anything else.
>
> Eric
>
> On 13 October 2012 18:46, Henddher Pedroza <hpedro2 at uic.edu> wrote:
>> Thank you again Eric!
>>
>> (apologies ahead of time for the long posting)
>>
>> In my case, "myandroidapp.jar" only contains the classes defined in my app -
>> nothing else. None of the android classes are included in my jar. Imagine I
>> was modifying android-maven-plugin with an intermediate Soot step right
>> after myandroidapp.jar is built but right before Dex is executed.
>>
>> During the discussion of the issue I'm experiencing (the FastHierarchy
>> issue), you suggested to use prepend option  (-pp) and avoid setting
>> soot-class-path. However, given that my setup uses Maven, using -pp would
>> not be straight forward. That point you brought up made wonder if my Soot
>> configuration is flat out wrong ?! ...
>> Therefore, I am trying to understand what the correct way is to use an
>> alternative java classes (android.jar) instead of standard JDK classes
>> (rt.jar et al). I would imagine that such configuration would instruct Soot
>> to resolve all classes in the given classpath just like it does with rt.jar
>> and the others. I would also imagine that such configuration would do the
>> same trick for "j2me" (though I haven't looked at the code to see how j2me
>> option affects the soot configuration).
>> Hence, I am trying to understand the fundamentals of soot-classpath,
>> process-dir, include and exclude options (via Options.v()) expecting that
>> this will allow me to utilize all the classes found in android.jar and other
>> classes available in Android.
>>
>> Is my expectation correct about specifying alternative classpath for Soot
>> 2.5.0?
>> If so, would you suggest some reading, tutorial, documentation or alike that
>> explains the details?
>>
>> I don't want to jump to the latest source-code but stick to an officially
>> release version or Soot.
>>
>> Again, thank you very much for all the help :)
>>
>> (I should be able to move forward if I see more details/examples)
>>
>>
>> On 10/13/2012 11:03 AM, Eric Bodden wrote:
>>> Hello.
>>>
>>> If you converted your apk to a jar then it should be included just
>>> like any other jar file. The android support in Soot is for analyzing
>>> apk files directly. (but to do this you need a plugin called dexpler,
>>> which we have yet to release)
>>>
>>> Eric
>>>
>>> On 13 October 2012 00:54, Henddher Pedroza <hpedro2 at uic.edu> wrote:
>>>> Hello all,
>>>>
>>>> I am using Soot 2.5.0
>>>>
>>>> I am trying to do analysis of Android apps (technically .jar before
>>>> kicking dex).
>>>>
>>>> Can someone explain how to configure soot (soot-classpath, include,
>>>> exclude, process-dir, phantoms, etc, etc.) to load classes in
>>>> myandroidapp.jar?
>>>> I suppose that I will need to specify the path to "android.jar" and any
>>>> other .jar the myandroidapp.jar refers to (i.e. maps.jar, etc).
>>>>
>>>> Thanks in advance.
>>>>
>>>> - Henddher
>>>> _______________________________________________
>>>> 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