Program: 162460
Project: 162460
Buggy source:
private void showPopup(View v,final AppDataParcelable rowItem){
  v.setOnClickListener(view -> {
    PopupMenu popupMenu=new PopupMenu(app.getActivity(),view);
    popupMenu.setOnMenuItemClickListener(item -> {
      int colorAccent=themedActivity.getColorPreference().getColor(ColorUsage.ACCENT);
switch (item.getItemId()) {
case R.id.open:
        Intent i1=app.getActivity().getPackageManager().getLaunchIntentForPackage(rowItem.packageName);
      if (i1 != null)       app.startActivity(i1);
 else       Toast.makeText(app.getActivity(),app.getResources().getString(R.string.not_allowed),Toast.LENGTH_LONG).show();
    return true;
case R.id.share:
  ArrayList<File> arrayList2=new ArrayList<File>();
arrayList2.add(new File(rowItem.path));
themedActivity.getColorPreference();
FileUtils.shareFiles(arrayList2,app.getActivity(),utilsProvider.getAppTheme(),colorAccent);
return true;
case R.id.unins:
final HybridFileParcelable f1=new HybridFileParcelable(rowItem.path);
f1.setMode(OpenMode.ROOT);
if ((Integer.valueOf(rowItem.data.substring(0,rowItem.data.indexOf("String_Node_Str"))) & ApplicationInfo.FLAG_SYSTEM) != 0) {
if (app.Sp.getBoolean(PreferencesConstants.PREFERENCE_ROOTMODE,false)) {
MaterialDialog.Builder builder1=new MaterialDialog.Builder(app.getActivity());
builder1.theme(utilsProvider.getAppTheme().getMaterialDialogTheme()).content(app.getResources().getString(R.string.unin_system_apk)).title(app.getResources().getString(R.string.warning)).negativeColor(colorAccent).positiveColor(colorAccent).negativeText(app.getResources().getString(R.string.no)).positiveText(app.getResources().getString(R.string.yes)).callback(new MaterialDialog.ButtonCallback(){
@Override public void onNegative(MaterialDialog materialDialog){
materialDialog.cancel();
}
@Override public void onPositive(MaterialDialog materialDialog){
ArrayList<HybridFileParcelable> files=new ArrayList<>();
if (Build.VERSION.SDK_INT >= 21) {
String parent=f1.getParent();
if (!parent.equals("String_Node_Str") && !parent.equals("String_Node_Str")) {
HybridFileParcelable baseFile=new HybridFileParcelable(f1.getParent());
baseFile.setMode(OpenMode.ROOT);
files.add(baseFile);
}
 else files.add(f1);
}
 else {
files.add(f1);
}
new DeleteTask(app.getActivity().getContentResolver(),app.getActivity()).execute((files));
}
}
).build().show();
}
 else {
Toast.makeText(app.getActivity(),app.getResources().getString(R.string.enablerootmde),Toast.LENGTH_SHORT).show();
}
}
 else {
app.unin(rowItem.packageName);
}
return true;
case R.id.play:
Intent intent1=new Intent(Intent.ACTION_VIEW);
intent1.setData(Uri.parse("String_Node_Str" + rowItem.packageName));
app.startActivity(intent1);
return true;
case R.id.properties:
app.startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS,Uri.parse("String_Node_Str" + rowItem.packageName)));
return true;
case R.id.backup:
Toast.makeText(app.getActivity(),app.getResources().getString(R.string.copyingapk) + Environment.getExternalStorageDirectory().getPath() + "String_Node_Str",Toast.LENGTH_LONG).show();
File f=new File(rowItem.path);
ArrayList<HybridFileParcelable> ab=new ArrayList<>();
File dst=new File(Environment.getExternalStorageDirectory().getPath() + "String_Node_Str");
if (!dst.exists() || !dst.isDirectory()) dst.mkdirs();
Intent intent=new Intent(app.getActivity(),CopyService.class);
HybridFileParcelable baseFile=RootHelper.generateBaseFile(f,true);
baseFile.setName(rowItem.label + "String_Node_Str" + rowItem.packageName.substring(rowItem.packageName.indexOf("String_Node_Str") + 1)+ "String_Node_Str");
ab.add(baseFile);
intent.putParcelableArrayListExtra(CopyService.TAG_COPY_SOURCES,ab);
intent.putExtra(CopyService.TAG_COPY_TARGET,dst.getPath());
intent.putExtra(CopyService.TAG_COPY_OPEN_MODE,0);
ServiceWatcherUtil.runService(app.getActivity(),intent);
return true;
}
return false;
}
);
popupMenu.inflate(R.menu.app_options);
popupMenu.show();
}
);
}

Fixed version (ground truth):
private void showPopup(View v,final AppDataParcelable rowItem){
  v.setOnClickListener(view -> {
    PopupMenu popupMenu=new PopupMenu(app.getActivity(),view);
    popupMenu.setOnMenuItemClickListener(item -> {
      int colorAccent=themedActivity.getColorPreference().getColor(ColorUsage.ACCENT);
switch (item.getItemId()) {
case R.id.open:
        Intent i1=app.getActivity().getPackageManager().getLaunchIntentForPackage(rowItem.packageName);
      if (i1 != null)       app.startActivity(i1);
 else       Toast.makeText(app.getActivity(),app.getResources().getString(R.string.not_allowed),Toast.LENGTH_LONG).show();
    return true;
case R.id.share:
  ArrayList<File> arrayList2=new ArrayList<File>();
arrayList2.add(new File(rowItem.path));
themedActivity.getColorPreference();
FileUtils.shareFiles(arrayList2,app.getActivity(),utilsProvider.getAppTheme(),colorAccent);
return true;
case R.id.unins:
final HybridFileParcelable f1=new HybridFileParcelable(rowItem.path);
f1.setMode(OpenMode.ROOT);
if ((Integer.valueOf(rowItem.data.substring(0,rowItem.data.indexOf("String_Node_Str"))) & ApplicationInfo.FLAG_SYSTEM) != 0) {
if (app.Sp.getBoolean(PreferencesConstants.PREFERENCE_ROOTMODE,false)) {
MaterialDialog.Builder builder1=new MaterialDialog.Builder(app.getActivity());
builder1.theme(utilsProvider.getAppTheme().getMaterialDialogTheme()).content(app.getResources().getString(R.string.unin_system_apk)).title(app.getResources().getString(R.string.warning)).negativeColor(colorAccent).positiveColor(colorAccent).negativeText(app.getResources().getString(R.string.no)).positiveText(app.getResources().getString(R.string.yes)).onNegative(((dialog,which) -> dialog.cancel())).onPositive(((dialog,which) -> {
ArrayList<HybridFileParcelable> files=new ArrayList<>();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
String parent=f1.getParent(context);
if (!parent.equals("String_Node_Str") && !parent.equals("String_Node_Str")) {
HybridFileParcelable baseFile=new HybridFileParcelable(f1.getParent(context));
baseFile.setMode(OpenMode.ROOT);
files.add(baseFile);
}
 else files.add(f1);
}
 else {
files.add(f1);
}
new DeleteTask(app.getActivity().getContentResolver(),app.getActivity()).execute((files));
}
)).build().show();
}
 else {
Toast.makeText(app.getActivity(),app.getResources().getString(R.string.enablerootmde),Toast.LENGTH_SHORT).show();
}
}
 else {
app.unin(rowItem.packageName);
}
return true;
case R.id.play:
Intent intent1=new Intent(Intent.ACTION_VIEW);
try {
intent1.setData(Uri.parse(String.format("String_Node_Str",rowItem.packageName)));
app.startActivity(intent1);
}
 catch (ActivityNotFoundException ifPlayStoreNotInstalled) {
intent1.setData(Uri.parse(String.format("String_Node_Str",rowItem.packageName)));
app.startActivity(intent1);
}
return true;
case R.id.properties:
app.startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS,Uri.parse(String.format("String_Node_Str",rowItem.packageName))));
return true;
case R.id.backup:
Toast.makeText(app.getActivity(),app.getResources().getString(R.string.copyingapk) + Environment.getExternalStorageDirectory().getPath() + "String_Node_Str",Toast.LENGTH_LONG).show();
File f=new File(rowItem.path);
ArrayList<HybridFileParcelable> ab=new ArrayList<>();
File dst=new File(Environment.getExternalStorageDirectory().getPath() + "String_Node_Str");
if (!dst.exists() || !dst.isDirectory()) dst.mkdirs();
Intent intent=new Intent(app.getActivity(),CopyService.class);
HybridFileParcelable baseFile=RootHelper.generateBaseFile(f,true);
baseFile.setName(rowItem.label + "String_Node_Str" + rowItem.packageName.substring(rowItem.packageName.indexOf("String_Node_Str") + 1)+ "String_Node_Str");
ab.add(baseFile);
intent.putParcelableArrayListExtra(CopyService.TAG_COPY_SOURCES,ab);
intent.putExtra(CopyService.TAG_COPY_TARGET,dst.getPath());
intent.putExtra(CopyService.TAG_COPY_OPEN_MODE,0);
ServiceWatcherUtil.runService(app.getActivity(),intent);
return true;
}
return false;
}
);
popupMenu.inflate(R.menu.app_options);
popupMenu.show();
}
);
}