[Soot-list] How to add additional class into Android App

qpj 412832527 at qq.com
Wed May 20 09:21:16 EDT 2015


Hi List,
I'm instrumenting some Android Apps using 
PackManager.v().getPack("jtp").add(new Transform("jtp.myInstrumenter", new BodyTransformer() {
	protected void internalTransform(final Body b, String phaseName, @SuppressWarnings("rawtypes") Map options) {}}


What I can do: 
Modify method: units.add(unit), units.insert(unit,u)...
Add method to sootclass: sc.add(method)
Modify sootclass: Modify fields, Modify methods.
Then how to add a new class into Andorid App? 


For example, bofore instrumenting: 

onCreate(){

    super.onCreate(b);

    setContentView(R.layout.activity_main);

    //TODO

}

At the position TODO, insert the following statements:

Thread thread = new Thread(){

	public void run() {

		sleep(5000);	

                finish();		

        }

};

thread.start();

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.


Sincerely


Xiangxing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150520/ab89877e/attachment.html 


More information about the Soot-list mailing list