예제 #1
0
 private void newProcessStarting() {
   SootOutputEvent clear_event =
       new SootOutputEvent(this, ISootOutputEventConstants.SOOT_CLEAR_EVENT);
   SootPlugin.getDefault().fireSootOutputEvent(clear_event);
   SootOutputEvent se = new SootOutputEvent(this, ISootOutputEventConstants.SOOT_NEW_TEXT_EVENT);
   se.setTextToAppend("Starting ...");
   SootPlugin.getDefault().fireSootOutputEvent(se);
 }
예제 #2
0
  public void runFinish() {
    getFileHandler().refreshFolder();
    getFileHandler().refreshAll(getSootSelection().getProject());
    // for updating markers
    SootPlugin.getDefault().getManager().updateSootRanFlag();
    final IEditorPart activeEdPart =
        SootPlugin.getDefault()
            .getWorkbench()
            .getActiveWorkbenchWindow()
            .getActivePage()
            .getActiveEditor();
    SootPlugin.getDefault().getPartManager().updatePart(activeEdPart);
    // run cfgviewer
    if (getCfgList() != null) {
      // currently this is the call graph list of pkgs
      GraphGenerator generator = new GraphGenerator();
      generator.setChildren(convertPkgList(getCfgList()));
      GraphPlugin.getDefault().setGenerator(generator);

      generator.run(null);
    }
  }
예제 #3
0
  protected void runSootAsProcess(String cmd) {

    SootProcessRunner op;
    try {
      newProcessStarting();
      op = new SootProcessRunner(Display.getCurrent(), cmd, sootClasspath);

      if (window == null) {
        window = SootPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
      }
      new ProgressMonitorDialog(window.getShell()).run(true, true, op);

    } catch (InvocationTargetException e1) {
      // handle exception
    } catch (InterruptedException e2) {
      // handle cancelation
      System.out.println(e2.getMessage());
    }
  }
예제 #4
0
  public void run(IAction action) {

    super.run(action);
    super.handleMultipleFiles();

    if (isDoNotContinue()) return;
    // sometimes window needs to be reset (not sure why)
    window = SootPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();

    PhaseOptionsDialog dialog = new PhaseOptionsDialog(window.getShell());
    setSdc(new SootDefaultCommands(dialog));
    presetDialog();
    dialog.open();

    if (dialog.getReturnCode() == Dialog.CANCEL) {
      SavedConfigManager scm = new SavedConfigManager();
      scm.setEditMap(dialog.getEditMap());
      scm.handleEdits();
    } else {
      SootSavedConfiguration ssc = new SootSavedConfiguration("Temp", dialog.getConfig());
      ssc.toSaveArray();

      setCmd(ssc.toRunArray());
      String mainClass = dialog.getSootMainClass();
      if ((mainClass == null) || (mainClass.length() == 0)) {
        runSootDirectly();
      } else {
        runSootDirectly(mainClass);
      }
      runFinish();

      // save config if nessesary
      SavedConfigManager scm = new SavedConfigManager();
      scm.setEditMap(dialog.getEditMap());
      scm.handleEdits();
    }
  }