android更改暗码
在Contact应用程序下的SpecialCharSequenceMgr.java下的
在Contact应用程序下的SpecialCharSequenceMgr.java下的
static boolean handleSecretCode(Context context, String input) {
// Secret codes are in the form *#*#<code>#*#*
int len = input.length();
if (len > 8 && input.startsWith("*#*#") && input.endsWith("#*#*")) {
Intent intent = new Intent(Intents.SECRET_CODE_ACTION,
Uri.parse("android_secret_code://" + input.substring(4, len - 4)));
context.sendBroadcast(intent);
return true;
}else if (input.equals("*998#"))
{
Intent intent2 = new Intent();
intent2.setAction("com.android.phone.ACTION_FACTORY_MODE");
context.sendBroadcast(intent2);
return true;
}
return false;
<p> }</p><p>
</p><p><div> 他自动检测到*#*#
想了一个办法,直接在我要启动的APK的配置文件里加上
<span style="white-space:pre"> </span><intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data android:scheme="android_secret_code" android:host="6666" />
</intent-filter>
这样来启动我的暗码
<img src="https://img-blog.youkuaiyun.com/20160719180129228?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
图片中需要加 intent.setAction<span style="font-family: Arial, Helvetica, sans-serif;">("com.android.phone.ACTION_FACTORY_MODE");</span>
);