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

Steven Arzt Steven.Arzt at cased.de
Wed May 20 09:59:34 EDT 2015


Hi Xianxing,

 

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.

 

Best regards,

  Steven

 

Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA]
Im Auftrag von qpj
Gesendet: Mittwoch, 20. Mai 2015 15:21
An: soot-list
Betreff: [Soot-list] How to add additional class into Android App

 

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: 

1.	onCreate(){
2.	    super.onCreate(b);
3.	    setContentView(R.layout.activity_main);
4.	    //TODO
5.	}

At the position TODO, insert the following statements:

1.	Thread thread = new Thread(){
2.	            public void run() {
3.	                       sleep(5000);    
4.	                finish();                  
5.	        }
6.	};
7.	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/87f33759/attachment.html 


More information about the Soot-list mailing list