android4.0.4源码修改监控短信发送信息


这里以发短信为例,打开/frameworks/base/telephony/java/android/telephony/SmsManager.java,修改源码:

1、增加:import android.util.Log;

2、函数sendTextMessage入口处增加打印log信息的代码:

    public void sendTextMessage(
            String destinationAddress, String scAddress, String text,
            PendingIntent sentIntent, PendingIntent deliveryIntent) {
	Log.v("[apkscan]","[SmsManager::sendTextMessage]destinationAddress: "+destinationAddress+" scAddress: "+scAddress+" text: "+text);
        if (TextUtils.isEmpty(destinationAddress)) {
            throw new IllegalArgumentException("Invalid destinationAddress");
        }

        if (TextUtils.isEmpty(text)) {
            throw new IllegalArgumentException("Invalid message body");
        }

        try {
            ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms"));
            if (iccISms != null) {
                iccISms.sendText(destinationAddress, scAddress, text, sentIntent, deliveryIntent);
            }
        } catch (RemoteException ex) {
            // ignore it
        }
    }
如图:



3、编译,这个时候不需要全部编译的,只需要make systemimage来编译即可,大约十几分钟后复制出
/out/target/product/generic/system.img,替换掉android-sdk\system-images\android-15\armeabi-v7a目录下的system.img

4、运行模拟器,开启logcat捕获log信息,随便发送一个短信,截获到log:




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

asmcvc

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值