gpt4 book ai didi

android - 使用 ADB shell (Android SDK) 的服务调用 isms?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:39:11 29 4
gpt4 key购买 nike

您知道在 Android 上使用 adb shell 命令“service call isms”吗?这是我使用的完整命令:service call isms 5 s16 "PhoneNumber"i32 0 i32 0 s16 "BodyText"。

有一些参数但我不知道它是什么意思(5, s16, i32, 0)。有什么地方有手册吗?对我来说最重要的是当短信没有成功发送时出现错误(大约 10% 的短信没有发送)=> 这个问题已经问过但没有答案(https://stackoverflow.com/questions/17395546/get-status-sms-from-isms-service-using-shell-adb-android-sdk)。

我不想使用命令(adb shell am start -a android.intent.action.SENDTO -d sms:CCXXXXXXXXXX --es sms_body "SMS BODY GOES HERE"--ez exit_on_sent trueadb shell 输入keyevent 22adb shell 输入keyevent 66)因为它使用图形界面。

你能帮帮我吗? (对不起,我不会说英语。所以,我希望你理解我的请求)

非常感谢

最佳答案

在每个“服务调用”命令中,您需要输入:

  • 您要调用的服务,在本例中为“isms”;
  • 您要调用的“函数”,在本例中为“5”(稍后会详细介绍);
  • 函数参数。

有两种可能的参数:字符串整数。在输入整数参数之前,您需要使用 i32 指定其类型。字符串参数也是如此,但您需要编写 s16

大多数“服务调用”命令没有文档,或者很少。
对于 ISms,您可以在此处查看:http://www.androidjavadoc.com/1.0_r1_src/constant-values.html获取可能的功能及其编号代码的列表。按 ctrl-f 并输入 ISms 以快速访问。

ISms 服务的“5”函数是来自 Android API 的 ISms 接口(interface)的sendMultipartText 函数。 Here is the doc about this function. And here is the implementation class from the API.

因此,service call isms 5 s16 "PhoneNumber"i32 0 i32 0 s16 "BodyText",等于:

Call the sendMultipartText function from the ISms service with the String parameter "PhoneNumber", the Integer parameter 0, the Integer parameter 0 and the String parameter "BodyText".

回答你的问题,我很确定没有办法知道是否从命令行发送了短信......但也许如果你比我更深入一点在 API 中,您会找到一种方法。

关于android - 使用 ADB shell (Android SDK) 的服务调用 isms?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17719898/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com