注入代码可能会用加入自身的寄存器,而注入类的方法调用则不需要额外增加寄存器。

比如注入下面的类:

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中注入的最好的方式。




更多相关文章

  1. android使用activitygroup和Scrollview的方法
  2. android studio中gradle更新办法
  3. Android中获取文件路径的方法总结及对照
  4. Android调试程序技巧
  5. 安卓巴士自测试题-第二期
  6. Android(安卓)stuido 快捷键
  7. Android(安卓)蓝牙开发浅析
  8. Android--launcher启动过程解析
  9. android8.1 系统应用使用FileProvider时提示没有权限

随机推荐

  1. ubuntu 12.04 下安装android编译环境
  2. Android(安卓)Google应用移植时包依赖关
  3. cordova打包android apk
  4. Android下载完文件打开
  5. 给android设置代理
  6. android 存储操作 大小显示换算 kb mb KB
  7. Android(安卓)对.properties文件的读取
  8. android 开发 实例 下部主导航(1)
  9. Android(安卓)app widget 支持的Layout和
  10. android ArcGIS学习笔记一