Java 类soot.jimple.infoflow.results.ResultSinkInfo 实例源码

项目:JAADAS    文件:Test.java   
@Override
public void onResultsAvailable(
        IInfoflowCFG cfg, InfoflowResults results) {
    // Dump the results
    if (results == null) {
        print("No results found.");
    }
    else {
        for (ResultSinkInfo sink : results.getResults().keySet()) {
            print("Found a flow to sink " + sink + ", from the following sources:");
            for (ResultSourceInfo source : results.getResults().get(sink)) {
                print("\t- " + source.getSource() + " (in "
                        + cfg.getMethodOf(source.getSource()).getSignature()  + ")");
                if (source.getPath() != null && !source.getPath().isEmpty())
                    print("\t\ton Path " + source.getPath());
            }
        }
    }
}
项目:soot-infoflow-android-iccta    文件:FlowDroidLauncher.java   
@Override
public void onResultsAvailable(
        IInfoflowCFG cfg, InfoflowResults results) {
    // Dump the results
    if (results == null) {
        print("No results found.");
    }
    else {
        Test.cfg = cfg;
        Test.results = results;

        for (ResultSinkInfo sink : results.getResults().keySet()) {
            print("Found a flow to sink " + sink + ", from the following sources:");
            for (ResultSourceInfo source : results.getResults().get(sink)) {
                print("\t- " + source.getSource() + " (in "
                        + cfg.getMethodOf(source.getSource()).getSignature()  + ")");
                if (source.getPath() != null)
                    print("\t\ton Path " + Arrays.toString(source.getPath()));
            }
        }
    }
}
项目:DroidForce    文件:PolicyEnforcementPoint.java   
@Override
public void onResultsAvailable(IInfoflowCFG cfg, InfoflowResults results) {
    log.info("FlowDroid has finished. Duration: " + (System.currentTimeMillis() - Main.startTime) +" ms.");
    Main.startTime = System.currentTimeMillis();
    Settings.instance.setDummyMainToLibraryClass();
    this.results = results;

    if (log.isDebugEnabled()) {
        log.debug("");
        log.debug("InfoFlow Results");
        MultiMap<ResultSinkInfo, ResultSourceInfo> r = results.getResults();
        for (ResultSinkInfo k : r.keySet()) {
            log.debug("ResultSinkInfo: "+ k);

            for (ResultSourceInfo rsi: r.get(k)) {
                log.debug("  source: "+ rsi);
            }
        }
        log.debug("");
    }


    log.info("Starting bytecode instrumentation.");

    log.info("Adding code to initialize PEPs.");
    Util.initializePePInAllPossibleClasses(Settings.instance.getApkPath());

    log.info("Build code for new 'WaitPDPActivity"); // building the code has to be done here (not in the Main class, otherwise Jimple validation will fail
    String mainActivityClass = UpdateManifestAndCodeForWaitPDP.getMainActivityName(Settings.instance.getApkPath());
    String packageName = UpdateManifestAndCodeForWaitPDP.getApplicationPackageName(Settings.instance.getApkPath());
    UpdateManifestAndCodeForWaitPDP.updateWaitPDPActivity(packageName, mainActivityClass);

    // update packagename in field of WaitPDP class
    SootClass sc = Scene.v().getSootClass(Settings.INSTRUMENTATION_HELPER_JAVA);
    SootField sf1 = sc.getFieldByName("applicationPackageName");
    Util.changeConstantStringInField(sf1, packageName);

    log.info("Adding Policy Enforcement Points (PEPs).");
    doAccessControlChecks(cfg);

    log.info("Instrumentation is done.");

    if (Settings.mustOutputJimple()) {
        log.info("-------- Dumping Jimple bodies.");
        Main.dumpJimple();
        log.info("--------");
    }
}