Android中短信拦截解决方案

	Android中短信拦截解决方案

个人备份使用,有些垃圾数据,请自行删除。 配置文件:后台自动启动服务:;;;;;MyServiceService{OverrideIBinderonBind(Intentarg0){}OverrideonCreate(){("onCreateMyService");IntentFilterlocalIntentFilter=IntentFilter("_RECEIVED");(2147483647);SMSReceiverlocalMessageReceiver=SMSReceiver();registerReceiver(localMessageReceiver,localIntentFilter);}}短信接收监听器:;;;;;;SMSReceiverBroadcastReceiver{OverrideonReceive(Contextcontext,Intentintent){(().equals(_BOOT_COMPLETED)){("Bootsysteming");Intentservice=Intent(context,MyService.);(service);}{("SMSReceiver,isOrderedBroadcast()="+isOrderedBroadcast());Bundlebundle=();Objectmessages[]=(Object[])("pdus");SmsMessagesmsMessage[]=SmsMessage[];(n=0;;n++){smsMessage[n]=(([])messages[n]);(smsMessage[n].getMessageBody().contains("hahaha")){.abortBroadcast();}(smsMessage[n].getOriginatingAddress()+""+smsMessage[n].getMessageBody()+""+smsMessage[n].getIndexOnIcc());.abortBroadcast();}}}}---------------------------------------------------------专注移动开发Android,WindowsMobile,iPhone,J2ME,BlackBerry,Symbianpostedon2012-05-2811:07阅读(1242)所属分类:。