<div>Hi List,</div><div><span style="line-height: 1.5;">I'm instrumenting some Android Apps using&nbsp;</span></div><div><i>PackManager.v().getPack("jtp").add(new Transform("jtp.myInstrumenter", new BodyTransformer() {</i></div><div><i><span class="Apple-tab-span" style="white-space: pre;">        </span>protected void internalTransform(final Body b, String phaseName, @SuppressWarnings("rawtypes") Map options) {}}</i></div><div><b><br></b></div><div><span style="line-height: 1.5;">What I can do:&nbsp;</span></div><div><b>Modify method:</b><i> units.add(unit)</i>, <i>units.insert(unit,u)</i>...</div><div><b>Add method to sootclass</b>: <i>sc.add(method)</i></div><div><b>Modify sootclass:</b> <i>Modify fields, Modify methods.</i></div><div><b>Then how to add a new class into Andorid App?&nbsp;</b></div><div><font color="#ff0000"><b><br></b></font></div><div><div style="line-height: 21px;">For example, b<span style="line-height: 1.5;">ofore instrumenting:&nbsp;</span></div><div style="line-height: 21px;"><ol><li><i style="line-height: 1.5; color: rgb(255, 0, 0);">onCreate(){</i></li><li><i style="line-height: 1.5; color: rgb(255, 0, 0);">&nbsp; &nbsp; super.onCreate(b);</i></li><li><i style="line-height: 1.5; color: rgb(255, 0, 0);">&nbsp; &nbsp; setContentView(R.layout.activity_main);</i></li><li><i style="line-height: 1.5; color: rgb(255, 0, 0);">&nbsp; &nbsp; //TODO</i></li><li><i style="line-height: 1.5; color: rgb(255, 0, 0);">}</i></li></ol></div><div style="line-height: 21px;">At the position TODO, insert the following statements:</div><div style="line-height: 21px;"><div><ol><li><span style="line-height: 1.5; color: rgb(255, 0, 0);">Thread thread = new Thread(){</span></li><li><span class="Apple-tab-span" style="line-height: 1.5; color: rgb(255, 0, 0); white-space: pre;">        </span><span style="line-height: 1.5; color: rgb(255, 0, 0);">public void run() {</span></li><li><font color="#ff0000"><span class="Apple-tab-span" style="white-space: pre;">                </span>sleep(5000);</font><span class="Apple-tab-span" style="line-height: 1.5; color: rgb(255, 0, 0); white-space: pre;">        </span></li><li><span style="line-height: 1.5;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="line-height: 1.5;">&nbsp;</span><font color="#ff0000">finish();<span class="Apple-tab-span" style="line-height: 1.5; white-space: pre;">        </span></font><span class="Apple-tab-span" style="line-height: 1.5; color: rgb(255, 0, 0); white-space: pre;">        </span></li><li><span style="color: rgb(255, 0, 0); line-height: 1.5;">&nbsp; &nbsp; &nbsp; &nbsp; }</span></li><li><span style="line-height: 1.5; color: rgb(255, 0, 0);">};</span></li><li><span style="line-height: 1.5; color: rgb(255, 0, 0);">thread.start();</span></li></ol></div><div>new Thread is an inner class, an additional class. How to add a new class into Andorid App?<span style="line-height: 1.5;">&nbsp;Does anyone meet such problem&nbsp;</span><span style="line-height: 1.5;">before? Any advice will be appreciated.</span></div><div><span style="line-height: 1.5;"><br></span></div><div>Sincerely</div><div><br></div><div>Xiangxing</div></div></div><div><div><font color="#ff0000"><br></font></div><div><br></div><div><br></div><div><font color="#ff0000"><br></font></div></div><div><br></div>