[Soot-list] FlowDroid exception encountered using Eclipse-generated soot.jar

Roy Liu royliudev at gmail.com
Thu Oct 9 03:23:58 EDT 2014


Hi Eric,

Actually I just followed all the build instruction given on FlowDroid's
wiki page
(https://github.com/secure-software-engineering/soot-infoflow-android/wiki)
on its "Building FlowDroid From Source" section.
That is, I downloaded all the 5 source projects from github,
and then imported all respective projects into Eclipse,
before finally export them into JAR files.

So, I simply use all the default Eclipse settings of the downloaded source
projects.
As for soot's  Eclipse project, its Java-Build-Path settings are as follows:
- "Projects":
  heros
  jasmin
- "Libraries" (in exact order):
  asm-debug-all-5.0.3.jar - soot/libs
  AXMLPrinter2.jar - soot/libs
  dexlib2-2.0.3-dev.jar - soot/libs
  hamcrest-all-1.3.jar - soot/libs
  junit-4.1.1.jar - soot/libs
  polyglot.jar - soot/libs
  unit-2.0.3-dev.jar - soot/libs
  JRE System Library [jre1.8.0_20]
- "Order and Export" (in exact order and check/uncheck tickbox statuses):
  soot/generated/jastadd (checked)
  soot/src (checked)
  soot/tests (checked)
  soot/generated/options (checked)
  soot/generated/sablecc (checked)
  soot/generated/singletons (checked)
  JRE System Library [jre.1.8.0_20] (unchecked)
  jasmin (unchecked)
  heros (checked)
  polyglot.jar - soot/libs (unchecked)
  AXMLPrinter2.jar - soot/libs (unchecked)
  hamcrest-all-1.3.jar - soot/libs (unchecked)
  junit-4.1.1.jar - soot/libs (unchecked)
  dexlib2-2.0.3-dev.jar - soot/libs (unchecked)
  unit-2.0.3-dev.jar - soot/libs (unchecked)
  asm-debug-all-5.0.3.jar - soot/libs (unchecked)

I also tried to check the jasmin tickbox within the "Order and Export" tab
of soot project
within Eclipse so as to create soot.jar version that includes both heros
and jasmin exported within.
But the encountered exception was still there. And it seems that it's
related to the
java.lang.NoClassDefFoundError exception on
org/xmlpull/v1/XmlPullParserException.
I don't know how the XmlPullParser from org.xmlpull.v1 has anything wrong
with
the Soot project's JAR generated using Eclipse.

Really appreciate your help on this.

Thanks and regards,
Roy


On Wed, Oct 8, 2014 at 6:08 PM, Bodden, Eric <eric.bodden at sit.fraunhofer.de>
wrote:

> Hmmm, I am running out of ideas. I am pretty sure that you are packaging
> something incorrectly. But from here it's hard to tell what's going wrong.
>
> What does your Eclipse-project's classpath look like?
>
> Eric
>
> On 08.10.2014, at 11:31, Roy Liu <royliudev at gmail.com> wrote:
>
> > Hi Eric,
> >
> > Thanks for your prompt reply and suggestion.
> >
> > I've tried reordering the classpath entries by moving forward
> soot-infoflow-android.jar
> > and soot-infoflow.jar, as well as a few other combinations like putting
> axml-2.0.jar forward
> > and putting soot.jar as the last jar in the classpath.
> > Still, the same exception was reported.
> >
> > In fact, if I use the nightly-built soot-trunk.jar, it's perfectly fine
> if I just put it in the same
> > exact position as the Eclipse-built soot.jar, e.g. the first entry in
> the classpath as shown
> > in the executed command line earlier.
> >
> > Any other possible explanation for the raised exception?
> > FYI, I've tried different JDK versions, including the latest Java 8, to
> generate the JAR files.
> > No errors were reported during the JAR exporting step.
> >
> > Many thanks!
> >
> > Cheers,
> > Roy
> >
> >
> > On Wed, Oct 8, 2014 at 3:41 PM, Bodden, Eric <
> eric.bodden at sit.fraunhofer.de> wrote:
> > Hi Roy.
> >
> > My suspicion is that your classpath entries are ordered incorrectly,
> leading to inconsistent class versions being picked up. Try moving
> soot-infoflow-android.jar and soot-infoflow.jar forward etc.
> >
> > Cheers,
> > Eric
> >
> > On 08.10.2014, at 05:02, Roy Liu <royliudev at gmail.com> wrote:
> >
> > > Hi All,
> > >
> > > I'm currently experimenting running FlowDroid to analyze some Android
> malware samples.
> > > I've used Eclipse to import all the Java source packages required to
> run FlowDroid as mentioned
> > > in the FlowDroid's github page (
> https://github.com/secure-software-engineering/soot-infoflow-android/wiki
> );
> > > and then build the source packages to generate the corresponding JAR
> files, which can be seen in the following command line.
> > >
> > >    D:> java -Xmx1g -cp
> soot.jar;soot-infoflow.jar;soot-infoflow-android.jar;slf4j-api-1.7.5.jar;
> > >    slf4j-simple-1.7.5.jar;axml-2.0.jar
> soot.jimple.infoflow.android.TestApps.Test malware1.apk
> > >    adt\sdk\platforms
> > >
> > > The following exception, however, was encountered due to the
> Eclipse-generated soot.jar:
> > >
> > >    Exception in thread "main" java.lang.NoClassDefFoundError:
> org/xmlpull/v1/XmlPullParserException
> > >         at java.lang.Class.getDeclaredMethods0(Native Method)
> > >         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> > >         at java.lang.Class.privateGetMethodRecursive(Unknown Source)
> > >         at java.lang.Class.getMethod0(Unknown Source)
> > >         at java.lang.Class.getMethod(Unknown Source)
> > >         at sun.launcher.LauncherHelper.validateMainClass(Unknown
> Source)
> > >         at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
> > >    Caused by: java.lang.ClassNotFoundException:
> org.xmlpull.v1.XmlPullParserException
> > >         at java.net.URLClassLoader$1.run(Unknown Source)
> > >         at java.net.URLClassLoader$1.run(Unknown Source)
> > >         at java.security.AccessController.doPrivileged(Native Method)
> > >         at java.net.URLClassLoader.findClass(Unknown Source)
> > >         at java.lang.ClassLoader.loadClass(Unknown Source)
> > >         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > >         at java.lang.ClassLoader.loadClass(Unknown Source)
> > >         ... 7 more
> > >
> > > If I replace the Eclipse-built soot.jar with the FlowDroid's
> nighly-built soot-trunk.jar,
> > > while keeping my other Eclipse-built JAR files soot-infoflow.jar and
> soot-infoflow-android.jar,
> > > then FlowDroid execution works fine and is able to produce the
> privacy-leakage path results.
> > >
> > > I was wondering what could be the cause of the exception when I used
> the Eclipse-generated soot.jar.
> > > No compilation errors were reported during the soot.jar building (i.e.
> JAR exporting) process.
> > > And the other two Eclipse-based JAR files (soot-infoflow.jar and
> soot-infoflow-android.jar),
> > > which were generated in the same way as soot.jar, work just fine with
> the FlowDroid's
> > > nighly-built soot-trunk.jar.
> > >
> > > Any enlightenment on this exception issue will be much appreciated.
> > >
> > > Thanks and regards,
> > > Roy Liu
> > > _______________________________________________
> > > Soot-list mailing list
> > > Soot-list at CS.McGill.CA
> > > https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
> >
> > --
> > Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
> > Head of Secure Software Engineering at Fraunhofer SIT, TU Darmstadt and
> EC SPRIDE
> > Tel: +49 6151 16-75422    Fax: +49 6151 869-127
> > Room B5.11, Fraunhofer SIT, Rheinstraße 75, 64295 Darmstadt
> >
> >
>
> --
> Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
> Head of Secure Software Engineering at Fraunhofer SIT, TU Darmstadt and EC
> SPRIDE
> Tel: +49 6151 16-75422    Fax: +49 6151 869-127
> Room B5.11, Fraunhofer SIT, Rheinstraße 75, 64295 Darmstadt
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141009/b2f8243b/attachment.html 


More information about the Soot-list mailing list