<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=us-ascii"><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;}
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;}
/* List Definitions */
@list l0
        {mso-list-id:1051151624;
        mso-list-template-ids:-1072797796;}
@list l1
        {mso-list-id:1300763196;
        mso-list-template-ids:-2084430424;}
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 Xianxing,<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'>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:"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'>&nbsp; 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>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&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal><i>PackManager.v().getPack(&quot;jtp&quot;).add(new Transform(&quot;jtp.myInstrumenter&quot;, 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;&nbsp; </i></span><i>protected void internalTransform(final Body b, String phaseName, @SuppressWarnings(&quot;rawtypes&quot;) 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:&nbsp;<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?&nbsp;</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:&nbsp;<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;&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;&nbsp; </span></span><span style='color:red'>sleep(5000);<span class=apple-tab-span>&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'>&nbsp; &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;&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?&nbsp;Does anyone meet such problem&nbsp;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></body></html>