<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Monika,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Soot only has frontends for Dalvik and Java bytecode and source code, not for native X86 or ARM code. You will thus not be able to analyze a .so file contained in an APK file with Soot.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> Steven<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Monika Mashalkar [mailto:monikamashalkar@gmail.com] <br><b>Gesendet:</b> Freitag, 20. März 2015 09:16<br><b>An:</b> soot-list@googlegroups.com<br><b>Cc:</b> Monika Mashalkar; soot-list@cs.mcgill.ca; soot-list@sable.mcgill.ca; Steven Arzt<br><b>Betreff:</b> Re: [Soot-list] Generating Android APK CallFlowGraph<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi Steven,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Can we work with Android native apps using SOOT, i.e can we construct call graph from Native Android app's apk ? I couldn't find any tutorial on this topic.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thank you.<o:p></o:p></p></div><div><p class=MsoNormal>Regards,<o:p></o:p></p></div><div><p class=MsoNormal>Monika<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Sun, Mar 8, 2015 at 7:04 PM, Monika Mashalkar <<a href="mailto:monikamashalkar@gmail.com" target="_blank">monikamashalkar@gmail.com</a>> wrote:<o:p></o:p></p><div><p class=MsoNormal>Got it !! Thank you Steven :)<br><br>On Friday, 6 March 2015 17:12:38 UTC+5:30, Steven Arzt wrote:<o:p></o:p></p><div><p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Monika,</span><o:p></o:p></p><p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You get these warnings because your APK file references classes which are not included in your Android JAR file. This is usually not a problem as long as you do not wish to analyze the code of the Android operating system itself.</span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,</span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> Steven</span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> soot-lis...@CS.McGill.CA [mailto:soot-lis...@CS.McGill.CA] <b>Im Auftrag von </b>Monika Mashalkar<br><b>Gesendet:</b> Mittwoch, 25. Februar 2015 13:51<br><b>An:</b> Steven Arzt<br><b>Cc:</b> soot...@CS.McGill.CA; soot...@sable.mcgill.ca; soot...@googlegroups.com<br><b>Betreff:</b> Re: [Soot-list] Generating Android APK CallFlowGraph</span><o:p></o:p></p><p> <o:p></o:p></p><div><p>Hi Steven,<o:p></o:p></p><div><div><div><p> <o:p></o:p></p></div><div><p>Thanks for your quick reply. I am able to run the code now. But I am getting the warnings as follow :<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><div><p>Warning: java.lang.ref.Finalizer is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.graphics.pdf.PdfDocument$Page is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.graphics.pdf.PdfDocument$PageInfo is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.graphics.pdf.PdfDocument is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.media.RemoteControlClient$OnGetPlaybackPositionListener is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.media.RemoteControlClient$OnPlaybackPositionUpdateListener is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PageRange is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintAttributes$Builder is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintAttributes$MediaSize is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintAttributes is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintDocumentAdapter$LayoutResultCallback is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintDocumentAdapter$WriteResultCallback is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintDocumentAdapter is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintDocumentInfo$Builder is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintDocumentInfo is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintJob is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.PrintManager is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.print.pdf.PrintedPdfDocument is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.view.ViewTreeObserver$OnWindowAttachListener is a phantom class!<o:p></o:p></p></div><div><p>Warning: android.view.ViewTreeObserver$OnWindowFocusChangeListener is a phantom class!<o:p></o:p></p></div></div><div><p> <o:p></o:p></p></div><div><p>May I know the reason, why I am getting these warnings ?<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>The command that I am using to run the program is :<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>monika@monika-OptiPlex-990:~$ java -cp .:soot-trunk.jar:soot-infoflow.jar:soot-infoflow-android.jar:slf4j-api-1.7.5.jar:slf4j-simple-1.7.5.jar:axml-2.0.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/rt.jar CFG<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>I am attaching the output file with this mail. Please, tell me I am getting it correct or not.<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Thanks and regards,<o:p></o:p></p></div><div><p>Monika<o:p></o:p></p></div></div></div></div><div><p> <o:p></o:p></p><div><p>On Wed, Feb 25, 2015 at 3:51 PM, Steven Arzt <Steve...@cased.de> wrote:<o:p></o:p></p><div><div><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Monika,</span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The CFG class is not part of Soot. It was just written as an example. You need to compile it on your own.</span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,</span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> Steven</span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span lang=EN-US style='font-size:13.5pt;font-family:"Courier New";color:black'>M.Sc. M.Sc. Steven Arzt</span><o:p></o:p></p><p><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>Secure Software Engineering Group (SSE)</span><o:p></o:p></p><p><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>European Center for Security and Privacy by Design (EC SPRIDE) </span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Courier New";color:black'>Rheinstraße 75</span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Courier New";color:black'>D-64293 Darmstadt</span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Courier New";color:black'>Phone: +49 61 51 869-336</span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Courier New";color:black'>Fax: +49 61 51 16-72118</span><o:p></o:p></p><p><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>eMail: steven.arzt@ec-spride.de</span><o:p></o:p></p><p><span style='font-size:10.0pt;font-family:"Courier New";color:black'>Web: <a href="http://sse.ec-spride.de/" target="_blank">http://sse.ec-spride.de</a></span><o:p></o:p></p><p><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Monika Mashalkar [mailto:monikam...@gmail.com] <br><b>Gesendet:</b> Mittwoch, 25. Februar 2015 05:30<br><b>An:</b> soot...@googlegroups.com<br><b>Cc:</b> soot...@sable.mcgill.ca; soot...@cs.mcgill.ca; Steve...@cased.de</span><o:p></o:p></p><div><div><p class=MsoNormal><br><b>Betreff:</b> Re: [Soot-list] Generating Android APK CallFlowGraph<o:p></o:p></p></div></div><div><div><p> <o:p></o:p></p><div><p>Hi Lokesh,<o:p></o:p></p><div><p> <o:p></o:p></p></div><div><p>I am very new to the SOOT Framework and Flow-droid. I want to find the flow graph from android apk in my project and I am trying to run the code posted in this thread to do the same. I am trying to run the following command on Ubuntu <br><br>Command : java -cp soot-trunk.jar:soot-infoflow.jar:soot-infoflow-android.jar:slf4j-api-1.7.5.jar:slf4j-simple-1.7.5.jar:axml-2.0.jar -cp .:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/rt.jar CFG<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>but I am getting Error as : Error: Could not find or load main class CFG<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Could you please tell me the command to execute the CFG program.<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Thank you,<o:p></o:p></p></div><div><p>Monika<o:p></o:p></p></div><div><p><br>On Monday, 21 July 2014 13:46:37 UTC+5:30, LOKESH JAIN wrote:<o:p></o:p></p><div><p>Hi all,<o:p></o:p></p><div><p> <o:p></o:p></p></div><div><p>I resolved the issue and finally i am getting the call graph. Thank you all of you for your time and help. :)<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>1. But Stevan I am still curious to know how to work with QueueReader Object for generating dot format.<o:p></o:p></p></div><div><p>2. And why the size of call graph for RV2013.apk is 54. And is there any way to remove unnecessary size.<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Thanks&Regards<o:p></o:p></p></div><div><p>Lokesh<o:p></o:p></p></div></div><div><p style='margin-bottom:12.0pt'> <o:p></o:p></p><div><p>On Mon, Jul 21, 2014 at 11:38 AM, LOKESH JAIN <lokesh...@gmail.com> wrote:<o:p></o:p></p><div><div><div><div><p>Hi all,<o:p></o:p></p></div><div><p>Steven I still couldn't figure it out how to work with queuereader object for generating dot format.<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>I have used dot graph class manually as suggested to me by Stefan but,<o:p></o:p></p></div><div><div><div><p>I am getting NullPointerException. I don't know why. I have pasted the complete code.<o:p></o:p></p></div><div><p>Please help me out.<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Exception in thread "main" java.lang.NullPointerException<o:p></o:p></p></div><div><p>at DotGraph.getNode(DotGraph.java:53)<o:p></o:p></p></div><div><p>at DotGraph.drawNode(DotGraph.java:61)<o:p></o:p></p></div><div><p>at CFG.visit(CFG.java:114)<o:p></o:p></p></div><div><p>at CFG.main(CFG.java:94)<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>CFG.java<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>import java.io.BufferedOutputStream;<o:p></o:p></p></div><div><p>import java.io.FileOutputStream;<o:p></o:p></p></div><div><div><p>import java.io.IOException;<o:p></o:p></p></div><div><p>import java.io.OutputStream;<o:p></o:p></p></div><div><p>import java.util.Collections;<o:p></o:p></p></div></div><div><p>import java.util.HashMap;<o:p></o:p></p></div><div><p>import java.util.HashSet;<o:p></o:p></p></div><div><p>import java.util.Iterator;<o:p></o:p></p></div><div><div><p>import java.util.LinkedList;<o:p></o:p></p></div><div><p>import java.util.List;<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>import org.xmlpull.v1.XmlPullParserException;<o:p></o:p></p></div><div><p> <o:p></o:p></p></div></div><div><p>import soot.MethodOrMethodContext;<o:p></o:p></p></div><div><div><p>import soot.PackManager;<o:p></o:p></p></div><div><p>import soot.Scene;<o:p></o:p></p></div><div><p>import soot.SootMethod;<o:p></o:p></p></div><div><p>import soot.jimple.infoflow.android.SetupApplication;<o:p></o:p></p></div></div><div><p>import soot.jimple.toolkits.callgraph.CallGraph;<o:p></o:p></p></div><div><p>import soot.jimple.toolkits.callgraph.Targets;<o:p></o:p></p></div><div><div><p>import soot.options.Options;<o:p></o:p></p></div><div><p>import soot.util.dot.DotGraphUtility;<o:p></o:p></p></div><div><p>import soot.util.dot.Renderable;<o:p></o:p></p></div><div><p>public class CFG {<o:p></o:p></p></div></div><div><p>private static DotGraph dot = new DotGraph("callgraph");<o:p></o:p></p></div></div></div><div><p>private static HashMap <String,Boolean> visited = new HashMap<String,Boolean>(); <o:p></o:p></p></div><div><div><div><p>public CFG() {<o:p></o:p></p></div><div><div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>public static void main(String[] args) {<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>// TODO Auto-generated method stub<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>SetupApplication app = new SetupApplication("/home/lokesh/Desktop/android-sdk-linux/platforms/android-19/android.jar","/home/lokesh/Desktop/android-instrumentation-tutorial-master/app-example/RV2013/bin/RV2013.apk");<o:p></o:p></p></div><div><p>try {<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>app.calculateSourcesSinksEntrypoints("/home/lokesh/Downloads/soot-infoflow-android-develop/SourcesAndSinks.txt");<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>} catch (IOException e) {<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>// TODO Auto-generated catch block<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>e.printStackTrace();<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>} catch (XmlPullParserException e) {<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>// TODO Auto-generated catch block<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>e.printStackTrace();<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>soot.G.reset();<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Options.v().set_src_prec(Options.src_prec_apk);<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Options.v().set_process_dir(Collections.singletonList("/home/lokesh/Desktop/android-instrumentation-tutorial-master/app-example/RV2013/bin/RV2013.apk"));<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Options.v().set_force_android_jar("/home/lokesh/Desktop/android-sdk-linux/platforms/android-19/android.jar");<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Options.v().set_whole_program(true);<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Options.v().set_allow_phantom_refs(true);<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Options.v().set_output_format(Options.output_format_none);<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Options.v().setPhaseOption("cg.spark verbose:true", "on");<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Scene.v().loadNecessaryClasses();<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>SootMethod entryPoint = app.getEntryPointCreator().createDummyMain();<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Options.v().set_main_class(entryPoint.getSignature());<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>Scene.v().setEntryPoints(Collections.singletonList(entryPoint));<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>System.out.println("............"+entryPoint.getActiveBody());<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>PackManager.v().runPacks();<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>System.out.println(Scene.v().getCallGraph().size());<o:p></o:p></p></div></div></div><div><div><p>CallGraph cg = Scene.v().getCallGraph();<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>visit(cg, entryPoint);<o:p></o:p></p></div></div><div><p>dot.plot("/home/lokesh/Desktop/soot1"+ dot.DOT_EXTENSION);<o:p></o:p></p></div><div><div><p> <o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p>private static void visit(CallGraph cg, SootMethod k)<o:p></o:p></p></div><div><p>{<o:p></o:p></p></div><div><p>String identifier = k.getName();<o:p></o:p></p></div></div><div><p> <o:p></o:p></p></div></div></div><div><div><div><p>visited.put(k.getSignature(),true);<o:p></o:p></p></div><div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>dot.drawNode(identifier);<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>//iterate over unvisited parents<o:p></o:p></p></div><div><p>Iterator<MethodOrMethodContext> ptargets = new Targets(cg.edgesInto(k));<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>if(ptargets != null){<o:p></o:p></p></div><div><p>while(ptargets.hasNext())<o:p></o:p></p></div><div><p>{<o:p></o:p></p></div><div><p>SootMethod p = (SootMethod) ptargets.next();<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>if(p == null) System.out.println("p is null");<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>if(!visited.containsKey(p.getSignature()))<o:p></o:p></p></div><div><p>visit(cg,p);<o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>//iterate over unvisited children<o:p></o:p></p></div><div><p>Iterator<MethodOrMethodContext> ctargets = new Targets(cg.edgesOutOf(k));<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>if(ctargets != null){<o:p></o:p></p></div><div><p>while(ctargets.hasNext())<o:p></o:p></p></div><div><p>{<o:p></o:p></p></div><div><p>SootMethod c = (SootMethod) ctargets.next();<o:p></o:p></p></div><div><p>if(c == null) System.out.println("c is null");<o:p></o:p></p></div><div><p>dot.drawEdge(identifier, c.getName());<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>if(!visited.containsKey(c.getSignature()))<o:p></o:p></p></div><div><p>visit(cg,c);<o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p>}<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p> <o:p></o:p></p></div></div><div><p>DotGraph.java<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>import java.io.BufferedOutputStream;<o:p></o:p></p></div><div><p>import java.io.FileOutputStream;<o:p></o:p></p></div><div><p>import java.io.IOException;<o:p></o:p></p></div><div><p>import java.io.OutputStream;<o:p></o:p></p></div><div><p>import java.util.HashMap;<o:p></o:p></p></div><div><p>import java.util.LinkedList;<o:p></o:p></p></div><div><p>import java.util.List;<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>import soot.util.dot.DotGraphEdge;<o:p></o:p></p></div><div><p>import soot.util.dot.DotGraphNode;<o:p></o:p></p></div><div><div><p>import soot.util.dot.DotGraphUtility;<o:p></o:p></p></div><div><p>import soot.util.dot.Renderable;<o:p></o:p></p></div><div><p> <o:p></o:p></p></div><div><p>public class DotGraph implements Renderable<o:p></o:p></p></div><div><p>{<o:p></o:p></p></div></div><div><p>public final static String DOT_EXTENSION = ".dot";<o:p></o:p></p></div><div><p>private HashMap<String, DotGraphNode> nodes;<o:p></o:p></p></div><div><div><p>private boolean isSubGraph;<o:p></o:p></p></div><div><p>private List<Renderable> drawElements;<o:p></o:p></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><p class=MsoNormal>...<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>