Program: 17555
Project: 17555
Buggy source:
public ReportDialog(final RashrActivity activity,String message){
  super(activity);
  final Shell shell=activity.getShell();
  final Device device=activity.getDevice();
  final Toolbox toolbox=activity.getToolbox();
  final ArrayList<String> errors=activity.getErrors();
  setTitle(R.string.comment);
  setContentView(R.layout.dialog_comment);
  final EditText text=(EditText)findViewById(R.id.etComment);
  if (!message.equals("String_Node_Str"))   text.setText(message);
  new Thread(new Runnable(){
    @Override public void run(){
      final Button bGo=(Button)findViewById(R.id.bGo);
      bGo.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          if (!Common.getBooleanPref(activity,Const.PREF_NAME,Const.PREF_KEY_ADS))           Toast.makeText(activity,R.string.please_ads,Toast.LENGTH_SHORT).show();
          Toast.makeText(activity,R.string.donate_to_support,Toast.LENGTH_SHORT).show();
          try {
            ArrayList<File> files=new ArrayList<>();
            File TestResults=new File(activity.getFilesDir(),"String_Node_Str");
            try {
              if (TestResults.exists()) {
                if (TestResults.delete()) {
                  FileOutputStream fos=activity.openFileOutput(TestResults.getName(),Context.MODE_PRIVATE);
                  fos.write(("String_Node_Str" + shell.execCommand("String_Node_Str" + Const.PathToRashr.getAbsolutePath()) + "String_Node_Str"+ shell.execCommand("String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ shell.execCommand("String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ shell.execCommand("String_Node_Str")).getBytes());
                }
                files.add(TestResults);
              }
            }
 catch (            Exception e) {
              activity.addError(Const.RASHR_TAG,e,false);
            }
            if (activity.getPackageManager() != null) {
              PackageInfo pInfo=activity.getPackageManager().getPackageInfo(activity.getPackageName(),0);
              String comment="String_Node_Str";
              if (text.getText() != null)               comment=text.getText().toString();
              Intent intent=new Intent(Intent.ACTION_SEND_MULTIPLE);
              intent.setType("String_Node_Str");
              intent.putExtra(Intent.EXTRA_EMAIL,new String[]{"String_Node_Str"});
              intent.putExtra(Intent.EXTRA_SUBJECT,"String_Node_Str" + pInfo.versionCode + "String_Node_Str");
              String message="String_Node_Str" + "String_Node_Str" + pInfo.packageName + "String_Node_Str"+ pInfo.versionName;
              message+="String_Node_Str" + "String_Node_Str" + Build.MANUFACTURER + "String_Node_Str"+ device.getManufacture()+ "String_Node_Str"+ "String_Node_Str"+ Build.DEVICE+ "String_Node_Str"+ device.getName()+ "String_Node_Str"+ "String_Node_Str"+ Build.BOARD+ "String_Node_Str"+ Build.BRAND+ "String_Node_Str"+ Build.MODEL+ "String_Node_Str"+ Build.FINGERPRINT+ "String_Node_Str"+ Build.VERSION.CODENAME+ "String_Node_Str"+ Build.VERSION.SDK_INT+ "String_Node_Str";
              if (device.isRecoverySupported()) {
                message+="String_Node_Str" + device.getRecoveryPath() + "String_Node_Str"+ device.getRecoveryVersion()+ "String_Node_Str"+ device.isRecoveryMTD()+ "String_Node_Str"+ device.isRecoveryDD()+ "String_Node_Str"+ device.isStockRecoverySupported()+ "String_Node_Str"+ device.isCwmRecoverySupported()+ "String_Node_Str"+ device.isTwrpRecoverySupported()+ "String_Node_Str"+ device.isPhilzRecoverySupported();
              }
              if (device.isKernelSupported()) {
                message+="String_Node_Str" + device.getKernelPath() + "String_Node_Str"+ device.getKernelVersion()+ "String_Node_Str"+ device.isKernelMTD()+ "String_Node_Str"+ device.isKernelDD();
              }
              if (!comment.equals("String_Node_Str")) {
                message+="String_Node_Str" + comment + "String_Node_Str";
              }
              message+="String_Node_Str" + activity.getAllPrefs() + "String_Node_Str";
              files.add(new File(activity.getFilesDir(),Shell.Logs));
              files.add(new File(activity.getFilesDir(),"String_Node_Str"));
              ArrayList<Uri> uris=new ArrayList<>();
              File tmpFolder=new File(activity.getFilesDir(),"String_Node_Str");
              if (tmpFolder.mkdir())               tmpFolder.deleteOnExit();
              for (              File i : files) {
                try {
                  File tmp=new File(tmpFolder,i.getName());
                  shell.execCommand(Const.Busybox + "String_Node_Str" + i);
                  toolbox.copyFile(i,tmp,true,false);
                  toolbox.setFilePermissions(tmp,"String_Node_Str");
                  shell.execCommand(Const.Busybox + "String_Node_Str" + tmp);
                }
 catch (                Exception e) {
                  activity.addError(Const.RASHR_TAG,e,false);
                }
              }
              if (errors.size() > 0) {
                message+="String_Node_Str";
                for (                String error : errors) {
                  message+=error + "String_Node_Str";
                }
              }
              intent.putExtra(Intent.EXTRA_TEXT,message);
              intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,uris);
              activity.startActivity(Intent.createChooser(intent,"String_Node_Str"));
              dismiss();
            }
          }
 catch (          Exception e) {
            dismiss();
            activity.addError(Const.RASHR_TAG,e,false);
          }
        }
      }
);
    }
  }
).start();
}

Fixed version (ground truth):
public ReportDialog(final RashrActivity activity,String message){
  super(activity);
  final Shell shell=activity.getShell();
  final Device device=activity.getDevice();
  final ArrayList<String> errors=activity.getErrors();
  setTitle(R.string.comment);
  setContentView(R.layout.dialog_comment);
  final EditText text=(EditText)findViewById(R.id.etComment);
  if (!message.equals("String_Node_Str"))   text.setText(message);
  new Thread(new Runnable(){
    @Override public void run(){
      final Button bGo=(Button)findViewById(R.id.bGo);
      bGo.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          if (!Common.getBooleanPref(activity,Const.PREF_NAME,Const.PREF_KEY_ADS))           Toast.makeText(activity,R.string.please_ads,Toast.LENGTH_SHORT).show();
          Toast.makeText(activity,R.string.donate_to_support,Toast.LENGTH_SHORT).show();
          try {
            ArrayList<File> files=new ArrayList<>();
            File TestResults=new File(activity.getFilesDir(),"String_Node_Str");
            try {
              if (TestResults.exists()) {
                if (TestResults.delete()) {
                  FileOutputStream fos=activity.openFileOutput(TestResults.getName(),Context.MODE_PRIVATE);
                  fos.write(("String_Node_Str" + shell.execCommand("String_Node_Str" + Const.PathToRashr.getAbsolutePath()) + "String_Node_Str"+ shell.execCommand("String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ shell.execCommand("String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ shell.execCommand("String_Node_Str")).getBytes());
                }
                files.add(TestResults);
              }
            }
 catch (            Exception e) {
              activity.addError(Const.RASHR_TAG,e,false);
            }
            if (activity.getPackageManager() != null) {
              PackageInfo pInfo=activity.getPackageManager().getPackageInfo(activity.getPackageName(),0);
              String comment="String_Node_Str";
              if (text.getText() != null)               comment=text.getText().toString();
              Intent intent=new Intent(Intent.ACTION_SEND_MULTIPLE);
              intent.setType("String_Node_Str");
              intent.putExtra(Intent.EXTRA_EMAIL,new String[]{"String_Node_Str"});
              intent.putExtra(Intent.EXTRA_SUBJECT,"String_Node_Str" + pInfo.versionCode + "String_Node_Str");
              String message="String_Node_Str" + "String_Node_Str" + pInfo.packageName + "String_Node_Str"+ pInfo.versionName;
              message+="String_Node_Str" + "String_Node_Str" + Build.MANUFACTURER + "String_Node_Str"+ device.getManufacture()+ "String_Node_Str"+ "String_Node_Str"+ Build.DEVICE+ "String_Node_Str"+ device.getName()+ "String_Node_Str"+ "String_Node_Str"+ Build.BOARD+ "String_Node_Str"+ Build.BRAND+ "String_Node_Str"+ Build.MODEL+ "String_Node_Str"+ Build.FINGERPRINT+ "String_Node_Str"+ Build.VERSION.CODENAME+ "String_Node_Str"+ Build.VERSION.SDK_INT+ "String_Node_Str";
              if (device.isRecoverySupported()) {
                message+="String_Node_Str" + device.getRecoveryPath() + "String_Node_Str"+ device.getRecoveryVersion()+ "String_Node_Str"+ device.isRecoveryMTD()+ "String_Node_Str"+ device.isRecoveryDD()+ "String_Node_Str"+ device.isStockRecoverySupported()+ "String_Node_Str"+ device.isCwmRecoverySupported()+ "String_Node_Str"+ device.isTwrpRecoverySupported()+ "String_Node_Str"+ device.isPhilzRecoverySupported();
              }
              if (device.isKernelSupported()) {
                message+="String_Node_Str" + device.getKernelPath() + "String_Node_Str"+ device.getKernelVersion()+ "String_Node_Str"+ device.isKernelMTD()+ "String_Node_Str"+ device.isKernelDD();
              }
              if (!comment.equals("String_Node_Str")) {
                message+="String_Node_Str" + comment + "String_Node_Str";
              }
              message+="String_Node_Str" + activity.getAllPrefs() + "String_Node_Str";
              files.add(new File(activity.getFilesDir(),Shell.Logs));
              files.add(new File(activity.getFilesDir(),Const.LastLog.getName()));
              ArrayList<Uri> uris=new ArrayList<>();
              for (              File i : files) {
                try {
                  shell.execCommand(Const.Busybox + "String_Node_Str" + i);
                }
 catch (                Exception e) {
                  activity.addError(Const.RASHR_TAG,e,false);
                }
              }
              if (errors.size() > 0) {
                message+="String_Node_Str";
                for (                String error : errors) {
                  message+=error + "String_Node_Str";
                }
              }
              intent.putExtra(Intent.EXTRA_TEXT,message);
              intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,uris);
              activity.startActivity(Intent.createChooser(intent,"String_Node_Str"));
              dismiss();
            }
          }
 catch (          Exception e) {
            dismiss();
            activity.addError(Const.RASHR_TAG,e,false);
          }
        }
      }
);
    }
  }
).start();
}