Java 类soot.jimple.infoflow.config.IInfoflowConfig 实例源码

项目:JAADAS    文件:StringTests.java   
@Test(timeout=600000)
  public void stringBuilderTest2_NoJDK(){
    Infoflow infoflow = initInfoflow(true);
    infoflow.setSootConfig(new IInfoflowConfig() {

    @Override
    public void setSootOptions(Options options) {
        List<String> excludeList = new ArrayList<String>();
        excludeList.add("java.");
        excludeList.add("javax.");
        options.set_exclude(excludeList);
        options.set_prepend_classpath(false);
    }

});
    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.StringTestCode: void methodStringBuilder2()>");
infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
checkInfoflow(infoflow, 1);     
  }
项目:JAADAS    文件:ExceptionTests.java   
@Test
public void exceptionControlFlowTestNoJDK1() throws IOException {
    Infoflow infoflow = initInfoflow();
    infoflow.setTaintWrapper(new EasyTaintWrapper(new File("EasyTaintWrapperSource.txt")));
    infoflow.setSootConfig(new IInfoflowConfig() {

        @Override
        public void setSootOptions(Options options) {
            List<String> excludeList = new ArrayList<String>();
            excludeList.add("java.");
            excludeList.add("javax.");
            options.set_exclude(excludeList);
            options.set_prepend_classpath(false);
        }

    });

    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ExceptionTestCode: void exceptionControlFlowTest1()>");
    infoflow.computeInfoflow(appPath, null, epoints, sources, sinks);
    checkInfoflow(infoflow, 1);
}
项目:JAADAS    文件:OtherTests.java   
@Test(timeout=300000)
public void doPrivilegedTest3_NoJDK() {
    Infoflow infoflow = initInfoflow();
    infoflow.setSootConfig(new IInfoflowConfig() {

        @Override
        public void setSootOptions(Options options) {
            List<String> excludeList = new ArrayList<String>();
            excludeList.add("java.");
            excludeList.add("javax.");
            options.set_exclude(excludeList);
            options.set_prepend_classpath(false);
        }

    });
    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.OtherTestCode: void doPrivilegedTest3()>");
    infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
    checkInfoflow(infoflow, 1);
    Assert.assertTrue(infoflow.getResults().isPathBetweenMethods(sink, sourceDeviceId));        
}
项目:JAADAS    文件:ImplicitFlowTests.java   
@Test(timeout=300000)
public void callToReturnTest() throws IOException{
    // not yet supported
    Infoflow infoflow = initInfoflow();
    infoflow.setInspectSinks(false);
    infoflow.setEnableImplicitFlows(true);
    infoflow.setTaintWrapper(new EasyTaintWrapper("EasyTaintWrapperSource.txt"));
    infoflow.setSootConfig(new IInfoflowConfig() {

        @Override
        public void setSootOptions(Options options) {
            options.set_include(Collections.<String>emptyList());
            List<String> excludeList = new ArrayList<String>();
            excludeList.add("java.");
            excludeList.add("javax.");
            options.set_exclude(excludeList);
            options.set_prepend_classpath(false);
        }

    });

    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ImplicitFlowTestCode: void callToReturnTest()>");
    infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
    checkInfoflow(infoflow, 1); 
}
项目:JAADAS    文件:ImplicitFlowTests.java   
@Test(timeout=300000)
public void implicitFlowTaintWrapperTest() throws IOException{
    Infoflow infoflow = initInfoflow();
    infoflow.setInspectSinks(false);
    infoflow.setEnableImplicitFlows(true);
    infoflow.setTaintWrapper(new EasyTaintWrapper("EasyTaintWrapperSource.txt"));
    infoflow.setSootConfig(new IInfoflowConfig() {

        @Override
        public void setSootOptions(Options options) {
            options.set_include(Collections.<String>emptyList());
            List<String> excludeList = new ArrayList<String>();
            excludeList.add("java.");
            excludeList.add("javax.");
            options.set_exclude(excludeList);
            options.set_prepend_classpath(false);
        }

    });

    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ImplicitFlowTestCode: void implicitFlowTaintWrapperTest()>");
    infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
    checkInfoflow(infoflow, 1); 
}
项目:JAADAS    文件:ImplicitFlowTests.java   
@Test(timeout=300000)
public void implicitFlowTaintWrapperNegativeTest() throws IOException{
    Infoflow infoflow = initInfoflow();
    infoflow.setInspectSinks(false);
    infoflow.setEnableImplicitFlows(true);
    infoflow.setTaintWrapper(new EasyTaintWrapper(Collections.<String, Set<String>>emptyMap()));
    infoflow.setSootConfig(new IInfoflowConfig() {

        @Override
        public void setSootOptions(Options options) {
            options.set_include(Collections.<String>emptyList());
            List<String> excludeList = new ArrayList<String>();
            excludeList.add("java.");
            excludeList.add("javax.");
            options.set_exclude(excludeList);
            options.set_prepend_classpath(false);
        }

    });

    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ImplicitFlowTestCode: void implicitFlowTaintWrapperTest()>");
    infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
    negativeCheckInfoflow(infoflow);
}
项目:soot-inflow    文件:StringTests.java   
@Test(timeout=600000)
  public void stringBuilderTest2_NoJDK(){
    taintWrapper = true;
    Infoflow infoflow = initInfoflow();
    infoflow.setSootConfig(new IInfoflowConfig() {

    @Override
    public void setSootOptions(Options options) {
        List<String> excludeList = new ArrayList<String>();
        excludeList.add("java.");
        excludeList.add("javax.");
        options.set_exclude(excludeList);
        options.set_prepend_classpath(false);
    }

});
    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.StringTestCode: void methodStringBuilder2()>");
infoflow.computeInfoflow(path, epoints,sources, sinks);
checkInfoflow(infoflow, 1);     
  }
项目:soot-inflow    文件:ImplicitFlowTests.java   
@Test(timeout=300000)
public void callToReturnTest() throws IOException{
    // not yet supported
    Infoflow infoflow = initInfoflow();
    infoflow.setInspectSinks(false);
    infoflow.setEnableImplicitFlows(true);
    infoflow.setTaintWrapper(new EasyTaintWrapper("EasyTaintWrapperSource.txt"));
    infoflow.setSootConfig(new IInfoflowConfig() {

        @Override
        public void setSootOptions(Options options) {
            options.set_include(Collections.<String>emptyList());
            List<String> excludeList = new ArrayList<String>();
            excludeList.add("java.");
            excludeList.add("javax.");
            options.set_exclude(excludeList);
            options.set_prepend_classpath(false);
        }

    });

    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ImplicitFlowTestCode: void callToReturnTest()>");
    infoflow.computeInfoflow(path, epoints,sources, sinks);
    checkInfoflow(infoflow, 1); 
}
项目:soot-inflow    文件:ImplicitFlowTests.java   
@Test(timeout=300000)
public void implicitFlowTaintWrapperTest() throws IOException{
    // not yet supported
    Infoflow infoflow = initInfoflow();
    infoflow.setInspectSinks(false);
    infoflow.setEnableImplicitFlows(true);
    infoflow.setTaintWrapper(new EasyTaintWrapper("EasyTaintWrapperSource.txt"));
    infoflow.setSootConfig(new IInfoflowConfig() {

        @Override
        public void setSootOptions(Options options) {
            options.set_include(Collections.<String>emptyList());
            List<String> excludeList = new ArrayList<String>();
            excludeList.add("java.");
            excludeList.add("javax.");
            options.set_exclude(excludeList);
            options.set_prepend_classpath(false);
        }

    });

    List<String> epoints = new ArrayList<String>();
    epoints.add("<soot.jimple.infoflow.test.ImplicitFlowTestCode: void implicitFlowTaintWrapperTest()>");
    infoflow.computeInfoflow(path, epoints,sources, sinks);
    checkInfoflow(infoflow, 1); 
}
项目:JAADAS    文件:Infoflow.java   
public void setSootConfig(IInfoflowConfig config){
    sootConfig = config;
}
项目:soot-inflow    文件:Infoflow.java   
public void setSootConfig(IInfoflowConfig config){
    sootConfig = config;
}
项目:JAADAS    文件:SetupApplication.java   
/**
 * Gets the extra Soot configuration options to be used when running the analysis
 * 
 * @return The extra Soot configuration options to be used when running the analysis, null if the defaults shall be
 *         used
 */
public IInfoflowConfig getSootConfig() {
    return this.sootConfig;
}
项目:JAADAS    文件:SetupApplication.java   
/**
 * Sets the extra Soot configuration options to be used when running the analysis
 * 
 * @param config
 *            The extra Soot configuration options to be used when running the analysis, null if the defaults shall
 *            be used
 */
public void setSootConfig(IInfoflowConfig config) {
    this.sootConfig = config;
}