[Soot-list] How to add additional class into Android App
qpj
412832527 at qq.com
Wed May 20 21:09:13 EDT 2015
Hi Steven,
Yes, that hit the point. Thanks a lot.
Regards,
Xiangxing
------------------ Original ------------------
From: "Steven Arzt";<Steven.Arzt at cased.de>;
Date: Wed, May 20, 2015 09:59 PM
To: "qpj"<412832527 at qq.com>; "'soot-list'"<soot-list at sable.mcgill.ca>;
Subject: AW: [Soot-list] How to add additional class into Android App
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:
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/20150521/a47828c8/attachment.html
More information about the Soot-list
mailing list