コード例 #1
0
  public static void appendPTATimeToRefinement() {
    String ptastats = SparkEvaluator.v().toString();

    Pattern ptaTimeRegEx = Pattern.compile("Time \\(sec\\): ([0-9.]+)");
    Matcher m = ptaTimeRegEx.matcher(ptastats);
    if (m.find()) {
      refinementStats.append("Refinement Stage PTA Time (sec): " + m.group(1) + "\n");
    }

    refinementStats.append("Refinement Stage K: " + ObjectSensitiveConfig.v().k() + "\n");
  }
コード例 #2
0
  public static void writeReport() {
    // make sure collapsed call graph has been run
    CollaspedCallGraph.v();

    FileWriter fw;
    try {
      String name = "";
      if ("".equals(Config.v().appName)) {
        name += "android-app";
      } else {
        name += Config.v().appName;
      }

      String additionalInfo = Config.v().additionalInfo;
      if (!"".equals(additionalInfo)) {
        additionalInfo = "_" + additionalInfo.replaceAll(" ", "_");
      }

      String fileName =
          name + "_" + getConfiguration().replaceAll(" ", "_") + additionalInfo + "_pta-report.txt";

      fw = new FileWriter(Project.v().getOutputDir() + File.separator + fileName);

      // write configuration details
      fw.write("App Name: " + name + "\n");
      fw.write("Config: " + getConfiguration() + "\n");
      fw.write("Cmdline supplied extra info: " + Config.v().additionalInfo + "\n");

      fw.write(refinementStats.toString());

      // write final run of pta
      fw.write(SparkEvaluator.v().toString());

      // write total lines of code
      fw.write("\nTotal Reachable LOC: " + getReachableLines() + "\n\n");

      // write information flow
      fw.write(infoFlowResults());

      // fw.write(finegrainedFlowResults());

      fw.close();
    } catch (IOException e) {

    }
  }
コード例 #3
0
 @Override
 public Set<SootMethod> getReachableMethods() {
   return SparkEvaluator.v().getReachableMethods();
 }
コード例 #4
0
 @Override
 public Set<MethodOrMethodContext> getReachableMethodContexts() {
   return SparkEvaluator.v().getReachableMethodContexts();
 }
コード例 #5
0
 public Set<MethodOrMethodContext> getMethodContexts(SootMethod method) {
   return SparkEvaluator.v().getContexts(method);
 }