For example, enter *#* #55555 #*#* in the Dial-up panel to launch an app with no icon, with the package name and class name com.zms.test/. Main
Enter 55555 in the calculator and press = To start the application as well. This can be done in the following ways:
The first is dialing:
Modify File Packages/apps/dialer/src/com/android/dialer/specialcharsequencemgr.java
@@ -66,6 +66,7 @@ -66,6 class Specialcharsequencemgr {private static final String Mmi_imei_display = "* #06 #"; private static final String device_test = "* #66 #"; + private static final string zms_mode = "*#* #55555 #*#*"; private static final String Mmi_regulatory_info_display = "* #07 #"; private static String project_name = Systemproperties.get ("Ro.esky.target.project"); @@ -158,6 +159,13 @@ -158,6 class Spe Cialcharsequencemgr {return true; } + if (Input.equals (Zms_mode)) {+ Intent Intent = new Intent (); + intent.setcomponent (NE W componentname ("Com.zms.test", "Com.zms.test.Main")); + context.startactivity (intent); + Return Tru e;+}+ if (len > 8 && input.startswith ("*#*#") && input.endswith ("#*#*")) { Intent Intent = new Intent (telephonyintents.secret_code_action, Uri.parse ("android_secret_code://" + I Nput.substring (4, Len-4));
Then look at the calculator:
Modify File Packages/apps/calculator/src/com/android/calculator2/logic.java
Import Org.javia.arity.symbols;import Org.javia.arity.syntaxexception;+import Android.app.activity;+import Android.content.componentname;+import android.content.intent;class Logic {private Calculatordisplay mDisplay; Private Symbols Msymbols = new Symbols () @@ -41,6 +44,7 @@ -41,6 Logic {private int mlinelength = 0; private static final String infinity_unicode = "\u221e"; + private static final string zms_number = "55555"; public static final String Marker_evaluate_on_resume = "?"; @@ -178,6 +182,14 @@ -178,6 Logic {public void Evaluateandshowresult (String text, Scroll Scroll) {try { String result = Evaluate (text), + + if (text.equals (zms_number)) + {+ Intent int ent = new Intent (); + intent.setcomponent (New ComponentName ("Com.zms.test", "Com.zms.test.Main"); + Mcontext.startactivity (intent); +}+ if (!text.equals (Result)) {MHISTORY.E Nter (text); Mresult = result;
Reprint Please specify source: Zhou Mushi's csdn blog Http://blog.csdn.net/zhoumushui
My github: Zhou Mushi's GitHub Https://github.com/zhoumushui
Android adds a cipher in the dial-up and calculator to launch the specified app