[Soot-list] Issues with Android Instrumentation Tutorial

kuza55 kuza55 at gmail.com
Tue May 17 16:02:06 EDT 2016


Well, I worked this out in the end.

When using -cp, it seems to override the -android-jars parameter, so I
need to provide the specific android jar on the class path.
This seems like a bug.

When I use setSootClassPath, it seems to also remove the apk from the classpath.

It would be nice if there was an API that added to the classpath
without messing with the other options.

In the end I set -cp
"C:\\Users\\Alex\\Development\\analyzer\\lib\\android-platforms\\android-17\\android.jar;C:\\Program
Files\\Java\\jdk1.8.0_91\\jre\\lib\\rt.jar" and it didn't complain.

On 17 May 2016 at 09:40, kuza55 <kuza55 at gmail.com> wrote:
> Hi,
>
> I'm trying to get the android instrumentation tutorial working:
> https://github.com/Sable/soot/wiki/Instrumenting-Android-Apps-with-Soot
>
> I'm using nightly builds I download yesterday.
>
> The first thing that happens when I try to run that example is that I
> get an error about loading java.lang.Object, so I've followed the
> advice to try and added rt.jar to the soot class path, which seems to
> resolve that error, however I have not been able to fix the subsequent
> errors, and I'm not sure if those errors are related to how I resolved
> the java.lang.Object loading error.
>
> If I add this to the AndroidInstrument.java file:
>
> Scene.v().setSootClassPath("C:\\Program Files\\Java\\jdk1.8.0_31\\jre\\lib\\");
>
> Then I get errors loading class files on every apk I try and I'm
> pretty confident they're in there since apktool finds them:
>
> soot.SootResolver$SootClassNotFoundException: couldn't find class:
> com.cps.service.Tools.ExecuteAsRoot (is your soot-class-path set
> properly?)
> at soot.SootResolver.bringToHierarchy(SootResolver.java:228)
> at soot.SootResolver.bringToSignatures(SootResolver.java:266)
> at soot.SootResolver.processResolveWorklist(SootResolver.java:170)
> at soot.SootResolver.resolveClass(SootResolver.java:131)
> at soot.Scene.loadClass(Scene.java:725)
> at soot.Scene.loadClassAndSupport(Scene.java:710)
> at soot.Scene.loadNecessaryClasses(Scene.java:1448)
> at soot.Main.run(Main.java:243)
> at soot.Main.main(Main.java:147)
> at com.blah.analyzer.AndroidInstrument.main(AndroidInstrument.java:98)
> at com.blah.analyzer.AndroidInstrument.instrument(AndroidInstrument.java:35)
> at com.blah.analyzer.App.main(App.java:32)
>
> If I try to set a -cp parameter, I get
>
> soot.SootResolver$SootClassNotFoundException: couldn't find class:
> android.app.Activity (is your soot-class-path set properly?)
>
> If I try to use -pp I get an odd error that seems to indicate the docs
> are wrong about what -pp does:
>
> soot.SootResolver$SootClassNotFoundException: couldn't find class:
> C:\Program Files\Java\jdk1.8.0_31\jre\lib\ (is your soot-class-path
> set properly?)
>
> I'd appreciate any assistance in figuring out what I need to do to get
> that example working.
>
>  - Alex


More information about the Soot-list mailing list