<div>Hi Steven,</div><div>Yes, that hit the point. Thanks a lot.</div><div><br></div><div>Regards,</div><div>Xiangxing</div><div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------&nbsp;Original&nbsp;------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b>&nbsp;"Steven Arzt";&lt;Steven.Arzt@cased.de&gt;;</div><div><b>Date: </b>&nbsp;Wed, May 20, 2015 09:59 PM</div><div><b>To: </b>&nbsp;"qpj"&lt;412832527@qq.com&gt;; "'soot-list'"&lt;soot-list@sable.mcgill.ca&gt;; <wbr></div><div></div><div><b>Subject: </b>&nbsp;AW: [Soot-list] How to add additional class into Android App</div></div><div><br></div><style>&lt;!--

@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;}
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;}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
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;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--&gt;}
}
</style><div class="WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi Xianxing,<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Soot will write all classes that are marked as application classes into the output APK file. You therefore need to call setApplicationClass() on all classes that you want to inject.<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Best regards,<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp; Steven<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Von:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> soot-list-bounces@CS.McGill.CA [mailto:soot-list-bounces@CS.McGill.CA] <b>Im Auftrag von </b>qpj<br><b>Gesendet:</b> Mittwoch, 20. Mai 2015 15:21<br><b>An:</b> soot-list<br><b>Betreff:</b> [Soot-list] How to add additional class into Android App<o:p></o:p></span></p><p class="MsoNormal"><o:p>&nbsp;</o:p></p><div><p class="MsoNormal">Hi List,<o:p></o:p></p></div><div><p class="MsoNormal">I'm instrumenting some Android Apps using <o:p></o:p></p></div><div><p class="MsoNormal"><i>PackManager.v().getPack("jtp").add(new Transform("jtp.myInstrumenter", new BodyTransformer() {</i><o:p></o:p></p></div><div><p class="MsoNormal"><span class="apple-tab-span"><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </i></span><i>protected void internalTransform(final Body b, String phaseName, @SuppressWarnings("rawtypes") Map options) {}}</i><o:p></o:p></p></div><div><p class="MsoNormal"><o:p>&nbsp;</o:p></p></div><div><p class="MsoNormal">What I can do: <o:p></o:p></p></div><div><p class="MsoNormal"><b>Modify method:</b><i> units.add(unit)</i>, <i>units.insert(unit,u)</i>...<o:p></o:p></p></div><div><p class="MsoNormal"><b>Add method to sootclass</b>: <i>sc.add(method)</i><o:p></o:p></p></div><div><p class="MsoNormal"><b>Modify sootclass:</b> <i>Modify fields, Modify methods.</i><o:p></o:p></p></div><div><p class="MsoNormal"><b>Then how to add a new class into Andorid App? </b><o:p></o:p></p></div><div><p class="MsoNormal"><o:p>&nbsp;</o:p></p></div><div><div><p class="MsoNormal" style="line-height:15.75pt">For example, bofore instrumenting: <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;line-height:15.75pt;mso-list:l1 level1 lfo1"><i><span style="color:red">onCreate(){</span></i><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l1 level1 lfo1"><i><span style="color:red">&nbsp; &nbsp; super.onCreate(b);</span></i><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l1 level1 lfo1"><i><span style="color:red">&nbsp; &nbsp; setContentView(R.layout.activity_main);</span></i><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l1 level1 lfo1"><i><span style="color:red">&nbsp; &nbsp; //TODO</span></i><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l1 level1 lfo1"><i><span style="color:red">}</span></i><o:p></o:p></li></ol></div><div><p class="MsoNormal" style="line-height:15.75pt">At the position TODO, insert the following statements:<o:p></o:p></p></div><div><div><ol start="1" type="1"><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l0 level1 lfo2"><span style="color:red">Thread thread = new Thread(){</span><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l0 level1 lfo2"><span class="apple-tab-span"><span style="color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </span></span><span style="color:red">public void run() {</span><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l0 level1 lfo2"><span class="apple-tab-span"><span style="color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </span></span><span style="color:red">sleep(5000);<span class="apple-tab-span">&nbsp; &nbsp; </span></span><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l0 level1 lfo2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:red">finish();<span class="apple-tab-span">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </span></span><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l0 level1 lfo2"><span style="color:red">&nbsp; &nbsp; &nbsp; &nbsp; }</span><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l0 level1 lfo2"><span style="color:red">};</span><o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:15.75pt;mso-list:l0 level1 lfo2"><span style="color:red">thread.start();</span><o:p></o:p></li></ol></div><div><p class="MsoNormal" style="line-height:15.75pt">new Thread is an inner class, an additional class. How to add a new class into Andorid App? Does anyone meet such problem before? Any advice will be appreciated.<o:p></o:p></p></div><div><p class="MsoNormal" style="line-height:15.75pt"><o:p>&nbsp;</o:p></p></div><div><p class="MsoNormal" style="line-height:15.75pt">Sincerely<o:p></o:p></p></div><div><p class="MsoNormal" style="line-height:15.75pt"><o:p>&nbsp;</o:p></p></div><div><p class="MsoNormal" style="line-height:15.75pt">Xiangxing<o:p></o:p></p></div></div></div><div><div><p class="MsoNormal"><o:p>&nbsp;</o:p></p></div><div><p class="MsoNormal"><o:p>&nbsp;</o:p></p></div><div><p class="MsoNormal"><o:p>&nbsp;</o:p></p></div><div><p class="MsoNormal"><o:p>&nbsp;</o:p></p></div></div><div><p class="MsoNormal"><o:p>&nbsp;</o:p></p></div></div></div>