Program: 35590
Project: 35590
Buggy source:
@NonNull @Override protected Result onRunJob(Params params){
  NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
  Context context=getContext();
  PersistableBundleCompat persistableBundleCompat=getParams().getExtras();
  String subject=persistableBundleCompat.getString(BundleKeys.KEY_NOTIFICATION_SUBJECT,"String_Node_Str");
  String signature=persistableBundleCompat.getString(BundleKeys.KEY_NOTIFICATION_SIGNATURE,"String_Node_Str");
  if (!TextUtils.isEmpty(subject) && !TextUtils.isEmpty(signature)) {
    try {
      byte[] base64DecodedSubject=Base64.decode(subject,Base64.DEFAULT);
      byte[] base64DecodedSignature=Base64.decode(signature,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);
          boolean hasChatSupport=signatureVerification.getUserEntity().hasSpreedCapabilityWithName("String_Node_Str");
          boolean isInTheSameRoomAsNotification=ApplicationWideCurrentRoomHolder.getInstance().getCurrentRoomId().equals(decryptedPushMessage.getId()) && signatureVerification.getUserEntity().equals(ApplicationWideCurrentRoomHolder.getInstance().getUserInRoom());
          boolean shouldShowNotification=decryptedPushMessage.getApp().equals("String_Node_Str") && !(isInTheSameRoomAsNotification && !decryptedPushMessage.getType().equals("String_Node_Str"));
          if (shouldShowNotification) {
            int smallIcon;
            Bitmap largeIcon;
            String category="String_Node_Str";
            int priority=Notification.PRIORITY_DEFAULT;
            Uri soundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
            Intent intent;
            Bundle bundle=new Bundle();
            if (hasChatSupport) {
              intent=new Intent(context,MainActivity.class);
              intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
            }
 else {
              intent=new Intent(context,CallActivity.class);
              bundle.putBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL,true);
            }
            bundle.putString(BundleKeys.KEY_ROOM_ID,decryptedPushMessage.getId());
            bundle.putParcelable(BundleKeys.KEY_USER_ENTITY,Parcels.wrap(signatureVerification.getUserEntity()));
            bundle.putBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL,decryptedPushMessage.getType().equals("String_Node_Str") || !hasChatSupport);
            intent.putExtras(bundle);
            PendingIntent pendingIntent=PendingIntent.getActivity(context,0,intent,PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
            NotificationManager notificationManager=(NotificationManager)context.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(context.getResources(),smallIcon);
CRC32 crc32=new CRC32();
Notification.Builder notificationBuilder=new Notification.Builder(context).setLargeIcon(largeIcon).setSmallIcon(smallIcon).setCategory(category).setPriority(priority).setWhen(Calendar.getInstance().getTimeInMillis()).setShowWhen(true).setSubText(signatureVerification.getUserEntity().getDisplayName()).setContentTitle(decryptedPushMessage.getSubject()).setSound(soundUri).setAutoCancel(true);
if (Build.VERSION.SDK_INT >= 23) {
notificationBuilder.setColor(context.getResources().getColor(R.color.colorPrimary));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
String groupName=String.format(context.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,context.getResources().getString(R.string.nc_notification_channel_calls),context.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,context.getResources().getString(R.string.nc_notification_channel_messages),context.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());
if (notificationManager != null) {
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());
}
}
return Result.SUCCESS;
}

Fixed version (ground truth):
@NonNull @Override protected Result onRunJob(Params params){
  NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
  Context context=getContext();
  PersistableBundleCompat persistableBundleCompat=getParams().getExtras();
  String subject=persistableBundleCompat.getString(BundleKeys.KEY_NOTIFICATION_SUBJECT,"String_Node_Str");
  String signature=persistableBundleCompat.getString(BundleKeys.KEY_NOTIFICATION_SIGNATURE,"String_Node_Str");
  if (!TextUtils.isEmpty(subject) && !TextUtils.isEmpty(signature)) {
    try {
      byte[] base64DecodedSubject=Base64.decode(subject,Base64.DEFAULT);
      byte[] base64DecodedSignature=Base64.decode(signature,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);
          boolean hasChatSupport=signatureVerification.getUserEntity().hasSpreedCapabilityWithName("String_Node_Str");
          boolean isInTheSameRoomAsNotification=ApplicationWideCurrentRoomHolder.getInstance().getCurrentRoomId().equals(decryptedPushMessage.getId()) && signatureVerification.getUserEntity().equals(ApplicationWideCurrentRoomHolder.getInstance().getUserInRoom());
          boolean shouldShowNotification=decryptedPushMessage.getApp().equals("String_Node_Str") && (!isInTheSameRoomAsNotification || decryptedPushMessage.getType().equals("String_Node_Str"));
          if (shouldShowNotification) {
            int smallIcon;
            Bitmap largeIcon;
            String category="String_Node_Str";
            int priority=Notification.PRIORITY_DEFAULT;
            Uri soundUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
            Intent intent;
            Bundle bundle=new Bundle();
            if (hasChatSupport) {
              intent=new Intent(context,MainActivity.class);
              intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
            }
 else {
              intent=new Intent(context,CallActivity.class);
              bundle.putBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL,true);
            }
            bundle.putString(BundleKeys.KEY_ROOM_ID,decryptedPushMessage.getId());
            bundle.putParcelable(BundleKeys.KEY_USER_ENTITY,Parcels.wrap(signatureVerification.getUserEntity()));
            bundle.putBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL,decryptedPushMessage.getType().equals("String_Node_Str") || !hasChatSupport);
            intent.putExtras(bundle);
            PendingIntent pendingIntent=PendingIntent.getActivity(context,0,intent,PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
            NotificationManager notificationManager=(NotificationManager)context.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(context.getResources(),smallIcon);
CRC32 crc32=new CRC32();
Notification.Builder notificationBuilder=new Notification.Builder(context).setLargeIcon(largeIcon).setSmallIcon(smallIcon).setCategory(category).setPriority(priority).setWhen(Calendar.getInstance().getTimeInMillis()).setShowWhen(true).setSubText(signatureVerification.getUserEntity().getDisplayName()).setContentTitle(decryptedPushMessage.getSubject()).setSound(soundUri).setAutoCancel(true);
if (Build.VERSION.SDK_INT >= 23) {
notificationBuilder.setColor(context.getResources().getColor(R.color.colorPrimary));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
String groupName=String.format(context.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,context.getResources().getString(R.string.nc_notification_channel_calls),context.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,context.getResources().getString(R.string.nc_notification_channel_messages),context.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());
if (notificationManager != null) {
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());
}
}
return Result.SUCCESS;
}