android_secret_code拨号事件

android_secret_code拨号事件

智能机内部都存在一些隐藏代码,例如,Android拨号键盘输入类似*#*#4636#*#*字符执行对应操作,这个功能在Android中被称为android secret code,除了系统预置的secret code,第三方app也可以实现自己的secret code,AndroidManifest.xml中有如下内容表示支持android的拨号事件:

<receiver android:name=”.SecretReceiver”>
<intent-filter>
<action android:name=”android.provider.Telephony.SECRET_CODE”/>
<data android:scheme=”android_secret_code” android:host=”1234″/>
</intent-filter>
</receiver>

Secret Codes 能够扫描出设备中隐藏代码,除了直接在拨号键盘输入*#*#1234#*#*,也可以通过am命令模拟发送广播执行:

#adb shell am broadcast -a android.provider.Telephony.SECRET_CODE  -d android_secret_code://1234

不同的Receiver可以注册相同的android:host,可能会跟其他应用的设置冲突。

6san.com

评论已关闭。