Program: 25676
Project: 25676
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Bundle extras=getIntent().getExtras();
  final String action=getIntent().getAction();
  final int[] uids=(extras != null && extras.containsKey(cUidList) ? extras.getIntArray(cUidList) : new int[0]);
  final String restriction=(extras != null ? extras.getString(cRestriction) : null);
  if (action.equals(ACTION_IMPORT) || action.equals(ACTION_EXPORT)) {
    if (!Util.isProEnabled() && Util.hasProLicense(this) == null) {
      Util.viewUri(this,ActivityMain.cProUri);
      finish();
      return;
    }
  }
 else   if (action.equals(ACTION_FETCH)) {
    if (Util.hasProLicense(this) == null) {
      Util.viewUri(this,ActivityMain.cProUri);
      finish();
      return;
    }
  }
  if (action.equals(ACTION_SUBMIT) && !registerDevice(this)) {
    finish();
    return;
  }
  if (extras.containsKey(cInteractive) && extras.getBoolean(cInteractive,false)) {
    String themeName=PrivacyManager.getSetting(null,0,PrivacyManager.cSettingTheme,"String_Node_Str",false);
    mThemeId=(themeName.equals("String_Node_Str") ? R.style.CustomTheme : R.style.CustomTheme_Light);
    setTheme(mThemeId);
    setContentView(R.layout.sharelist);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    if (action.equals(ACTION_TOGGLE)) {
      mActionId=R.string.menu_restriction_all;
      setTitle(R.string.menu_restriction_all);
    }
 else     if (action.equals(ACTION_IMPORT)) {
      mActionId=R.string.menu_import;
      setTitle(R.string.menu_import);
    }
 else     if (action.equals(ACTION_EXPORT)) {
      mActionId=R.string.menu_export;
      setTitle(R.string.menu_export);
    }
 else     if (action.equals(ACTION_FETCH)) {
      mActionId=R.string.menu_fetch;
      setTitle(R.string.menu_fetch);
    }
 else     if (action.equals(ACTION_SUBMIT)) {
      mActionId=R.string.menu_submit;
      setTitle(R.string.menu_submit);
    }
 else {
      finish();
      return;
    }
    ListView lvShare=(ListView)findViewById(R.id.lvShare);
    AppListTask appListTask=new AppListTask();
    appListTask.executeOnExecutor(mExecutor,uids,restriction);
    registerForContextMenu(lvShare);
    if (action.equals(ACTION_EXPORT) || action.equals(ACTION_IMPORT)) {
      Intent file=new Intent(Intent.ACTION_GET_CONTENT);
      file.setType("String_Node_Str");
      boolean hasIntent=Util.isIntentAvailable(ActivityShare.this,file);
      if (action.equals(ACTION_EXPORT))       mFileName=getFileName(this,hasIntent);
 else       mFileName=(hasIntent ? null : getFileName(this,false));
      if (mFileName == null)       fileChooser();
 else       showFileName();
    }
 else {
      TextView tvDescription=(TextView)findViewById(R.id.tvDescription);
      tvDescription.setText(getBaseURL(ActivityShare.this));
    }
    final Button btnOk=(Button)findViewById(R.id.btnOk);
    final Button btnCancel=(Button)findViewById(R.id.btnCancel);
    if (action.equals(ACTION_SUBMIT) || action.equals(ACTION_FETCH) || action.equals(ACTION_TOGGLE))     btnOk.setEnabled(true);
    btnOk.setOnClickListener(new Button.OnClickListener(){
      @Override public void onClick(      View v){
        btnOk.setEnabled(false);
        if (action.equals(ACTION_TOGGLE)) {
          mRunning=true;
          new ToggleTask().executeOnExecutor(mExecutor,restriction);
        }
        if (action.equals(ACTION_IMPORT)) {
          mRunning=true;
          new ImportTask().executeOnExecutor(mExecutor,new File(mFileName));
        }
 else         if (action.equals(ACTION_EXPORT)) {
          mRunning=true;
          new ExportTask().executeOnExecutor(mExecutor,new File(mFileName));
        }
 else         if (action.equals(ACTION_FETCH)) {
          if (uids.length > 0) {
            mRunning=true;
            new FetchTask().executeOnExecutor(mExecutor);
          }
        }
 else         if (action.equals(ACTION_SUBMIT)) {
          if (uids.length > 0) {
            if (uids.length <= cSubmitLimit) {
              mRunning=true;
              new SubmitTask().executeOnExecutor(mExecutor);
            }
 else {
              String message=getString(R.string.msg_limit,ActivityShare.cSubmitLimit + 1);
              Toast.makeText(ActivityShare.this,message,Toast.LENGTH_SHORT).show();
              btnOk.setEnabled(false);
            }
          }
        }
      }
    }
);
    btnCancel.setOnClickListener(new Button.OnClickListener(){
      @Override public void onClick(      View v){
        if (mRunning) {
          mAbort=true;
          Toast.makeText(ActivityShare.this,getString(R.string.msg_abort),Toast.LENGTH_SHORT).show();
        }
 else         finish();
      }
    }
);
  }
 else   if (action.equals(ACTION_EXPORT)) {
    mThemeId=android.R.style.Theme_NoDisplay;
    setTheme(mThemeId);
    List<Integer> listUid=new ArrayList<Integer>();
    for (    PackageInfo pInfo : getPackageManager().getInstalledPackages(0))     if (!listUid.contains(pInfo.applicationInfo.uid))     listUid.add(pInfo.applicationInfo.uid);
    String fileName=(extras != null && extras.containsKey(cFileName) ? extras.getString(cFileName) : getFileName(this,false));
    new ExportTask().executeOnExecutor(mExecutor,new File(fileName),listUid);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Bundle extras=getIntent().getExtras();
  final String action=getIntent().getAction();
  final int[] uids=(extras != null && extras.containsKey(cUidList) ? extras.getIntArray(cUidList) : new int[0]);
  final String restriction=(extras != null ? extras.getString(cRestriction) : null);
  if (action.equals(ACTION_IMPORT) || action.equals(ACTION_EXPORT)) {
    if (!Util.isProEnabled() && Util.hasProLicense(this) == null) {
      Util.viewUri(this,ActivityMain.cProUri);
      finish();
      return;
    }
  }
 else   if (action.equals(ACTION_FETCH)) {
    if (Util.hasProLicense(this) == null) {
      Util.viewUri(this,ActivityMain.cProUri);
      finish();
      return;
    }
  }
  if (action.equals(ACTION_SUBMIT) && !registerDevice(this)) {
    finish();
    return;
  }
  if (extras != null && extras.containsKey(cInteractive) && extras.getBoolean(cInteractive,false)) {
    String themeName=PrivacyManager.getSetting(null,0,PrivacyManager.cSettingTheme,"String_Node_Str",false);
    mThemeId=(themeName.equals("String_Node_Str") ? R.style.CustomTheme : R.style.CustomTheme_Light);
    setTheme(mThemeId);
    setContentView(R.layout.sharelist);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    if (action.equals(ACTION_TOGGLE)) {
      mActionId=R.string.menu_restriction_all;
      setTitle(R.string.menu_restriction_all);
    }
 else     if (action.equals(ACTION_IMPORT)) {
      mActionId=R.string.menu_import;
      setTitle(R.string.menu_import);
    }
 else     if (action.equals(ACTION_EXPORT)) {
      mActionId=R.string.menu_export;
      setTitle(R.string.menu_export);
    }
 else     if (action.equals(ACTION_FETCH)) {
      mActionId=R.string.menu_fetch;
      setTitle(R.string.menu_fetch);
    }
 else     if (action.equals(ACTION_SUBMIT)) {
      mActionId=R.string.menu_submit;
      setTitle(R.string.menu_submit);
    }
 else {
      finish();
      return;
    }
    ListView lvShare=(ListView)findViewById(R.id.lvShare);
    AppListTask appListTask=new AppListTask();
    appListTask.executeOnExecutor(mExecutor,uids,restriction);
    registerForContextMenu(lvShare);
    if (action.equals(ACTION_EXPORT) || action.equals(ACTION_IMPORT)) {
      Intent file=new Intent(Intent.ACTION_GET_CONTENT);
      file.setType("String_Node_Str");
      boolean hasIntent=Util.isIntentAvailable(ActivityShare.this,file);
      if (action.equals(ACTION_EXPORT))       mFileName=getFileName(this,hasIntent);
 else       mFileName=(hasIntent ? null : getFileName(this,false));
      if (mFileName == null)       fileChooser();
 else       showFileName();
    }
 else {
      TextView tvDescription=(TextView)findViewById(R.id.tvDescription);
      tvDescription.setText(getBaseURL(ActivityShare.this));
    }
    final Button btnOk=(Button)findViewById(R.id.btnOk);
    final Button btnCancel=(Button)findViewById(R.id.btnCancel);
    if (action.equals(ACTION_SUBMIT) || action.equals(ACTION_FETCH) || action.equals(ACTION_TOGGLE))     btnOk.setEnabled(true);
    btnOk.setOnClickListener(new Button.OnClickListener(){
      @Override public void onClick(      View v){
        btnOk.setEnabled(false);
        if (action.equals(ACTION_TOGGLE)) {
          mRunning=true;
          new ToggleTask().executeOnExecutor(mExecutor,restriction);
        }
        if (action.equals(ACTION_IMPORT)) {
          mRunning=true;
          new ImportTask().executeOnExecutor(mExecutor,new File(mFileName));
        }
 else         if (action.equals(ACTION_EXPORT)) {
          mRunning=true;
          new ExportTask().executeOnExecutor(mExecutor,new File(mFileName));
        }
 else         if (action.equals(ACTION_FETCH)) {
          if (uids.length > 0) {
            mRunning=true;
            new FetchTask().executeOnExecutor(mExecutor);
          }
        }
 else         if (action.equals(ACTION_SUBMIT)) {
          if (uids.length > 0) {
            if (uids.length <= cSubmitLimit) {
              mRunning=true;
              new SubmitTask().executeOnExecutor(mExecutor);
            }
 else {
              String message=getString(R.string.msg_limit,ActivityShare.cSubmitLimit + 1);
              Toast.makeText(ActivityShare.this,message,Toast.LENGTH_SHORT).show();
              btnOk.setEnabled(false);
            }
          }
        }
      }
    }
);
    btnCancel.setOnClickListener(new Button.OnClickListener(){
      @Override public void onClick(      View v){
        if (mRunning) {
          mAbort=true;
          Toast.makeText(ActivityShare.this,getString(R.string.msg_abort),Toast.LENGTH_SHORT).show();
        }
 else         finish();
      }
    }
);
  }
 else   if (action.equals(ACTION_EXPORT)) {
    mThemeId=android.R.style.Theme_NoDisplay;
    setTheme(mThemeId);
    List<Integer> listUid=new ArrayList<Integer>();
    for (    PackageInfo pInfo : getPackageManager().getInstalledPackages(0))     if (!listUid.contains(pInfo.applicationInfo.uid))     listUid.add(pInfo.applicationInfo.uid);
    String fileName=(extras != null && extras.containsKey(cFileName) ? extras.getString(cFileName) : getFileName(this,false));
    new ExportTask().executeOnExecutor(mExecutor,new File(fileName),listUid);
  }
}