<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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* 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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;
        mso-fareast-language:DE;}
span.E-MailFormatvorlage19
        {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;}
/* List Definitions */
@list l0
        {mso-list-id:788819850;
        mso-list-template-ids:-1594598290;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l1
        {mso-list-id:795416482;
        mso-list-template-ids:-1587517422;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l2
        {mso-list-id:1333147052;
        mso-list-template-ids:-1550045778;}
@list l3
        {mso-list-id:1782872640;
        mso-list-template-ids:1765436462;}
@list l3:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l3:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l3:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l3:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l3:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l3:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l3:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l3:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l3:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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 Jason,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Your main() method is  static method that correctly creates a new instance of your “OneManager” class and then exercises it.  Your “custom entry point” (which is misleading nomenclature as the mere fact that you explicitly specify the entry point instead of having Soot pick the main method for you does not  change anything with respect to Soot) still has the old problem: You are calling into an instance method without having an instance. You are trying to analyze “closedAPI()”, but there is no base instance of “OneManager”, so there will not be any outgoing edges from any local field. There is simply no way for SPARK to find out where the call to “(this.)mService.closedAPI()” should go as “this” was never initialized, the constructor was never run, and “mService” is just null.<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>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If you want to analyze instance methods, you need to generate a dummy “main” method which you can then use as your entry point. This dummy main method must create proper instances and then call the methods you want to analyze. You can for instance use the DefaultEntryPointCreator (which is included in FlowDroid) for that job. It takes a list of method signatures and then creates a dummy main method from them.<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>&nbsp;</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>&nbsp;</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"'> soot-list-bounces@CS.McGill.CA [mailto:soot-list-bounces@CS.McGill.CA] <b>Im Auftrag von </b>Jason Ott<br><b>Gesendet:</b> Dienstag, 7. April 2015 01:06<br><b>An:</b> soot-list@CS.McGill.CA<br><b>Betreff:</b> Re: [Soot-list] Soot/Spark GC overhead limit exceeded and the Android Framework<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>Thank you!<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I have a few other questions regarding entry points and call graph creation:<o:p></o:p></p></div><div><ol start=1 type=1><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo1'>If soot/SPARK cannot figure out the path does it stop and not generate any edges?&nbsp; I have a toy example (see below) for which the new'd object creates the appropriate graph, but the custom entry point creates a graph with no edges.<o:p></o:p></li><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo1'>Which leads me to my next question: what specifically causes confusion for SPARK in the custom entry point?<o:p></o:p></li></ol><ol start=2 type=1><ol start=1 type=1><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l2 level2 lfo1'>Is it the use of this.methodX() versus methodX()? &nbsp;(Does the simple use of &quot;this&quot; keyword kill the graph?<o:p></o:p></li></ol></ol><ol start=3 type=1><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo1'>Does subtype polymorphism have any affect on the call graph whether new'd or custom entry?<o:p></o:p></li></ol><div><p class=MsoNormal>I have tried answering these problems myself, but it is difficult when the custom entry point of the graph doesn't generate any edges for me to analyze.&nbsp; Thanks!<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I am generating the callgraph with these two commands:<o:p></o:p></p></div><div><p class=MsoNormal><b>new'd object:</b><o:p></o:p></p></div><div><ul type=disc><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo2'>-p cg.spark on -cp /path/to/classes/:. -trim-cfgs -allow-phantom-refs -w -verbose run main<o:p></o:p></li></ul></div><div><p class=MsoNormal><b>Custom Entry point:</b><o:p></o:p></p></div><div><ul type=disc><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo3'>-p cg.spark on -cp /path/to/classes/:. -trim-cfgs -allow-phantom-refs -w -verbose Managers.OneManager closedAPI<o:p></o:p></li></ul></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Toy example:<o:p></o:p></p></div><div><pre style='background:#2B2B2B'><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>OneManager.java</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'><o:p></o:p></span></pre><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><span style='color:#CC7832'>public class </span>OneManager {<br><span style='color:#CC7832'>&nbsp; &nbsp; public </span>OneService <span style='color:#9876AA'>mService</span><span style='color:#CC7832'>;<br><br>&nbsp; &nbsp; public </span>OneManager() {<br><span style='color:#CC7832'>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;</span><span style='color:#9876AA'>mService </span>= <span style='color:#CC7832'>new </span>OneService()<span style='color:#CC7832'>;</span><o:p></o:p></p></blockquote><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><span style='color:#CC7832'>&nbsp; &nbsp;&nbsp;</span>}<br><span style='color:#CC7832'>&nbsp; &nbsp;&nbsp;public void </span><span style='color:#FFC66D'>openAPI</span>() {<br><span style='color:#CC7832'>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;</span><span style='color:#9876AA'>mService</span>.openAPI()<span style='color:#CC7832'>;</span><o:p></o:p></p></blockquote><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><span style='color:#CC7832'>&nbsp; &nbsp;&nbsp;</span>}<br><span style='color:#CC7832'>&nbsp; &nbsp;&nbsp;public void </span><span style='color:#FFC66D'>closedAPI</span>() {<br><span style='color:#CC7832'>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;</span><span style='color:#9876AA'>mService</span>.closedAPI()<span style='color:#CC7832'>;</span><o:p></o:p></p></blockquote><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><span style='color:#CC7832'>&nbsp; &nbsp;&nbsp;</span>}<br>}<o:p></o:p></p></blockquote><pre style='background:#2B2B2B'><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>OneService.java<o:p></o:p></span></pre><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><pre style='background:#2B2B2B'><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public class </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>OneService </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>extends </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>MasterService {<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public boolean </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#9876AA'>mHasRights </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>= </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>false;<br><br>    public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>overridenMethod</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:gray'>//don't call super here<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>notOverriddenMethod</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>super</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>.notOverriddenMethod()</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>closedAPI</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        callChainOne()</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>openAPI</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>super</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>.callChainOne()</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>callChainOne</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>(){<br>        callChainTwo()</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>callChainTwo</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        callChainThree()</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>callChainThree</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>    }<br>}<br>MasterService.java<br></span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public class </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>MasterService {<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>overriddenMethod</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>    }<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>notOverriddenMethod</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        <br>    }<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>callChainOne</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>this</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>.callChainTwo()</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>callChainTwo</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>this</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>.callChainThree()</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>;<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>public void </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#FFC66D'>callChainThree</span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>() {<br>        </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#CC7832'>return;<br>    </span><span style='font-size:12.0pt;font-family:"Menlo","serif";color:#A9B7C6'>}<br>}<o:p></o:p></span></pre></blockquote></div><div><p class=MsoNormal>&nbsp; &nbsp; Run.java<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>public class run {<br>&nbsp; &nbsp; public static void main(String[] args) {<br>&nbsp; &nbsp; &nbsp; &nbsp; OneManager om = new OneManager();<br>&nbsp; &nbsp; &nbsp; &nbsp; om.closedAPI();<br>&nbsp; &nbsp; }<br>}<o:p></o:p></p></blockquote><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>My SootAnalyzer is super simple:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>&nbsp;<span style='font-family:"Menlo","serif";color:#CC7832'>public class </span><span style='font-family:"Menlo","serif";color:#A9B7C6;background:#2B2B2B'>Main {</span><br><i><span style='color:#629755'>/**<br>* <b>@param </b></span><span style='color:#8A653B'>args<br></span><span style='color:#629755'>*/<br></span></i><span style='color:#CC7832'>public static void </span><span style='color:#FFC66D'>main</span>(String[] args) {<br>String entryPointClass = args[args.<span style='color:#9876AA'>length</span>-<span style='color:#6897BB'>2</span>]<span style='color:#CC7832'>;<br></span>String entryPointMethod = args[args.<span style='color:#9876AA'>length</span>-<span style='color:#6897BB'>1</span>]<span style='color:#CC7832'>;<br><br></span>System.<i><span style='color:#9876AA'>out</span></i>.println(entryPointClass + <span style='color:#6A8759'>&quot;.&quot; </span>+ entryPointMethod)<span style='color:#CC7832'>;<br><br></span>args = Arrays.<i>copyOf</i>(args<span style='color:#CC7832'>, </span>args.<span style='color:#9876AA'>length</span>-<span style='color:#6897BB'>2</span>)<span style='color:#CC7832'>;<br><br>for</span>(String s : args) {<br><span style='color:gray'>//System.out.println(s);<br></span>}<br><span style='color:#CC7832'>long </span>start = System.<i>currentTimeMillis</i>()<span style='color:#CC7832'>;<br></span>Options.<i>v</i>().parse(args)<span style='color:#CC7832'>;<br></span><span style='color:gray'>//SootClass c = Scene.v().forceResolve(&quot;android.hardware.usb.UsbManager&quot;, SootClass.BODIES);<br></span>SootClass c = Scene.<i>v</i>().forceResolve(entryPointClass<span style='color:#CC7832'>, </span>SootClass.<i><span style='color:#9876AA'>BODIES</span></i>)<span style='color:#CC7832'>;<br></span>c.setApplicationClass()<span style='color:#CC7832'>;<br></span>Scene.<i>v</i>().loadNecessaryClasses()<span style='color:#CC7832'>;<br></span>SootMethod method = c.getMethodByName(entryPointMethod)<span style='color:#CC7832'>;<br><br></span>List entryPoints = <span style='color:#CC7832'>new </span>ArrayList()<span style='color:#CC7832'>;<br></span>entryPoints.add(method)<span style='color:#CC7832'>;<br><br></span>Scene.<i>v</i>().setEntryPoints(entryPoints)<span style='color:#CC7832'>;<br></span>PackManager.<i>v</i>().runPacks()<span style='color:#CC7832'>;<br><br></span><span style='color:gray'>//soot.Main.main(args);<br></span>soot.jimple.toolkits.callgraph.CallGraph callgraph = Scene.<i>v</i>().getCallGraph()<span style='color:#CC7832'>;<br><br><br></span>FileHandler fh = <span style='color:#CC7832'>new </span>FileHandler(entryPointClass + <span style='color:#6A8759'>&quot;-&quot; </span>+ entryPointMethod)<span style='color:#CC7832'>;<br><br>for</span>(Edge e : callgraph) {<br>fh.write(e.toString())<span style='color:#CC7832'>;<br></span>fh.write(<span style='color:#6A8759'>&quot;</span><span style='color:#CC7832'>\n</span><span style='color:#6A8759'>&quot;</span>)<span style='color:#CC7832'>;<br></span>}<br>fh.close()<span style='color:#CC7832'>;</span><span style='color:gray'><br></span>System.<i><span style='color:#9876AA'>out</span></i>.println(<span style='color:#6A8759'>&quot;[TestSpark] Call graph size &quot; </span>+ callgraph.size())<span style='color:#CC7832'>;<br><br></span>System.<i><span style='color:#9876AA'>out</span></i>.println(String.<i>format</i>(<span style='color:#6A8759'>&quot;It took: %d seconds to generate a callgraph for: %s&quot;</span><span style='color:#CC7832'>,<br></span>TimeUnit.<i><span style='color:#9876AA'>MILLISECONDS</span></i>.toSeconds(System.<i>currentTimeMillis</i>() - start)<span style='color:#CC7832'>,<br></span>entryPointClass +<span style='color:#6A8759'>&quot;.&quot;</span>+ entryPointMethod))<span style='color:#CC7832'>;<br></span>}<br>}<o:p></o:p></p></blockquote><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>FileHandler is simple a wrapper class for handling I/O, it works just fine.&nbsp;<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Thu, Apr 2, 2015 at 11:15 AM, Jason Ott &lt;<a href="mailto:jott002@ucr.edu" target="_blank">jott002@ucr.edu</a>&gt; wrote:<o:p></o:p></p><div><div><p class=MsoNormal>So I'm trying to run soot with spark on the Android Framework using a custom entry point.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Here is my the code that runs soot:<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp;<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; public class Main {<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; public static void main(String[] args) {<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String entryPointClass = args[args.length-2];<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String entryPointMethod = args[args.length-1];<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(entryPointClass + &quot;.&quot; + entryPointMethod);<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; args = Arrays.copyOf(args, args.length-2);<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; long start = System.currentTimeMillis();<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Options.v().parse(args);<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SootClass c = Scene.v().forceResolve(entryPointClass, SootClass.BODIES);<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c.setApplicationClass();<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Scene.v().loadNecessaryClasses();<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SootMethod method = c.getMethodByName(entryPointMethod);<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List entryPoints = new ArrayList();<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; entryPoints.add(method);<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Scene.v().setEntryPoints(entryPoints);<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PackManager.v().runPacks();<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; soot.jimple.toolkits.callgraph.CallGraph callgraph = Scene.v().getCallGraph();<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(&quot;[TestSpark] Call graph size &quot; + callgraph.size());<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(String.format(&quot;It took: %d seconds to generate a callgraph for: %s&quot;,<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - start),<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; entryPointClass +&quot;.&quot;+ entryPointMethod));<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<o:p></o:p></p></div><div><p class=MsoNormal>}<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I would run this as follows:<o:p></o:p></p></div><div><p class=MsoNormal>java -Xmx:1024mb -jar mySpark.jar -p cg.spark on -process-dir /Users/jason/Desktop/android/pscout/android_source_dir/ -cp /Users/jason/Desktop/android/pscout/android_source_dir:. -allow-phantom-refs android.content.ClipboardManager hasText<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>The last two args end up being the api class and the api method that I want to start the graph at. &nbsp;<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>When I run this jar I get a &quot;java.lang.OutOfMemoryError: GC overhead limit exceeded&quot; error.&nbsp; I've given the JVM as mucha s 8gb and it still exhausts memory.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Now I must admit that to even get this to work I had to tweak the Soot source code a bit.&nbsp; I had to alter the following:<o:p></o:p></p></div><div><ul type=disc><li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l3 level1 lfo4'>Line 99 in soot/src//soot/asm/SootClassBuilder.java will not throw an exception with my code.&nbsp; The line now prints an error and moves on.&nbsp; As I was reading the code and reading other examples, this is tolerable because Soot still finds the methods in those classes (presumably, as it doesn't throw any errors about not finding methods)<o:p></o:p></li></ul><div><p class=MsoNormal>Can soot handle the entire android framework?<o:p></o:p></p></div></div><div><p class=MsoNormal>Is my method and approach proper?<o:p></o:p></p></div><div><p class=MsoNormal>Are there any indications as to why I'm running into a GC Memory error and how to fix it?<o:p></o:p></p></div><div><p class=MsoNormal>Is my change to soot source code the root of this problem?<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Thank you for any assistance you may provide.<o:p></o:p></p></div></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></body></html>