http://blog.udinic.com/2013/05/17/create-a-secret-doorway-to-your-app
Check this link out.
Here is a sample piece of code. In your manifest, declare your receiver and with a secret code for example: 111222
Then create the receiver:
public class DiagnoserReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
if ("android.provider.Telephony.SECRET_CODE".equals(intent.getAction())) {
//Do your increment here
}
}
}
I suppose if you want multiple numbers, you can add the variants of codes that your app will listen for:
EDIT: You can try this SO post I found
only to match the beginning of host. The rules are these:
Put * as the first character of the host.
Write the rest of of the host until the end.
android:host=“site.com"
android:pathPattern=".”
android:scheme=“http” />
It will catch links of:
www.site.com
site.com
mail.site.com
So you should be able to wildcard the font of the
In theory it should work for 0034 ... 9934
**CAUTION: **
Anyone can decompile your app and see the codes in the manifest file. So whatever you do, make sure it is secured. IE. If you open an activity from the receiver, make sure the activity asks for a password first.
OR
Another way to be more safe is to register the broadcast receiver in your MainApplication class in onCreate - add intentFilters to your liking, this way your codes are not exposed in the android manifest file but it will not work if your app is completely closed or swiped away. Simply open the app, (wait for the broadcast receiver to register), minimise it, type in your code, and voila.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)