Program: 35659
Project: 35659
Buggy source:
@SuppressLint("String_Node_Str") @Override public void onMessageReceived(RemoteMessage remoteMessage){
  if (remoteMessage.getData() != null) {
    try {
      PushMessage pushMessage=new PushMessage();
      pushMessage.setSubject(remoteMessage.getData().get("String_Node_Str"));
      pushMessage.setSignature(remoteMessage.getData().get("String_Node_Str"));
      byte[] base64DecodedSubject=android.util.Base64.decode(pushMessage.getSubject(),Base64.DEFAULT);
      byte[] base64DecodedSignature=android.util.Base64.decode(pushMessage.getSignature(),Base64.DEFAULT);
      PushUtils pushUtils=new PushUtils();
      PrivateKey privateKey=(PrivateKey)pushUtils.readKeyFromFile(false);
      try {
        SignatureVerification signatureVerification=pushUtils.verifySignature(base64DecodedSignature,base64DecodedSubject);
        if (signatureVerification.isSignatureValid()) {
          Cipher cipher=Cipher.getInstance("String_Node_Str");
          cipher.init(Cipher.DECRYPT_MODE,privateKey);
          byte[] decryptedSubject=cipher.doFinal(base64DecodedSubject);
          DecryptedPushMessage decryptedPushMessage=LoganSquare.parse(new String(decryptedSubject),DecryptedPushMessage.class);
          if (decryptedPushMessage.getApp().equals("String_Node_Str")) {
            int smallIcon;
            Bitmap largeIcon;
            String category="String_Node_Str";
            int priority=Notification.PRIORITY_DEFAULT;
            Uri soundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
            Intent intent=new Intent(this,CallActivity.class);
            BundleBuilder bundleBuilder=new BundleBuilder(new Bundle());
            bundleBuilder.putString("String_Node_Str",decryptedPushMessage.getId());
            bundleBuilder.putParcelable("String_Node_Str",signatureVerification.getUserEntity());
            intent.putExtras(bundleBuilder.build());
            PendingIntent pendingIntent=PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
            NotificationManager notificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
switch (decryptedPushMessage.getType()) {
case "String_Node_Str":
              smallIcon=R.drawable.ic_call_black_24dp;
            category=Notification.CATEGORY_CALL;
          priority=Notification.PRIORITY_HIGH;
        soundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
      break;
case "String_Node_Str":
    smallIcon=R.drawable.ic_notifications_black_24dp;
  category=Notification.CATEGORY_CALL;
priority=Notification.PRIORITY_HIGH;
break;
case "String_Node_Str":
smallIcon=R.drawable.ic_chat_black_24dp;
category=Notification.CATEGORY_MESSAGE;
break;
default :
smallIcon=R.drawable.ic_logo;
}
largeIcon=BitmapFactory.decodeResource(getResources(),smallIcon);
CRC32 crc32=new CRC32();
Notification.Builder notificationBuilder=new Notification.Builder(this).setSmallIcon(smallIcon).setLargeIcon(largeIcon).setColor(getColor(R.color.colorPrimary)).setCategory(category).setPriority(priority).setWhen(Calendar.getInstance().getTimeInMillis()).setShowWhen(true).setSubText(signatureVerification.getUserEntity().getDisplayName()).setContentTitle(decryptedPushMessage.getSubject()).setSound(soundUri).setAutoCancel(true);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
String groupName=String.format(getResources().getString(R.string.nc_notification_channel),signatureVerification.getUserEntity().getDisplayName(),signatureVerification.getUserEntity().getBaseUrl());
crc32.update(groupName.getBytes());
NotificationUtils.createNotificationChannelGroup(notificationManager,Long.toString(crc32.getValue()),groupName);
if (category.equals(Notification.CATEGORY_CALL)) {
NotificationUtils.createNotificationChannel(notificationManager,NotificationUtils.NOTIFICATION_CHANNEL_CALLS,getResources().getString(R.string.nc_notification_channel_calls),getResources().getString(R.string.nc_notification_channel_calls_description),true,NotificationManager.IMPORTANCE_HIGH);
notificationBuilder.setChannelId(NotificationUtils.NOTIFICATION_CHANNEL_CALLS);
}
 else {
NotificationUtils.createNotificationChannel(notificationManager,NotificationUtils.NOTIFICATION_CHANNEL_MESSAGES,getResources().getString(R.string.nc_notification_channel_messages),getResources().getString(R.string.nc_notification_channel_messages_description),true,NotificationManager.IMPORTANCE_DEFAULT);
notificationBuilder.setChannelId(NotificationUtils.NOTIFICATION_CHANNEL_MESSAGES);
}
notificationBuilder.setGroup(Long.toString(crc32.getValue()));
}
notificationBuilder.setContentIntent(pendingIntent);
String stringForCrc=decryptedPushMessage.getSubject() + "String_Node_Str" + signatureVerification.getUserEntity().getDisplayName()+ "String_Node_Str"+ signatureVerification.getUserEntity().getBaseUrl();
crc32=new CRC32();
crc32.update(stringForCrc.getBytes());
notificationManager.notify((int)crc32.getValue(),notificationBuilder.build());
}
}
}
 catch (NoSuchAlgorithmException e1) {
Log.d(TAG,"String_Node_Str" + e1.getLocalizedMessage());
}
catch (NoSuchPaddingException e1) {
Log.d(TAG,"String_Node_Str" + e1.getLocalizedMessage());
}
catch (InvalidKeyException e1) {
Log.d(TAG,"String_Node_Str" + e1.getLocalizedMessage());
}
}
 catch (Exception exception) {
Log.d(TAG,"String_Node_Str" + exception.getLocalizedMessage());
}
}
 else {
Log.d(TAG,"String_Node_Str");
}
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") @Override public void onMessageReceived(RemoteMessage remoteMessage){
  if (remoteMessage.getData() != null) {
    try {
      PushMessage pushMessage=new PushMessage();
      pushMessage.setSubject(remoteMessage.getData().get("String_Node_Str"));
      pushMessage.setSignature(remoteMessage.getData().get("String_Node_Str"));
      byte[] base64DecodedSubject=android.util.Base64.decode(pushMessage.getSubject(),Base64.DEFAULT);
      byte[] base64DecodedSignature=android.util.Base64.decode(pushMessage.getSignature(),Base64.DEFAULT);
      PushUtils pushUtils=new PushUtils();
      PrivateKey privateKey=(PrivateKey)pushUtils.readKeyFromFile(false);
      try {
        SignatureVerification signatureVerification=pushUtils.verifySignature(base64DecodedSignature,base64DecodedSubject);
        if (signatureVerification.isSignatureValid()) {
          Cipher cipher=Cipher.getInstance("String_Node_Str");
          cipher.init(Cipher.DECRYPT_MODE,privateKey);
          byte[] decryptedSubject=cipher.doFinal(base64DecodedSubject);
          DecryptedPushMessage decryptedPushMessage=LoganSquare.parse(new String(decryptedSubject),DecryptedPushMessage.class);
          if (decryptedPushMessage.getApp().equals("String_Node_Str")) {
            int smallIcon;
            Bitmap largeIcon;
            String category="String_Node_Str";
            int priority=Notification.PRIORITY_DEFAULT;
            Uri soundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
            Intent intent=new Intent(this,CallActivity.class);
            BundleBuilder bundleBuilder=new BundleBuilder(new Bundle());
            bundleBuilder.putString("String_Node_Str",decryptedPushMessage.getId());
            bundleBuilder.putParcelable("String_Node_Str",Parcels.wrap(signatureVerification.getUserEntity()));
            bundleBuilder.putBoolean("String_Node_Str",true);
            intent.putExtras(bundleBuilder.build());
            PendingIntent pendingIntent=PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
            NotificationManager notificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
switch (decryptedPushMessage.getType()) {
case "String_Node_Str":
              smallIcon=R.drawable.ic_call_black_24dp;
            category=Notification.CATEGORY_CALL;
          priority=Notification.PRIORITY_HIGH;
        soundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
      break;
case "String_Node_Str":
    smallIcon=R.drawable.ic_notifications_black_24dp;
  category=Notification.CATEGORY_CALL;
priority=Notification.PRIORITY_HIGH;
break;
case "String_Node_Str":
smallIcon=R.drawable.ic_chat_black_24dp;
category=Notification.CATEGORY_MESSAGE;
break;
default :
smallIcon=R.drawable.ic_logo;
}
largeIcon=BitmapFactory.decodeResource(getResources(),smallIcon);
CRC32 crc32=new CRC32();
Notification.Builder notificationBuilder=new Notification.Builder(this).setSmallIcon(smallIcon).setLargeIcon(largeIcon).setColor(getColor(R.color.colorPrimary)).setCategory(category).setPriority(priority).setWhen(Calendar.getInstance().getTimeInMillis()).setShowWhen(true).setSubText(signatureVerification.getUserEntity().getDisplayName()).setContentTitle(decryptedPushMessage.getSubject()).setSound(soundUri).setAutoCancel(true);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
String groupName=String.format(getResources().getString(R.string.nc_notification_channel),signatureVerification.getUserEntity().getDisplayName(),signatureVerification.getUserEntity().getBaseUrl());
crc32.update(groupName.getBytes());
NotificationUtils.createNotificationChannelGroup(notificationManager,Long.toString(crc32.getValue()),groupName);
if (category.equals(Notification.CATEGORY_CALL)) {
NotificationUtils.createNotificationChannel(notificationManager,NotificationUtils.NOTIFICATION_CHANNEL_CALLS,getResources().getString(R.string.nc_notification_channel_calls),getResources().getString(R.string.nc_notification_channel_calls_description),true,NotificationManager.IMPORTANCE_HIGH,soundUri);
notificationBuilder.setChannelId(NotificationUtils.NOTIFICATION_CHANNEL_CALLS);
}
 else {
NotificationUtils.createNotificationChannel(notificationManager,NotificationUtils.NOTIFICATION_CHANNEL_MESSAGES,getResources().getString(R.string.nc_notification_channel_messages),getResources().getString(R.string.nc_notification_channel_messages_description),true,NotificationManager.IMPORTANCE_DEFAULT,soundUri);
notificationBuilder.setChannelId(NotificationUtils.NOTIFICATION_CHANNEL_MESSAGES);
}
notificationBuilder.setGroup(Long.toString(crc32.getValue()));
}
notificationBuilder.setContentIntent(pendingIntent);
String stringForCrc=decryptedPushMessage.getSubject() + "String_Node_Str" + signatureVerification.getUserEntity().getDisplayName()+ "String_Node_Str"+ signatureVerification.getUserEntity().getBaseUrl();
crc32=new CRC32();
crc32.update(stringForCrc.getBytes());
notificationManager.notify((int)crc32.getValue(),notificationBuilder.build());
}
}
}
 catch (NoSuchAlgorithmException e1) {
Log.d(TAG,"String_Node_Str" + e1.getLocalizedMessage());
}
catch (NoSuchPaddingException e1) {
Log.d(TAG,"String_Node_Str" + e1.getLocalizedMessage());
}
catch (InvalidKeyException e1) {
Log.d(TAG,"String_Node_Str" + e1.getLocalizedMessage());
}
}
 catch (Exception exception) {
Log.d(TAG,"String_Node_Str" + exception.getLocalizedMessage());
}
}
 else {
Log.d(TAG,"String_Node_Str");
}
}