android注入代码之注入类方法
16lz
2021-01-24
注入代码可能会用加入自身的寄存器,而注入类的方法调用则不需要额外增加寄存器。
比如注入下面的类:
package com.taobao.IntentRcvSec;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
public class LogIntent {
public static void LogIntent(Object intentObj) {
// TODO Auto-generated method stub
Intent intent = (Intent)intentObj;
Bundle bundle = intent.getExtras();
if ( bundle != null ) {
Log.d("WINSUN", bundle.toString());
}
}
}
在对方的方法里面只要下面这样:
invoke-static {v2}, Lcom/taobao/IntentSendSec/LogIntent;->LogIntent(Ljava/lang/Object;)V
就可以了。显然v2寄存器的值是上下文相关的,不需要我们额外的增加寄存器。
个人认为注入类是android中注入的最好的方式。
更多相关文章
- android使用activitygroup和Scrollview的方法
- android studio中gradle更新办法
- Android中获取文件路径的方法总结及对照
- Android调试程序技巧
- 安卓巴士自测试题-第二期
- Android(安卓)stuido 快捷键
- Android(安卓)蓝牙开发浅析
- Android--launcher启动过程解析
- android8.1 系统应用使用FileProvider时提示没有权限