Java 类soot.jimple.infoflow.source.data.SourceSinkDefinition 实例源码

项目:DroidForce    文件:PolicyEnforcementPoint.java   
/**
 * This method iterates over all sources from the FlowDroid-results and extracts the 
 * category of the specific source. If there is no category found, it will return an empty set,
 * otherwise the correct categories will be added. 
 * @param sourcesInfo: all possible sources from which we try to identify the category
 * @return: set of categories for specific sink
 */
private Set<String> getDataIdList(Set<ResultSourceInfo> sourcesInfo){
    Set<String> dataIdList = new HashSet<String>();
    for(ResultSourceInfo sInfo : sourcesInfo){
        if(sInfo.getSource().containsInvokeExpr()){
            InvokeExpr invExpr = sInfo.getSource().getInvokeExpr();

            for(SourceSinkDefinition meth : sources) {
                AndroidMethod am = (AndroidMethod) meth.getMethod();
                if(am.getSignature().equals(invExpr.getMethod().getSignature())) {
                    dataIdList.add(am.getCategory().toString());
                }
            }
        }
        else if (isSourceInfoParameter(sInfo)){
            dataIdList.add(unknownCategory);
        }
        else
            throw new RuntimeException("Currently not supported");
    }

    return dataIdList;
}
项目:DroidForce    文件:PolicyEnforcementPoint.java   
private String getSourceCategory(ResultSourceInfo sourceInfo){
    if(sourceInfo.getSource().containsInvokeExpr()){
        InvokeExpr invExpr = sourceInfo.getSource().getInvokeExpr();

        for(SourceSinkDefinition meth : sources) {
            AndroidMethod am = (AndroidMethod) meth.getMethod();
            if(am.getSignature().equals(invExpr.getMethod().getSignature())){
                    return am.getCategory().toString();
            }
        }
    }
    else if(isSourceInfoParameter(sourceInfo)){
        return unknownCategory;
    }
    else
        throw new RuntimeException("Currently not supported");

    return null;
}
项目:DroidForce    文件:PolicyEnforcementPoint.java   
/**
 * Return true if the method corresponding to the source 'si' is an
 * Inter Component Communication source method such as "Intent.getExtras()".
 * @param si
 * @param cfg
 * @return
 */
private boolean isInterComponentSourceNoCallback(ResultSourceInfo si, BiDiInterproceduralCFG<Unit, SootMethod> cfg){
    if(!si.getSource().containsInvokeExpr())
        return false;

    InvokeExpr invExpr = si.getSource().getInvokeExpr();
    SootMethod sm = invExpr.getMethod();

    for(SourceSinkDefinition meth : sources){
        AndroidMethod am = (AndroidMethod) meth.getMethod();
        if(am.getCategory() == CATEGORY.INTER_APP_COMMUNICATION){
            if(am.getSubSignature().equals(sm.getSubSignature())) {
                log.info("source is: "+ am);
                return true;
            }
        }
    }

    return false;
}
项目:FuzzDroid    文件:JimpleStmtVisitorImpl.java   
public JimpleStmtVisitorImpl(Set<SourceSinkDefinition> sources,
        List<Stmt> jimpleDataFlowStatements, List<AccessPath> accessPathPath, 
        Set<Unit> targetUnits, IInfoflowCFG cfg, Table<List<Stmt>, Stmt, List<List<String>>> splitAPIElementInfos) {
    this.exprVisitor = new JimpleExprVisitorImpl(sources, this);
    this.jimpleDataFlowStatements = jimpleDataFlowStatements;
    this.accessPathPath = accessPathPath;
    this.targetUnits = targetUnits;
    this.cfg = cfg;
    this.splitAPIElementInfos = splitAPIElementInfos;
    this.smtPrograms = new HashSet<SMTProgram>();
    //initial adding of a single SMTProgram
    currentSMTProgram = new SMTProgram();
    smtPrograms.add(currentSMTProgram);
}
项目:FuzzDroid    文件:JimpleExprVisitorImpl.java   
private boolean isSourceMethod(InvokeExpr invoke) {
    for(SourceSinkDefinition source : sources) {
        String sourceMethodSign = source.getMethod().getSignature();
        if(invoke.getMethod().getSignature().equals(sourceMethodSign))
            return true;
    }
    return false;
}
项目:cheetah    文件:PermissionMethodParserJIT.java   
@Override
public Set<SourceSinkDefinition> getAllMethods() {
    Set<SourceSinkDefinition> sourcesSinks = new HashSet<>(
            sourceList.size() + sinkList.size() + neitherList.size());
    sourcesSinks.addAll(sourceList);
    sourcesSinks.addAll(sinkList);
    sourcesSinks.addAll(neitherList);
    return sourcesSinks;
}
项目:DroidForce    文件:PolicyEnforcementPoint.java   
public PolicyEnforcementPoint(Map<String, EventInformation> eventInformation,
        Set<SourceSinkDefinition> sources,
        Set<SourceSinkDefinition> sinks,
        AndroidEntryPointCreator entryPointCreator){
    this.allEventInformation = eventInformation; 
    this.sources = sources;
    this.sinks = sinks;
    this.entryPointCreator = entryPointCreator;
}
项目:DroidForce    文件:PolicyEnforcementPoint.java   
private boolean isMethodInterComponentSink(SootMethod sm) { 
    for (SourceSinkDefinition meth : sinks) {
        AndroidMethod am = (AndroidMethod) meth.getMethod();
        if(am.getCategory() == CATEGORY.INTER_APP_COMMUNICATION){
            if(am.getSubSignature().equals(sm.getSubSignature()))
                return true;
        }
    }

    return false;
}
项目:FuzzDroid    文件:JimpleExprVisitorImpl.java   
public JimpleExprVisitorImpl(Set<SourceSinkDefinition> sources, JimpleStmtVisitorImpl stmtVisitor) {
    this.sources = sources;
    this.stmtVisitor = stmtVisitor;
}
项目:FuzzDroid    文件:SMTConverter.java   
public SMTConverter(Set<SourceSinkDefinition> sources) {
    this.sources = sources;
}
项目:FuzzDroid    文件:SmartConstantDataExtractorFuzzyAnalysis.java   
public FuzzerResultsAvailableHandler(Set<SourceSinkDefinition> sources,
        Set<Unit> targetUnits) {
    this.sources = sources;
    this.targetUnits = targetUnits;
}
项目:cheetah    文件:PermissionMethodParserJIT.java   
@Override
public Set<SourceSinkDefinition> getSources() {
    if (sourceList == null || sinkList == null)
        parse();
    return this.sourceList;
}
项目:cheetah    文件:PermissionMethodParserJIT.java   
@Override
public Set<SourceSinkDefinition> getSinks() {
    if (sourceList == null || sinkList == null)
        parse();
    return this.sinkList;
}