更新时间:2022-12-22 16:34:17
简短版本:
Android 5及更低版本(此处为android 4):
Android 5 and older (here android 4):
adb shell service call isms 5 s16 "com.android.mms" s16 "+01234567890" s16 "+01SMSCNUMBER" s16 "Hello world !" i32 0 i32 0
Android 5和更高版本(此处为android 9):
Android 5 and later (here android 9):
adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+1234567890" s16 "null" s16 "Hey\ you\ !" s16 "null" s16 "null"
错误方法编号(以上5和7)可能会随android版本。阅读完整的说明以了解它。
Isms method number (5 and 7 above) may change with the android version . Read full explanation to understand it.
所有android版本的完整说明:
是的!但不能使用此命令,因为这些输入事件在睡眠模式下被阻止。
此解决方案取决于您的android版本,所以我将向您解释几乎所有版本...
Yes it exists ! but not with this command, because these input events are blocked in sleep mode. This solution depends on your android version, so I'm going to explain you for almost all version ...
第一,请检查您是否拥有该服务通过运行isms:
1st, check if you have the service isms by running :
adb shell service check isms
Service isms: found
找到答案了,很好,继续前进。服务isms具有各种选项,语法为:
The answer is found, good, keep moving. The service isms have various "options" the syntax is :
service call name_service option args
可以通过键入以下内容找到服务名称:
The service name can be found by typing :
adb shell service list
它将显示很多可用的服务,但有趣的是:
It will display a lot of services avaible, but the interesting line is :
5 isms: [com.android.internal.telephony.ISms]
您可以看到com.android.internal.telephony.Isms,因此在链接选择您的Android版本(通过更改分支),然后导航至: telephony / java / com / android / internal / telephony
并打开 Isms.aidl
You can see com.android.internal.telephony.Isms, so on this link choose your android version (by changing branch), then navigate to : telephony/java/com/android/internal/telephony
and open Isms.aidl
其余的我将使用android Pie(android 9)文件(链接)。
For the rest I will take the android Pie (android 9) file (link).
在 185 我们有:
避免sendTextForSubscriberWithSelfPermissions(...)
void sendTextForSubscriberWithSelfPermissions(...)
注意:在Android 5之前该方法名为 sendText(...)
。
Note : before android 5 the method is named sendText(...)
.
这是ISMS接口中的第七个声明。因此,我们发送短信的选项是数字7。在声明的顶部,是对参数的解释。这里是一个简短的版本:
It is the 7th declaration in the interface ISMS . So our option to send a sms is the number 7. On the top of the declaratio there is the explanation of the arguments. Here a short version:
->查找您的软件包名称:
浏览您的应用程序文件或在Google Play上下载软件包名称查看器,找到您的消息应用程序并复制名称(com.android ... )
-> Find your package name : Explore your app file or download Package Name Viewer on google play, find your message application and copy the name (com.android...)
->查找您的短信:
在您的应用程序->设置-> SMSC或服务中心或消息中心等中,复制数字显示(请勿更改)
-> Find your smsc : In your application -> settings -> SMSC or Service Center or Message Center etc, copy the number display (DON'T CHANGE IT)
仅在fi之前在服务中修饰字符串是由s16 和 integers和PendingIntent与i32声明的。
Just before finishing, in services the strings are declared by s16 and integers and PendingIntent with i32.
我们有:
最后:
Android 5及更低版本(此处为android 4):
Android 5 and older (here android 4):
adb shell service call isms 5 s16 "com.android.mms" s16 "+01234567890" s16 "+01000000000" s16 "Hello world !" i32 0 i32 0
Android 5和更高版本(此处为android 9):
Android 5 and later (here android 9):
adb shell service call isms 7 i32 0 s16 "com.android.mms.service" s16 "+1234567890" s16 "null" s16 "'Hey you !'" s16 "null" s16 "null"
->批处理文件中的示例:
android 4的send.bat:
The send.bat for android 4 :
echo off
set num=%1
shift
for /f "tokens=1,* delims= " %%a in ("%*") do set ALL_BUT_FIRST=%%b
echo %ALL_BUT_FIRST%
adb shell service call isms 5 s16 "com.android.mms" s16 "%num%" s16 "+01000000000" s16 "%ALL_BUT_FIRST%" i32 0 i32 0
运行以下命令:
send.bat +01234567890 Hey you !
现在告诉我它是否适用于您的Android版本:)
Now tell me if it works with your android version :)