簡單記錄html
好比要hook一個app包中一個類的private void c(dmp dmp1),其中dmp是個類,這種的處理的方式以下:android
用cydiasubstrate hook框架app
1.先經過hook 一個返回context對象的函數,好比SafeApplication類中的public static Context a()獲取到context
public static Context a()
{
Invoke.print();
return g;
}框架
2.構造類dmp函數
3.Class<?> maClass = Class.forName("dmp", true, Application.cont.getClassLoader()); ui
method = clazz.getDeclaredMethod("c", maClass);.net
Context c = createPackageContext("chroya.demo", Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
Class clazz = c.getClassLoader().loadClass("chroya.demo.Main");unix
或者Class<?> maClass = Class.forName("com.android.settings.ManageApplications", true, mmsCtx.getClassLoader()); htm
http://www.cnblogs.com/Greenwood/archive/2011/04/02/2003803.html
http://blog.chinaunix.net/uid-27024249-id-3284292.html
http://wenku.baidu.com/view/12e5a340336c1eb91a375d9d.html對象