didi / DroidAssist

A lightweight Android Studio gradle plugin based on Javassist for editing bytecode in Android.
Apache License 2.0
890 stars 150 forks source link

遗憾的是对于Activity的生命周期不能修改 #9

Closed XWC95 closed 5 years ago

XWC95 commented 5 years ago
 <BeforeMethodCall>
          <Source>void com.didichuxing.tools.test.MainActivity.onCreate(android.os.Binder)</Source>
          <Target>{java.lang.System.out.println("成功");}</Target>
</BeforeMethodCall>
yuqiang0713 commented 5 years ago

Binder

函数签名配置错了吧 应该是Bundle不是Binder

wangwang1069 commented 5 years ago

Activity 的 onCreate 的方法的调用是在系统侧调用,APP无法在系统代码里插入相关逻辑,这里可以改用 BeforeMethodExecution 在 onCreate 方法执行时插入逻辑

void com.didichuxing.tools.test.MainActivity.onCreate(android.os.Binder) {java.lang.System.out.println("成功");}