Program: 187372
Project: 187372
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Bundle bundle=intent.getExtras();
  if (bundle != null) {
    Object[] pdus=(Object[])bundle.get("String_Node_Str");
    final SmsMessage[] messages=new SmsMessage[pdus.length];
    for (int i=0; i < pdus.length; i++) {
      messages[i]=SmsMessage.createFromPdu((byte[])pdus[i]);
    }
    if (messages.length > -1) {
      if (MessageService.dba == null || Prephase3Activity.sharedPrefs == null) {
        MessageService.dba=new DBAccessor(context);
        Prephase3Activity.sharedPrefs=PreferenceManager.getDefaultSharedPreferences(context);
      }
      String address=messages[0].getOriginatingAddress();
      String secretMessage=null;
      if (MessageService.dba.inDatabase(address)) {
        if (Prephase3Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
          Vibrator vibrator;
          vibrator=(Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
          String value=Prephase3Activity.sharedPrefs.getString("String_Node_Str",VIBRATOR_LENTH);
          vibrator.vibrate(Long.valueOf(value));
        }
        if (MessageService.dba.isTrustedContact((address)) && Prephase3Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
          try {
            SMSUtility.sendToSelf(context,messages[0].getOriginatingAddress(),messages[0].getMessageBody(),Prephase3Activity.INBOX);
            Message newMessage=null;
            if (Prephase3Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
              newMessage=new Message(messages[0].getMessageBody(),true,false);
              MessageService.dba.addNewMessage(newMessage,address,true);
            }
            secretMessage=Encryption.aes_decrypt(MessageService.dba.getRow(SMSUtility.format(address)).getPublicKey(),messages[0].getMessageBody());
            SMSUtility.sendToSelf(context,address,secretMessage,Prephase3Activity.INBOX);
            newMessage=new Message(secretMessage,true,false);
            MessageService.dba.addNewMessage(newMessage,address,true);
          }
 catch (          Exception e) {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
            e.printStackTrace();
          }
        }
 else {
          SMSUtility.sendToSelf(context,address,messages[0].getMessageBody(),Prephase3Activity.INBOX);
          Message newMessage=new Message(messages[0].getMessageBody(),true,false);
          MessageService.dba.addNewMessage(newMessage,address,true);
        }
        Prephase3Activity.updateList(context,Prephase3Activity.messageViewActive);
        MessageService.contentTitle=SMSUtility.format(address);
        if (secretMessage != null) {
          MessageService.contentText=secretMessage;
        }
 else {
          MessageService.contentText=messages[0].getMessageBody();
        }
        Intent serviceIntent=new Intent(context,MessageService.class);
        context.startService(serviceIntent);
        this.abortBroadcast();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Bundle bundle=intent.getExtras();
  if (bundle != null) {
    Object[] pdus=(Object[])bundle.get("String_Node_Str");
    final SmsMessage[] messages=new SmsMessage[pdus.length];
    for (int i=0; i < pdus.length; i++) {
      messages[i]=SmsMessage.createFromPdu((byte[])pdus[i]);
    }
    if (messages.length > -1) {
      if (MessageService.dba == null || Prephase3Activity.sharedPrefs == null) {
        MessageService.dba=new DBAccessor(context);
        Prephase3Activity.sharedPrefs=PreferenceManager.getDefaultSharedPreferences(context);
      }
      String address=messages[0].getOriginatingAddress();
      String secretMessage=null;
      if (MessageService.dba.inDatabase(address)) {
        if (Prephase3Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
          Vibrator vibrator;
          vibrator=(Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
          String value=Prephase3Activity.sharedPrefs.getString("String_Node_Str",VIBRATOR_LENTH);
          vibrator.vibrate(Long.valueOf(value));
        }
        if (MessageService.dba.isTrustedContact((address)) && Prephase3Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
          try {
            SMSUtility.sendToSelf(context,messages[0].getOriginatingAddress(),messages[0].getMessageBody(),Prephase3Activity.INBOX);
            Message newMessage=null;
            if (Prephase3Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
              newMessage=new Message(messages[0].getMessageBody(),true,false);
              MessageService.dba.addNewMessage(newMessage,address,true);
            }
            secretMessage=Encryption.aes_decrypt(MessageService.dba.getRow(SMSUtility.format(address)).getNumber(SMSUtility.format(address)).getPublicKey(),messages[0].getMessageBody());
            SMSUtility.sendToSelf(context,address,secretMessage,Prephase3Activity.INBOX);
            newMessage=new Message(secretMessage,true,false);
            MessageService.dba.addNewMessage(newMessage,address,true);
          }
 catch (          Exception e) {
            Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
            e.printStackTrace();
          }
        }
 else {
          SMSUtility.sendToSelf(context,address,messages[0].getMessageBody(),Prephase3Activity.INBOX);
          Message newMessage=new Message(messages[0].getMessageBody(),true,false);
          MessageService.dba.addNewMessage(newMessage,address,true);
        }
        Prephase3Activity.updateList(context,Prephase3Activity.messageViewActive);
        MessageService.contentTitle=SMSUtility.format(address);
        if (secretMessage != null) {
          MessageService.contentText=secretMessage;
        }
 else {
          MessageService.contentText=messages[0].getMessageBody();
        }
        Intent serviceIntent=new Intent(context,MessageService.class);
        context.startService(serviceIntent);
        this.abortBroadcast();
      }
    }
  }
}