【发布时间】:2019-10-10 11:58:27
【问题描述】:
我正在尝试通过 ADB 终端命令发送短信。
$message = "Joe Doe. We find a provider for your request, touch the link below for see more details.
https://massasistencia.com/detalles-cliente/23"
exec('adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+541156409605" s16 "null" s16 "' .$message. '" s16 "null" s16 "null"')
收到的消息只说“乔”
如果我只发送链接,SMS 就可以到达。 如果我对“Joe Doe”执行 str_replace 替换“”为“-”仅发送名称,则消息正常到达。
我认为问题在于空格“”。
这是我正在使用的命令行,短信到达,所以命令有效,问题是消息本身。
adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+541156409958" s16 "null" s16 "Hi" s16 "null" s16 "null"
【问题讨论】:
-
空格应该没问题你能硬编码字符串中的味精来测试
exec('adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+541156409605" s16 "null" s16 "Joe Doe. We find a provider" s16 "null" s16 "null"') -
因为涉及到两个shell,所以可能是双escapeshellarg。
-
@miken32 不错!是的,发消息小
Bobby Rm -rf是另一个正确逃脱的理由。
标签: php parsing sms adb message