[Soot-list] Generating Android APK CallFlowGraph
LOKESH JAIN
lokeshjain92 at gmail.com
Thu Jul 17 05:02:58 EDT 2014
Hi all,
Modhi, I am using your code for generating call graph for apk file. But, I
am getting following error
Exception in thread "main" java.lang.NoClassDefFoundError:
pxb/android/axml/NodeVisitor
at soot.jimple.infoflow.android.manifest.ProcessManifest.handle(Unknown
Source)
at soot.jimple.infoflow.android.manifest.ProcessManifest.<init>(Unknown
Source)
at soot.jimple.infoflow.android.manifest.ProcessManifest.<init>(Unknown
Source)
at
soot.jimple.infoflow.android.SetupApplication.calculateSourcesSinksEntrypoints(Unknown
Source)
at
soot.jimple.infoflow.android.SetupApplication.calculateSourcesSinksEntrypoints(Unknown
Source)
at CFG.main(CFG.java:33)
Caused by: java.lang.ClassNotFoundException: pxb.android.axml.NodeVisitor
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
It's pretty much the same error that you were getting. Though I had checked
, there is no duplicate library added. Also there is already
AndroidCallbacks.txt in soot-infoflow-android, i haven't understood how to
add it into my project.
Any help would be appreciated. Thank You
Regards
Lokesh
On Saturday, 5 July 2014 23:04:49 UTC+5:30, Modhi Alsobiehy wrote:
>
> Hi all,
> I need to traverse the call flow graph of android apps( apk files).
> I understand that I must set an entry point so to start, I tried the
> following code :
>
>
> ----------------------------------------------------------------------------------------------------
>
> *mport* java.io.IOException;
>
> *import* java.util.Collections;
>
> *import* org.xmlpull.v1.XmlPullParserException;
>
> *import* soot.PackManager;
>
> *import* soot.Scene;
>
> *import* soot.SootMethod;
>
> *import* soot.jimple.infoflow.android.SetupApplication;
>
> *import* soot.options.Options;
>
> *public* *class* CFG {
>
> *public* CFG() {
>
> // *TODO* Auto-generated constructor stub
>
> }
>
> *public* *static* *void* main(String[] args) {
>
> // *TODO* Auto-generated method stub
>
> SetupApplication app = *new* SetupApplication(
> "D:/AndroidADT/adt-bundle-windows-x86_64-20131030/sdk/platforms",
> "D:/APKs/location.apk");
>
> *try* {
>
> app.calculateSourcesSinksEntrypoints("D:/FlowDroid/SourcesAndSinks.txt");
>
> } *catch* (IOException e) {
>
> // *TODO* Auto-generated catch block
>
> e.printStackTrace();
>
> } *catch* (XmlPullParserException e) {
>
> // *TODO* Auto-generated catch block
>
> e.printStackTrace();
>
> }
>
> soot.G.*reset*();
>
> Options.*v*().set_src_prec(Options.*src_prec_apk*);
>
> Options.*v*().set_process_dir(Collections.*singletonList*(
> "D:/APKs/location.apk"));
>
> Options.*v*().set_android_jars(
> "D:/AndroidADT/adt-bundle-windows-x86_64-20131030/sdk/platforms");
>
> Options.*v*().set_whole_program(*true*);
>
> Options.*v*().set_allow_phantom_refs(*true*);
>
> Options.*v*().set_output_format(Options.*output_format_none*);
>
> Options.*v*().setPhaseOption("cg.spark", "on");
>
> Scene.*v*().loadNecessaryClasses();
>
> SootMethod entryPoint = app.getEntryPointCreator().createDummyMain();
>
> Options.*v*().set_main_class(entryPoint.getSignature());
>
> Scene.*v*().setEntryPoints(Collections.*singletonList*(entryPoint));
>
> System.*out*.println(entryPoint.getActiveBody());
>
> PackManager.*v*().runPacks();
>
> System.*out*.println(Scene.*v*().getCallGraph().size());
>
> }
>
> }
>
>
> ---------------------------------------------------------------------------------------------------------------------
>
> Unfortunately, I am getting the following error:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> pxb/android/axml/NodeVisitor
>
> at soot.jimple.infoflow.android.manifest.ProcessManifest.handle(Unknown
> Source)
>
> at soot.jimple.infoflow.android.manifest.ProcessManifest.<init>(Unknown
> Source)
>
> at soot.jimple.infoflow.android.manifest.ProcessManifest.<init>(Unknown
> Source)
>
> at
> soot.jimple.infoflow.android.SetupApplication.calculateSourcesSinksEntrypoints(Unknown
> Source)
>
> at
> soot.jimple.infoflow.android.SetupApplication.calculateSourcesSinksEntrypoints(Unknown
> Source)
>
> at apkCFG.CFG.main(*CFG.java:25*)
>
> Caused by: *java.lang.ClassNotFoundException*:
> pxb.android.axml.NodeVisitor
>
> 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)
>
> ... 6 more
>
>
> Any help or advise on how to do that would be deeply appreciated!
>
> Thanx!!
>
>
> Sent from Windows Mail
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140717/9f0c8c3a/attachment-0003.html
More information about the Soot-list
mailing list