remove warnings from com.ibm.wala.dalvik
This commit is contained in:
parent
6401269da1
commit
5a06c07ca7
|
@ -76,8 +76,8 @@ public class ActivityModelMethod extends DexIMethod {
|
|||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
Section<ClassDefItem> cldeff = activityModelDF
|
||||
.getSectionForType(TYPE_CLASS_DEF_ITEM);
|
||||
@SuppressWarnings("unchecked")
|
||||
Section<ClassDefItem> cldeff = activityModelDF.getSectionForType(TYPE_CLASS_DEF_ITEM);
|
||||
for (ClassDefItem cdefitems : cldeff.getItems()) {
|
||||
if (cdefitems.getClassType().getTypeDescriptor()
|
||||
.equals("Lactivity/model/ActivityModelActivity;")) {
|
||||
|
|
|
@ -162,7 +162,8 @@ public class DexCFG extends AbstractCFG<Instruction, DexCFG.BasicBlock>{
|
|||
boolean[] r = new boolean[getInstructions().length];
|
||||
boolean[] catchers = new boolean[getInstructions().length];
|
||||
// we initially start with both the entry and exit block.
|
||||
int blockCount = 2;
|
||||
@SuppressWarnings("unused")
|
||||
int blockCount = 2;
|
||||
|
||||
// Compute r so r[i] == true iff instruction i begins a basic block.
|
||||
// While doing so count the number of blocks.
|
||||
|
@ -663,8 +664,8 @@ public class DexCFG extends AbstractCFG<Instruction, DexCFG.BasicBlock>{
|
|||
@Override
|
||||
public String toString() {
|
||||
StringBuffer s = new StringBuffer("");
|
||||
for (Iterator it = iterator(); it.hasNext();) {
|
||||
BasicBlock bb = (BasicBlock) it.next();
|
||||
for (Iterator<BasicBlock> it = iterator(); it.hasNext();) {
|
||||
BasicBlock bb = it.next();
|
||||
s.append("BB").append(getNumber(bb)).append("\n");
|
||||
for (int j = bb.getFirstInstructionIndex(); j <= bb.getLastInstructionIndex(); j++) {
|
||||
s.append(" ").append(j).append(" ").append(getInstructions()[j]).append("\n");
|
||||
|
|
|
@ -81,8 +81,8 @@ public class DexFileModule implements Module {
|
|||
// create ModuleEntries from ClassDefItem
|
||||
entries = new HashSet<ModuleEntry>();
|
||||
|
||||
Section<ClassDefItem> cldeff = dexfile
|
||||
.getSectionForType(TYPE_CLASS_DEF_ITEM);
|
||||
@SuppressWarnings("unchecked")
|
||||
Section<ClassDefItem> cldeff = dexfile.getSectionForType(TYPE_CLASS_DEF_ITEM);
|
||||
|
||||
for (ClassDefItem cdefitems : cldeff.getItems()) {
|
||||
logger.debug("DexFileModule adding class: " + cdefitems.getConciseIdentity());
|
||||
|
|
|
@ -34,7 +34,8 @@ public class DexIRFactory extends DefaultIRFactory {
|
|||
|
||||
public final static boolean buildLocalMap = false;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public ControlFlowGraph makeCFG(IMethod method, Context C) throws IllegalArgumentException {
|
||||
if (method == null) {
|
||||
throw new IllegalArgumentException("null method");
|
||||
|
|
|
@ -71,7 +71,7 @@ import com.ibm.wala.util.warnings.Warnings;
|
|||
public class WDexClassLoaderImpl extends ClassLoaderImpl {
|
||||
private static final Logger logger = LoggerFactory.getLogger(WDexClassLoaderImpl.class);
|
||||
|
||||
private SetOfClasses lExclusions;
|
||||
// private SetOfClasses lExclusions;
|
||||
private IClassLoader lParent;
|
||||
|
||||
|
||||
|
@ -90,7 +90,7 @@ public class WDexClassLoaderImpl extends ClassLoaderImpl {
|
|||
SetOfClasses exclusions, IClassHierarchy cha) {
|
||||
super(loader, cha.getScope().getArrayClassLoader(), parent, exclusions, cha);
|
||||
lParent = parent;
|
||||
lExclusions = exclusions;
|
||||
// lExclusions = exclusions;
|
||||
//DEBUG_LEVEL = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ public class DexFakeRootMethod extends AbstractRootMethod {
|
|||
* @return true iff block is a basic block in the fake root method
|
||||
* @throws IllegalArgumentException if block is null
|
||||
*/
|
||||
public static boolean isFromFakeRoot(IBasicBlock block) {
|
||||
public static boolean isFromFakeRoot(IBasicBlock<?> block) {
|
||||
if (block == null) {
|
||||
throw new IllegalArgumentException("block is null");
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ import com.ibm.wala.util.debug.UnimplementedError;
|
|||
* <p>
|
||||
* In this implementation, each dataflow variable value is an integer, and the "meeter" object provides the meets
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public abstract class AbstractIntRegisterMachine implements FixedPointConstants {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AbstractIntRegisterMachine.class);
|
||||
|
||||
|
@ -587,7 +588,8 @@ public abstract class AbstractIntRegisterMachine implements FixedPointConstants
|
|||
* @return the height of stacks that are being meeted. Return -1 if there is no stack meet necessary.
|
||||
* @param operands The operands for this operator. operands[0] is the left-hand side.
|
||||
*/
|
||||
private static int computeMeetStackHeight(IVariable[] operands) {
|
||||
@SuppressWarnings("unused")
|
||||
private static int computeMeetStackHeight(IVariable[] operands) {
|
||||
MachineState lhs = (MachineState) operands[0];
|
||||
int height = -1;
|
||||
if (lhs.stack != null) {
|
||||
|
|
|
@ -60,7 +60,6 @@ import com.ibm.wala.shrikeBT.IConditionalBranchInstruction;
|
|||
import com.ibm.wala.shrikeBT.IGetInstruction;
|
||||
import com.ibm.wala.shrikeBT.IInvokeInstruction;
|
||||
import com.ibm.wala.shrikeBT.IUnaryOpInstruction;
|
||||
import com.ibm.wala.shrikeBT.IndirectionData;
|
||||
import com.ibm.wala.shrikeBT.InstanceofInstruction;
|
||||
import com.ibm.wala.shrikeBT.MonitorInstruction;
|
||||
import com.ibm.wala.shrikeBT.NewInstruction;
|
||||
|
@ -134,7 +133,7 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
/**
|
||||
* information about indirect use of local variables in the bytecode
|
||||
*/
|
||||
private final IndirectionData bytecodeIndirections;
|
||||
// private final IndirectionData bytecodeIndirections;
|
||||
|
||||
private final ShrikeIndirectionData shrikeIndirections;
|
||||
|
||||
|
@ -147,7 +146,7 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
this.method = method;
|
||||
this.symbolTable = symbolTable;
|
||||
this.insts = method.getDeclaringClass().getClassLoader().getInstructionFactory();
|
||||
this.bytecodeIndirections = method.getIndirectionData();
|
||||
// this.bytecodeIndirections = method.getIndirectionData();
|
||||
this.shrikeIndirections = new ShrikeIndirectionData(instructions.length);
|
||||
assert cfg != null : "Null CFG";
|
||||
}
|
||||
|
@ -156,7 +155,7 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
|
||||
final SSACFG cfg;
|
||||
|
||||
final SSAInstruction[] instructions;
|
||||
// final SSAInstruction[] instructions;
|
||||
|
||||
final SymbolTable symbolTable;
|
||||
|
||||
|
@ -164,7 +163,7 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
|
||||
SymbolTableMeeter(SymbolTable symbolTable, SSACFG cfg, SSAInstruction[] instructions, DexCFG dexCFG) {
|
||||
this.cfg = cfg;
|
||||
this.instructions = instructions;
|
||||
// this.instructions = instructions;
|
||||
this.symbolTable = symbolTable;
|
||||
this.dexCFG = dexCFG;
|
||||
}
|
||||
|
@ -372,7 +371,7 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
*/
|
||||
private SSAInstruction[] creators;
|
||||
|
||||
final SSA2LocalMap localMap;
|
||||
// final SSA2LocalMap localMap;
|
||||
|
||||
final SSAPiNodePolicy piNodePolicy;
|
||||
|
||||
|
@ -386,7 +385,7 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
this.instructions = instructions;
|
||||
this.symbolTable = symbolTable;
|
||||
this.loader = dexCFG.getMethod().getDeclaringClass().getClassLoader().getReference();
|
||||
this.localMap = localMap;
|
||||
// this.localMap = localMap;
|
||||
init(this.new NodeVisitor(), this.new EdgeVisitor());
|
||||
}
|
||||
|
||||
|
@ -1105,7 +1104,8 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
|
||||
private Dominators<ISSABasicBlock> dom = null;
|
||||
|
||||
private int findRethrowException() {
|
||||
@SuppressWarnings("unused")
|
||||
private int findRethrowException() {
|
||||
int index = getCurrentInstructionIndex();
|
||||
SSACFG.BasicBlock bb = cfg.getBlockForInstruction(index);
|
||||
if (bb.isCatchBlock()) {
|
||||
|
@ -1431,7 +1431,8 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
* Record the beginning of a new range, starting at the given program counter, in which a particular value number corresponds to
|
||||
* a particular local number
|
||||
*/
|
||||
void startRange(int pc, int localNumber, int valueNumber) {
|
||||
@SuppressWarnings("unused")
|
||||
void startRange(int pc, int localNumber, int valueNumber) {
|
||||
int max = ((DexIMethod)dexCFG.getMethod()).getMaxLocals();
|
||||
if (localNumber >= max) {
|
||||
assert false : "invalid local " + localNumber + ">" + max;
|
||||
|
@ -1444,8 +1445,8 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
|
|||
* Finish populating the map of local variable information
|
||||
*/
|
||||
private void finishLocalMap(DexSSABuilder builder) {
|
||||
for (Iterator it = dexCFG.iterator(); it.hasNext();) {
|
||||
BasicBlock bb = (BasicBlock) it.next();
|
||||
for (Iterator<BasicBlock> it = dexCFG.iterator(); it.hasNext();) {
|
||||
BasicBlock bb = it.next();
|
||||
MachineState S = builder.getIn(bb);
|
||||
int number = bb.getNumber();
|
||||
block2LocalState[number] = S.getLocals();
|
||||
|
|
|
@ -40,6 +40,7 @@ package org.scandroid.domain;
|
|||
|
||||
import org.scandroid.flow.types.FlowType;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class DomainElement {
|
||||
// the code element in question
|
||||
// alternate framing: the /current/ fact about the element
|
||||
|
|
|
@ -80,11 +80,12 @@ import com.ibm.wala.ssa.ISSABasicBlock;
|
|||
import com.ibm.wala.ssa.SSAInstruction;
|
||||
import com.ibm.wala.ssa.SSAInvokeInstruction;
|
||||
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class InflowAnalysis <E extends ISSABasicBlock> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(InflowAnalysis.class);
|
||||
|
||||
public static <E extends ISSABasicBlock>
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <E extends ISSABasicBlock>
|
||||
void addDomainElements(
|
||||
Map<BasicBlockInContext<E>, Map<FlowType<E>,Set<CodeElement>>> taintMap,
|
||||
BasicBlockInContext<E> block,
|
||||
|
@ -261,7 +262,7 @@ public class InflowAnalysis <E extends ISSABasicBlock> {
|
|||
for(CodeElement o:e2.getValue())
|
||||
{
|
||||
if (e2.getKey() instanceof IKFlow) {
|
||||
InstanceKey e2IK = ((IKFlow)e2.getKey()).getIK();
|
||||
InstanceKey e2IK = ((IKFlow<?>)e2.getKey()).getIK();
|
||||
if (prefixes.containsKey(e2IK))
|
||||
logger.debug("Uri Prefix: " + prefixes.get(e2IK));
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ public class LocalSinkPoint implements ISinkPoint {
|
|||
this.sinkFlow = sinkFlow;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<FlowType<IExplodedBasicBlock>> findSources(CGAnalysisContext<IExplodedBasicBlock> ctx,
|
||||
TabulationResult<BasicBlockInContext<IExplodedBasicBlock>, CGNode, DomainElement> flowResult,
|
||||
|
|
|
@ -130,6 +130,7 @@ public class OutflowAnalysis {
|
|||
logger.debug("added edge from {} to {}", source, dest);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unused", "unchecked" })
|
||||
private void processArgSinks(
|
||||
TabulationResult<BasicBlockInContext<IExplodedBasicBlock>, CGNode, DomainElement> flowResult,
|
||||
IFDSTaintDomain<IExplodedBasicBlock> domain,
|
||||
|
@ -234,6 +235,7 @@ public class OutflowAnalysis {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unused", "unchecked" })
|
||||
private void processEntryArgs(
|
||||
TabulationResult<BasicBlockInContext<IExplodedBasicBlock>, CGNode, DomainElement> flowResult,
|
||||
IFDSTaintDomain<IExplodedBasicBlock> domain,
|
||||
|
@ -324,6 +326,7 @@ public class OutflowAnalysis {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unused", "unchecked" })
|
||||
private void processEntryRets(
|
||||
TabulationResult<BasicBlockInContext<IExplodedBasicBlock>, CGNode, DomainElement> flowResult,
|
||||
IFDSTaintDomain<IExplodedBasicBlock> domain,
|
||||
|
|
|
@ -48,8 +48,6 @@ import org.scandroid.flow.types.FlowType;
|
|||
import org.scandroid.flow.types.StaticFieldFlow;
|
||||
import org.scandroid.spec.StaticFieldSinkSpec;
|
||||
import org.scandroid.util.CGAnalysisContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.ibm.wala.classLoader.IField;
|
||||
|
@ -63,8 +61,8 @@ import com.ibm.wala.ssa.analysis.IExplodedBasicBlock;
|
|||
*
|
||||
*/
|
||||
public class StaticFieldSinkPoint implements ISinkPoint {
|
||||
private static final Logger logger = LoggerFactory
|
||||
.getLogger(StaticFieldSinkPoint.class);
|
||||
// private static final Logger logger = LoggerFactory
|
||||
// .getLogger(StaticFieldSinkPoint.class);
|
||||
|
||||
private final IField field;
|
||||
private final FlowType<IExplodedBasicBlock> flow;
|
||||
|
@ -84,6 +82,7 @@ public class StaticFieldSinkPoint implements ISinkPoint {
|
|||
* CGAnalysisContext, com.ibm.wala.dataflow.IFDS.TabulationResult,
|
||||
* org.scandroid.domain.IFDSTaintDomain)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<FlowType<IExplodedBasicBlock>> findSources(
|
||||
CGAnalysisContext<IExplodedBasicBlock> ctx,
|
||||
|
@ -95,7 +94,6 @@ public class StaticFieldSinkPoint implements ISinkPoint {
|
|||
.getPossibleElements(new StaticFieldElement(field
|
||||
.getReference()))) {
|
||||
if (de.taintSource instanceof StaticFieldFlow<?>) {
|
||||
@SuppressWarnings("unchecked")
|
||||
StaticFieldFlow<IExplodedBasicBlock> source = (StaticFieldFlow<IExplodedBasicBlock>) de.taintSource;
|
||||
if (source.getField().equals(field)) {
|
||||
continue;
|
||||
|
|
|
@ -73,6 +73,7 @@ public final class CallNoneToReturnFunction <E extends ISSABasicBlock> implement
|
|||
// this effectively taints everything in the heap that we've seen before.
|
||||
DomainElement de = domain.getMappedObject(d);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
FlowType<E> taint = de.taintSource;
|
||||
|
||||
for (CodeElement ce : domain.codeElements() ){
|
||||
|
|
|
@ -280,7 +280,6 @@ implements IFlowFunctionMap<BasicBlockInContext<E>> {
|
|||
UseDefSetPair p, IClassHierarchy ch) {
|
||||
SSAPutInstruction pi = (SSAPutInstruction)instruction;
|
||||
PointerKey pk;
|
||||
boolean isStatic;
|
||||
Set<CodeElement> elements = Sets.newHashSet();
|
||||
if (pi.isStatic()) {
|
||||
p.uses.addAll(CodeElement.valueElements(pa, bb.getNode(), instruction.getUse(0)));
|
||||
|
@ -291,7 +290,6 @@ implements IFlowFunctionMap<BasicBlockInContext<E>> {
|
|||
} else {
|
||||
pk = new StaticFieldKey(staticField);
|
||||
}
|
||||
isStatic = true;
|
||||
} else {
|
||||
p.uses.addAll(
|
||||
CodeElement.valueElements(pa, bb.getNode(), instruction.getUse(1)));
|
||||
|
@ -302,7 +300,6 @@ implements IFlowFunctionMap<BasicBlockInContext<E>> {
|
|||
|
||||
//MyLogger.log(LogLevel.DEBUG, " instruction: "+instruction);
|
||||
|
||||
isStatic = false;
|
||||
// add the object that holds the field that was modified
|
||||
// to the list of things tainted by this flow:
|
||||
p.defs.addAll(CodeElement.valueElements(pa, bb.getNode(), valueNumber));
|
||||
|
@ -332,21 +329,19 @@ implements IFlowFunctionMap<BasicBlockInContext<E>> {
|
|||
SSAGetInstruction gi = (SSAGetInstruction)instruction;
|
||||
|
||||
PointerKey pk;
|
||||
boolean isStatic;
|
||||
FieldReference declaredField = gi.getDeclaredField();
|
||||
if ( gi.isStatic()) {
|
||||
IField staticField =
|
||||
getStaticIField(ch, declaredField);
|
||||
|
||||
if (staticField == null)
|
||||
if (staticField == null) {
|
||||
pk = null;
|
||||
else
|
||||
} else {
|
||||
pk = new StaticFieldKey(staticField);
|
||||
isStatic = true;
|
||||
}
|
||||
} else {
|
||||
int valueNumber = instruction.getUse(0);
|
||||
pk = new LocalPointerKey(bb.getNode(), valueNumber);
|
||||
isStatic = false;
|
||||
}
|
||||
|
||||
if (pk!=null) {
|
||||
|
@ -407,6 +402,7 @@ implements IFlowFunctionMap<BasicBlockInContext<E>> {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public IntSet getTargets(int d1) {
|
||||
//System.out.println(this.toString()+".getTargets("+d1+") "+bb);
|
||||
//BitVectorIntSet set = new BitVectorIntSet();
|
||||
|
@ -428,7 +424,7 @@ implements IFlowFunctionMap<BasicBlockInContext<E>> {
|
|||
|
||||
final SSAInvokeInstruction instruction = (SSAInvokeInstruction) src.getLastInstruction();
|
||||
|
||||
String signature = dest.getMethod().getSignature();
|
||||
// String signature = dest.getMethod().getSignature();
|
||||
// if ( dest.getMethod().isSynthetic() ) {
|
||||
// System.out.println("Synthetic: "+signature);
|
||||
// } else {
|
||||
|
@ -482,7 +478,7 @@ implements IFlowFunctionMap<BasicBlockInContext<E>> {
|
|||
// TODO: Look up summary for this method, or warn if it doesn't exist.
|
||||
assert (src.getNode().equals(dest.getNode()));
|
||||
|
||||
final SSAInvokeInstruction instruction = (SSAInvokeInstruction) src.getLastInstruction();
|
||||
// final SSAInvokeInstruction instruction = (SSAInvokeInstruction) src.getLastInstruction();
|
||||
|
||||
// System.out.println("call to return(no callee) method inside call graph: " + src.getNode()+"--" + instruction.getDeclaredTarget());
|
||||
// System.out.println("call to system: " + instruction.getDeclaredTarget());
|
||||
|
|
|
@ -42,8 +42,6 @@ import java.util.List;
|
|||
import org.scandroid.domain.CodeElement;
|
||||
import org.scandroid.domain.DomainElement;
|
||||
import org.scandroid.domain.IFDSTaintDomain;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.ibm.wala.dataflow.IFDS.IUnaryFlowFunction;
|
||||
import com.ibm.wala.ssa.ISSABasicBlock;
|
||||
|
@ -52,8 +50,8 @@ import com.ibm.wala.util.intset.MutableSparseIntSet;
|
|||
|
||||
|
||||
final class PairBasedFlowFunction <E extends ISSABasicBlock> implements IUnaryFlowFunction {
|
||||
private static final Logger logger =
|
||||
LoggerFactory.getLogger(PairBasedFlowFunction.class);
|
||||
// private static final Logger logger =
|
||||
// LoggerFactory.getLogger(PairBasedFlowFunction.class);
|
||||
|
||||
private final List<UseDefPair> useToDefList;
|
||||
private final IFDSTaintDomain<E> domain;
|
||||
|
|
|
@ -48,7 +48,6 @@ import org.scandroid.domain.ReturnElement;
|
|||
import com.ibm.wala.dataflow.IFDS.IUnaryFlowFunction;
|
||||
import com.ibm.wala.ssa.ISSABasicBlock;
|
||||
import com.ibm.wala.util.intset.IntSet;
|
||||
import com.ibm.wala.util.intset.MutableSparseIntSet;
|
||||
import com.ibm.wala.util.intset.SparseIntSet;
|
||||
|
||||
/**
|
||||
|
|
|
@ -117,7 +117,8 @@ public abstract class FlowType<E extends ISSABasicBlock> {
|
|||
* @param b
|
||||
* @return
|
||||
*/
|
||||
private boolean compareBlocks(BasicBlockInContext<E> a,
|
||||
@SuppressWarnings("unused")
|
||||
private boolean compareBlocks(BasicBlockInContext<E> a,
|
||||
BasicBlockInContext<E> b) {
|
||||
// delegate to the defined implementation, but only if it's true.
|
||||
if (a.equals(b)) {
|
||||
|
|
|
@ -40,7 +40,6 @@ package org.scandroid.prefixtransfer;
|
|||
import com.ibm.wala.dataflow.graph.AbstractMeetOperator;
|
||||
import com.ibm.wala.dataflow.graph.ITransferFunctionProvider;
|
||||
import com.ibm.wala.fixpoint.UnaryOperator;
|
||||
import com.ibm.wala.fixpoint.IVariable;
|
||||
|
||||
|
||||
public class PrefixTransferFunctionProvider implements ITransferFunctionProvider<InstanceKeySite, PrefixVariable> {
|
||||
|
@ -50,7 +49,6 @@ public class PrefixTransferFunctionProvider implements ITransferFunctionProvider
|
|||
|
||||
public UnaryOperator<PrefixVariable> getEdgeTransferFunction(
|
||||
InstanceKeySite src, InstanceKeySite dst) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -67,14 +65,12 @@ public class PrefixTransferFunctionProvider implements ITransferFunctionProvider
|
|||
public byte evaluate(PrefixVariable lhs, PrefixVariable[] rhs) {
|
||||
// System.out.println("Evaluating meet");
|
||||
boolean changed = false;
|
||||
for(IVariable iv:rhs)
|
||||
{
|
||||
PrefixVariable rhsTPV = (PrefixVariable)iv;
|
||||
|
||||
for (final PrefixVariable rhsTPV : rhs) {
|
||||
changed = lhs.updateAll(rhsTPV) || changed;
|
||||
}
|
||||
if(changed)
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
return (changed ? (byte) 1 : (byte) 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -128,8 +128,8 @@ public class PrefixTransferGraph implements Graph<InstanceKeySite> {
|
|||
{
|
||||
if(k instanceof ConstantKey)
|
||||
{
|
||||
logger.debug("ConstantKey: "+((ConstantKey)k).getValue());
|
||||
node = new ConstantString(pa.getInstanceKeyMapping().getMappedIndex(k), (String)((ConstantKey)k).getValue());
|
||||
logger.debug("ConstantKey: "+((ConstantKey<?>)k).getValue());
|
||||
node = new ConstantString(pa.getInstanceKeyMapping().getMappedIndex(k), (String)((ConstantKey<?>)k).getValue());
|
||||
addNode(node);
|
||||
nodeMap.put(k, node);
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ public class UriPrefixTransferGraph implements Graph<InstanceKeySite> {
|
|||
{
|
||||
if(k instanceof ConstantKey)
|
||||
{
|
||||
node = new ConstantString(pa.getInstanceKeyMapping().getMappedIndex(k), (String)((ConstantKey)k).getValue());
|
||||
node = new ConstantString(pa.getInstanceKeyMapping().getMappedIndex(k), (String)((ConstantKey<?>)k).getValue());
|
||||
addNode(node);
|
||||
// logger.debug(node);
|
||||
nodeMap.put(k, node);
|
||||
|
|
|
@ -43,18 +43,15 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.scandroid.model.AppModelMethod;
|
||||
import org.scandroid.util.LoaderUtils;
|
||||
|
||||
|
||||
|
||||
import com.ibm.wala.classLoader.IClass;
|
||||
import com.ibm.wala.classLoader.IMethod;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchy;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
|
||||
public class AndroidSpecs implements ISpecs {
|
||||
private AppModelMethod appEntrySummary;
|
||||
// private AppModelMethod appEntrySummary;
|
||||
|
||||
static String act = "Landroid/app/Activity";
|
||||
static String svc = "Landroid/app/Service";
|
||||
|
@ -146,9 +143,9 @@ public class AndroidSpecs implements ISpecs {
|
|||
static MethodNamePattern httpExecute =
|
||||
new MethodNamePattern(http, "execute");
|
||||
|
||||
private static MethodNamePattern[] callbackModelEntry = {
|
||||
new MethodNamePattern("Lcom/SCanDroid/AppModel", "entry")
|
||||
};
|
||||
// private static MethodNamePattern[] callbackModelEntry = {
|
||||
// new MethodNamePattern("Lcom/SCanDroid/AppModel", "entry")
|
||||
// };
|
||||
|
||||
static MethodNamePattern llLocChanged =
|
||||
new MethodNamePattern(ll, "onLocationChanged");
|
||||
|
|
|
@ -40,13 +40,13 @@ package org.scandroid.spec;
|
|||
|
||||
class ResolvedSpec {
|
||||
ResolvedSpec() {
|
||||
AndroidSpecs spec = new AndroidSpecs();
|
||||
|
||||
for(MethodNamePattern m: spec.getEntrypointSpecs()) {
|
||||
}
|
||||
for(SourceSpec s: spec.getSourceSpecs()) {
|
||||
}
|
||||
for(ISinkSpec s: spec.getSinkSpecs()) {
|
||||
}
|
||||
// AndroidSpecs spec = new AndroidSpecs();
|
||||
//
|
||||
// for(MethodNamePattern m: spec.getEntrypointSpecs()) {
|
||||
// }
|
||||
// for(SourceSpec s: spec.getSourceSpecs()) {
|
||||
// }
|
||||
// for(ISinkSpec s: spec.getSinkSpecs()) {
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -480,7 +480,8 @@ public class SSAtoXMLVisitor implements SSAInstruction.IVisitor {
|
|||
return summary;
|
||||
}
|
||||
|
||||
private String typeRefToStr(TypeReference fieldType)
|
||||
@SuppressWarnings("unused")
|
||||
private String typeRefToStr(TypeReference fieldType)
|
||||
throws UTFDataFormatException {
|
||||
Atom className = fieldType.getName().getClassName();
|
||||
Atom pkgName = fieldType.getName().getPackage();
|
||||
|
|
|
@ -123,6 +123,7 @@ public class CGAnalysisContext<E extends ISSABasicBlock> {
|
|||
this(analysisContext, specifier, new ArrayList<InputStream>());
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public CGAnalysisContext(AndroidAnalysisContext analysisContext,
|
||||
IEntryPointSpecifier specifier,
|
||||
Collection<InputStream> extraSummaries) throws IOException {
|
||||
|
|
|
@ -210,7 +210,7 @@ public class DexDotUtil extends DotUtil {
|
|||
result.append(fontnameStr);
|
||||
result.append("]; \n");
|
||||
|
||||
Collection dotNodes = computeDotNodes(g);
|
||||
Collection<T> dotNodes = computeDotNodes(g);
|
||||
|
||||
outputNodes(labels, result, dotNodes);
|
||||
|
||||
|
@ -230,8 +230,8 @@ public class DexDotUtil extends DotUtil {
|
|||
return result;
|
||||
}
|
||||
|
||||
private static void outputNodes(NodeDecorator labels, StringBuffer result, Collection dotNodes) throws WalaException {
|
||||
for (Iterator it = dotNodes.iterator(); it.hasNext();) {
|
||||
private static <T> void outputNodes(NodeDecorator labels, StringBuffer result, Collection<T> dotNodes) throws WalaException {
|
||||
for (Iterator<T> it = dotNodes.iterator(); it.hasNext();) {
|
||||
outputNode(labels, result, it.next());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,7 +149,8 @@ public class EntryPoints {
|
|||
}
|
||||
}
|
||||
|
||||
private void systemEntry(ClassHierarchy cha, AndroidAnalysisContext loader) {
|
||||
@SuppressWarnings("unused")
|
||||
private void systemEntry(ClassHierarchy cha, AndroidAnalysisContext loader) {
|
||||
String[] systemEntyPoints = {
|
||||
// "android.app.ActivityThread.main([Ljava/lang/String;)V"
|
||||
// , "com.android.server.ServerThread.run()V"
|
||||
|
@ -279,7 +280,8 @@ public class EntryPoints {
|
|||
}
|
||||
}
|
||||
|
||||
private static String getTagValue(String sTag, Element eElement) {
|
||||
@SuppressWarnings("unused")
|
||||
private static String getTagValue(String sTag, Element eElement) {
|
||||
NodeList nlList = eElement.getElementsByTagName(sTag).item(0).getChildNodes();
|
||||
|
||||
Node nValue = (Node) nlList.item(0);
|
||||
|
@ -322,7 +324,8 @@ public class EntryPoints {
|
|||
}
|
||||
}
|
||||
|
||||
private void populateEntryPoints(ClassHierarchy cha) {
|
||||
@SuppressWarnings("unused")
|
||||
private void populateEntryPoints(ClassHierarchy cha) {
|
||||
String method = null;
|
||||
IMethod im = null;
|
||||
for (String[] intent: ActivityIntentList) {
|
||||
|
@ -349,7 +352,8 @@ public class EntryPoints {
|
|||
//entries.add(new DefaultEntrypoint(im, cha));
|
||||
}
|
||||
|
||||
private String IntentToMethod(String intent) {
|
||||
@SuppressWarnings("unused")
|
||||
private String IntentToMethod(String intent) {
|
||||
if (intent.contentEquals("android.intent.action.MAIN") ||
|
||||
intent.contentEquals("android.media.action.IMAGE_CAPTURE") ||
|
||||
intent.contentEquals("android.media.action.VIDEO_CAPTURE") ||
|
||||
|
@ -380,7 +384,8 @@ public class EntryPoints {
|
|||
}
|
||||
}
|
||||
|
||||
private void outputIntentList() {
|
||||
@SuppressWarnings("unused")
|
||||
private void outputIntentList() {
|
||||
if (ActivityIntentList != null)
|
||||
for (int i = 0; i < ActivityIntentList.size(); i++)
|
||||
logger.debug("Activity Intent: " + ActivityIntentList.get(i)[0] + " ~> " + ActivityIntentList.get(i)[1]);
|
||||
|
|
|
@ -62,7 +62,8 @@ public class WalaGraphToJGraphT {
|
|||
private DirectedGraph<CGNode, DefaultEdge> jgrapht;
|
||||
private DijkstraShortestPath<CGNode, DefaultEdge> shortestpath;
|
||||
|
||||
public <E extends ISSABasicBlock>
|
||||
@SuppressWarnings("rawtypes")
|
||||
public <E extends ISSABasicBlock>
|
||||
WalaGraphToJGraphT(TabulationResult<BasicBlockInContext<E>, CGNode, DomainElement> flowResult,
|
||||
IFDSTaintDomain<E> domain,
|
||||
FlowType source, ISupergraph<BasicBlockInContext<E>, CGNode> graph, CallGraph cg) {
|
||||
|
|
Loading…
Reference in New Issue