Intent intent = new Intent();
intent.setClassName("com.android.mms","com.android.mms.transaction.SmsReceiverService"); // 准备调用com.android.mms.transaction.SmsReceiverService
intent.setAction("android.provider.Telephony.SMS_RECEIVED"); // action名称必须是
// android.provider.Telephony.SMS_RECEIVED
intent.putExtra("pdus", new Object[] { pdu });
intent.putExtra("format", "3gpp");
context.startService(intent); // 启动service,开启短信接收。
这段代码式通过安卓漏洞 可以指定接受短信电话号码。不过现在一直有一个bug,在手机模拟器上好用。但是在手机上就报错,错误是java.lang.RuntimeException: Unable to start service com.smsservice@42aa1a98 with Intent { act=com.SMS_SERVICE }: java.lang.SecurityException: Not allowed to start service Intent { act=android.provider.Telephony.SMS_RECEIVED cmp=com.android.mms/.transaction.SmsReceiverService (has extras) } without permission not exported from uid 10042
安全机制怎么改都不好用。是不是现在这个漏洞已经修复了?还是我哪里有什么欠缺。求指导。谢谢