如果要在4.4之后实现短信拦截功能,就必须成为default
sms,把所有短信相关的功能都包揽了,然后再做短信拦截。但这种做法,适配性和兼容性的工作是非常巨大的,短信、wapush(多种)、彩信、单双卡等等,相当于要求短信拦截类的软件要集成一个功能非常完善的通讯录类应用的功能。
打开App
Ops的代码
Intent intent = new Intent(Intent.ACTION_MAIN);
ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.Settings");
intent.setComponent(cn);
intent.putExtra(":android:show_fragment", "com.android.settings.applications.AppOpsSummary");
startActivity(intent);
AndroidManifest.xml的配置
短信拦截的代码
转载