我试图通过亚行终端命令发送短信。
$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"')收到的信息只写着“乔”
如果我只发送链接,短信到达好的。如果我对"Joe“执行str_replace替换”for "-“仅发送名称”,则消息到达ok。
我认为问题在于空间“。
这是命令行im使用,SMS到达,所以命令工作,问题是消息本身。
adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+541156409958" s16 "null" s16 "Hi" s16 "null" s16 "null"发布于 2019-05-24 05:25:51
您需要在消息中的每个空格字符之前添加斜杠字符 ()。以下命令将只发送Joe:
adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+541156409958" s16 "null" s16 "Joe Doe. hello" s16 "null" s16 "null"下面的命令将发送Joe。你好:
adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+541156409958" s16 "null" s16 "Joe\ Doe.\ hello" s16 "null" s16 "null"发布于 2021-09-14 18:19:09
您不需要在消息中的每个空格字符之前添加斜杠字符()。这不是恶棍的生活工作吗?试着把你的短信体放在单引号里,你就都完成了。
adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+541156409958" s16 "null" s16 "'Joe Doe. hello'" s16 "null" s16 "null"https://stackoverflow.com/questions/56283196
复制相似问题