【问题标题】:can I send "SMS received intent"?我可以发送“收到短信的意图”吗?
【发布时间】:2012-09-19 14:53:23
【问题描述】:

标题很明显。我可以在安卓手机上发送“短信接收意图”吗?换句话说,虚拟接收自定义 SMS 以伪造某些 SMS 接收器。

【问题讨论】:

  • 仅供参考,我相信这是系统意图,您不能广播它。

标签: android sms


【解决方案1】:

您可以创建假短信(GMS 类型),以便像真实消息一样内置捕捉。这里是my answer

 Intent intent = new Intent();
intent.setClassName("com.android.mms",
        "com.android.mms.transaction.SmsReceiverService");
intent.setAction("android.provider.Telephony.SMS_RECEIVED");
intent.putExtra("pdus", new Object[] { pdu });
intent.putExtra("format", "3gpp");
context.startService(intent);

【讨论】:

  • 我收到此错误:原因:java.lang.SecurityException:不允许启动服务 Intent { act=android.provider.Telephony.SMS_RECEIVED cmp=com.android.mms/.transaction.SmsReceiverService (有附加功能)} 未经许可未从 uid 10045 导出
  • 我在清单中有这个权限:
猜你喜欢
  • 2017-01-22
  • 2012-04-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-29
  • 1970-01-01
相关资源
最近更新 更多