This commit is contained in:
Julian Dolby 2017-05-26 15:13:28 -04:00
commit d4607979ed
29 changed files with 69 additions and 6 deletions

View File

@ -1,13 +1,11 @@
language: android language: android
jdk: oraclejdk8 jdk: oraclejdk8
before_install: before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "git clone --depth=1 https://github.com/secure-software-engineering/DroidBench.git /tmp/DroidBench" - "git clone --depth=1 https://github.com/secure-software-engineering/DroidBench.git /tmp/DroidBench"
install: install:
- mvn clean verify -DskipTests=true -B -q - mvn clean verify -DskipTests=true -B -q
script: script:
- mvn clean verify -B -q - xvfb-run mvn clean verify -B -q
- jdk_switcher use oraclejdk7 - jdk_switcher use oraclejdk7
- ./build-maven-jars.py "install -Dgpg.skip" - ./build-maven-jars.py "install -Dgpg.skip"
sudo: false sudo: false

View File

@ -165,6 +165,7 @@ public class StaticInitializer {
return result; return result;
} }
@Override
public String toString() { public String toString() {
return "Initializer Normal Flow"; return "Initializer Normal Flow";
} }
@ -189,6 +190,7 @@ public class StaticInitializer {
return result; return result;
} }
@Override
public String toString() { public String toString() {
return "Initializer Normal Flow"; return "Initializer Normal Flow";
} }
@ -212,6 +214,7 @@ public class StaticInitializer {
return result; return result;
} }
@Override
public String toString() { public String toString() {
return "Initializer Normal Flow"; return "Initializer Normal Flow";
} }
@ -237,6 +240,7 @@ public class StaticInitializer {
return result; return result;
} }
@Override
public String toString() { public String toString() {
return "Initializer Normal Flow"; return "Initializer Normal Flow";
} }

View File

@ -28,6 +28,7 @@ import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis; import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
import com.ibm.wala.ipa.modref.ModRef; import com.ibm.wala.ipa.modref.ModRef;
import com.ibm.wala.util.CancelException; import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.MonitorUtil.IProgressMonitor;
import com.ibm.wala.util.collections.HashSetFactory; import com.ibm.wala.util.collections.HashSetFactory;
/** /**
@ -195,6 +196,21 @@ public class Slicer {
* @throws CancelException * @throws CancelException
*/ */
public Collection<Statement> slice(SDG sdg, Collection<Statement> roots, boolean backward) throws CancelException { public Collection<Statement> slice(SDG sdg, Collection<Statement> roots, boolean backward) throws CancelException {
return slice(sdg, roots, backward, null);
}
/**
* Main driver logic.
*
* @param sdg governing system dependence graph
* @param roots set of roots to slice from
* @param backward do a backwards slice?
* @param monitor to cancel analysis if needed
* @return the {@link Statement}s found by the slicer
* @throws CancelException
*/
public Collection<Statement> slice(SDG sdg, Collection<Statement> roots, boolean backward, IProgressMonitor monitor)
throws CancelException {
if (sdg == null) { if (sdg == null) {
throw new IllegalArgumentException("sdg cannot be null"); throw new IllegalArgumentException("sdg cannot be null");
} }
@ -202,7 +218,7 @@ public class Slicer {
SliceProblem p = makeSliceProblem(roots, sdg, backward); SliceProblem p = makeSliceProblem(roots, sdg, backward);
PartiallyBalancedTabulationSolver<Statement, PDG<?>, Object> solver = PartiallyBalancedTabulationSolver PartiallyBalancedTabulationSolver<Statement, PDG<?>, Object> solver = PartiallyBalancedTabulationSolver
.createPartiallyBalancedTabulationSolver(p, null); .createPartiallyBalancedTabulationSolver(p, monitor);
TabulationResult<Statement, PDG<?>, Object> tr = solver.solve(); TabulationResult<Statement, PDG<?>, Object> tr = solver.solve();
Collection<Statement> slice = tr.getSupergraphNodesReached(); Collection<Statement> slice = tr.getSupergraphNodesReached();

View File

@ -98,12 +98,17 @@ public class VolatileMethodSummary {
*/ */
private static final class Reserved extends SSAInstruction { private static final class Reserved extends SSAInstruction {
public Reserved () { super(SSAInstruction.NO_INDEX); } public Reserved () { super(SSAInstruction.NO_INDEX); }
@Override
public SSAInstruction copyForSSA (SSAInstructionFactory insts, int[] defs, int[] uses) { public SSAInstruction copyForSSA (SSAInstructionFactory insts, int[] defs, int[] uses) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
@Override
public int hashCode () { return 12384; } public int hashCode () { return 12384; }
@Override
public boolean isFallThrough() { return true; } public boolean isFallThrough() { return true; }
@Override
public String toString (SymbolTable symbolTable) { return "Reserved Slot"; } public String toString (SymbolTable symbolTable) { return "Reserved Slot"; }
@Override
public void visit (IVisitor v) { throw new IllegalStateException(); } public void visit (IVisitor v) { throw new IllegalStateException(); }
} }
private static final Reserved RESERVED = new Reserved(); private static final Reserved RESERVED = new Reserved();
@ -609,6 +614,7 @@ public class VolatileMethodSummary {
/** /**
* Generates a String-Representation of an instance of the class. * Generates a String-Representation of an instance of the class.
*/ */
@Override
public java.lang.String toString() { public java.lang.String toString() {
return "VolatileMethodSummary of " + this.summary.toString(); return "VolatileMethodSummary of " + this.summary.toString();
} }

View File

@ -1671,6 +1671,7 @@ public class ParameterAccessor {
return ret; return ret;
} }
@Override
public String toString() { public String toString() {
return "<ParamAccessor forMethod=" + this.forMethod() + " />"; return "<ParamAccessor forMethod=" + this.forMethod() + " />";
} }

View File

@ -21,6 +21,7 @@ public class DalvikTypeInference extends TypeInference {
super(ir, doPrimitives); super(ir, doPrimitives);
} }
@Override
protected void initialize() { protected void initialize() {
init(ir, this.new DalvikTypeVarFactory(), this.new TypeOperatorFactory()); init(ir, this.new DalvikTypeVarFactory(), this.new TypeOperatorFactory());
} }

View File

@ -287,6 +287,7 @@ public class DexIClass extends BytecodeClass<IClassLoader> {
return getAnnotations((Set<AnnotationVisibility>)null); return getAnnotations((Set<AnnotationVisibility>)null);
} }
@Override
public Collection<Annotation> getAnnotations(boolean runtimeInvisible) { public Collection<Annotation> getAnnotations(boolean runtimeInvisible) {
return getAnnotations(getTypes(runtimeInvisible)); return getAnnotations(getTypes(runtimeInvisible));
} }

View File

@ -106,10 +106,12 @@ public class InstructionArray implements Collection<Instruction> {
return instructions.containsAll(c); return instructions.containsAll(c);
} }
@Override
public boolean equals(Object o) { public boolean equals(Object o) {
return instructions.equals(o); return instructions.equals(o);
} }
@Override
public int hashCode() { public int hashCode() {
return instructions.hashCode(); return instructions.hashCode();
} }

View File

@ -64,6 +64,7 @@ public class IntentModel extends AndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected boolean selectEntryPoint(AndroidEntryPoint ep) { protected boolean selectEntryPoint(AndroidEntryPoint ep) {
return ep.isMemberOf(this.target) || ep.belongsTo(AndroidComponent.APPLICATION) || return ep.isMemberOf(this.target) || ep.belongsTo(AndroidComponent.APPLICATION) ||
ep.belongsTo(AndroidComponent.PROVIDER); ep.belongsTo(AndroidComponent.PROVIDER);

View File

@ -64,6 +64,7 @@ public class MicroModel extends AndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected boolean selectEntryPoint(AndroidEntryPoint ep) { protected boolean selectEntryPoint(AndroidEntryPoint ep) {
return ep.isMemberOf(this.target); return ep.isMemberOf(this.target);
} }

View File

@ -78,6 +78,7 @@ public class MiniModel extends AndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected boolean selectEntryPoint(AndroidEntryPoint ep) { protected boolean selectEntryPoint(AndroidEntryPoint ep) {
if (ep.belongsTo(forCompo)) { if (ep.belongsTo(forCompo)) {
@ -85,6 +86,7 @@ public class MiniModel extends AndroidModel {
} }
return false; return false;
} }
@Override
public Descriptor getDescriptor() throws CancelException { public Descriptor getDescriptor() throws CancelException {
final Descriptor descr = super.getDescriptor(); final Descriptor descr = super.getDescriptor();

View File

@ -98,6 +98,7 @@ public class SpecializedInstantiator extends FlatInstantiator {
* *
* @todo Do we want to mix in REUSE-Parameters? * @todo Do we want to mix in REUSE-Parameters?
*/ */
@Override
public SSAValue createInstance(final TypeReference T, final boolean asManaged, VariableKey key, Set<? extends SSAValue> seen) { public SSAValue createInstance(final TypeReference T, final boolean asManaged, VariableKey key, Set<? extends SSAValue> seen) {
return createInstance(T, asManaged, key, seen, 0); return createInstance(T, asManaged, key, seen, 0);
} }
@ -260,6 +261,7 @@ public class SpecializedInstantiator extends FlatInstantiator {
/** /**
* Satisfy the interface. * Satisfy the interface.
*/ */
@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public int createInstance(TypeReference type, Object... instantiatorArgs) { public int createInstance(TypeReference type, Object... instantiatorArgs) {
// public SSAValue createInstance(final TypeReference T, final boolean asManaged, VariableKey key, Set<SSAValue> seen) { // public SSAValue createInstance(final TypeReference T, final boolean asManaged, VariableKey key, Set<SSAValue> seen) {

View File

@ -102,6 +102,7 @@ public class LoopAndroidModel extends SingleStartAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterSTART_OF_LOOP (int PC) { protected int enterSTART_OF_LOOP (int PC) {
logger.info("PC {} is the jump target of START_OF_LOOP", PC); logger.info("PC {} is the jump target of START_OF_LOOP", PC);
@ -136,6 +137,7 @@ public class LoopAndroidModel extends SingleStartAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterAFTER_LOOP (int PC) { protected int enterAFTER_LOOP (int PC) {
assert(outerLoopPC > 0) : "Somehow you managed to get the loop-target negative. This is wierd!"; assert(outerLoopPC > 0) : "Somehow you managed to get the loop-target negative. This is wierd!";
@ -192,6 +194,7 @@ public class LoopAndroidModel extends SingleStartAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int leaveAT_LAST (int PC) { protected int leaveAT_LAST (int PC) {
logger.info("Leaving Model with PC = {}", PC); logger.info("Leaving Model with PC = {}", PC);
return PC; return PC;

View File

@ -98,6 +98,7 @@ public class LoopKillAndroidModel extends LoopAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterAT_FIRST(int PC) { protected int enterAT_FIRST(int PC) {
logger.info("PC {} is the jump target of START_OF_LOOP", PC); logger.info("PC {} is the jump target of START_OF_LOOP", PC);
@ -132,6 +133,7 @@ public class LoopKillAndroidModel extends LoopAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int leaveAT_LAST (int PC) { protected int leaveAT_LAST (int PC) {
assert(outerLoopPC > 0) : "Somehow you managed to get the loop-target negative. This is wierd!"; assert(outerLoopPC > 0) : "Somehow you managed to get the loop-target negative. This is wierd!";

View File

@ -78,6 +78,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterAT_FIRST(int PC) { protected int enterAT_FIRST(int PC) {
return PC; return PC;
} }
@ -87,6 +88,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterBEFORE_LOOP (int PC) { protected int enterBEFORE_LOOP (int PC) {
return PC; return PC;
} }
@ -96,6 +98,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterSTART_OF_LOOP (int PC) { protected int enterSTART_OF_LOOP (int PC) {
return PC; return PC;
} }
@ -105,6 +108,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterMIDDLE_OF_LOOP (int PC) { protected int enterMIDDLE_OF_LOOP (int PC) {
return PC; return PC;
} }
@ -114,6 +118,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterMULTIPLE_TIMES_IN_LOOP (int PC) { protected int enterMULTIPLE_TIMES_IN_LOOP (int PC) {
return PC; return PC;
} }
@ -123,6 +128,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterEND_OF_LOOP (int PC) { protected int enterEND_OF_LOOP (int PC) {
return PC; return PC;
} }
@ -132,6 +138,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterAFTER_LOOP (int PC) { protected int enterAFTER_LOOP (int PC) {
return PC; return PC;
} }
@ -141,6 +148,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterAT_LAST (int PC) { protected int enterAT_LAST (int PC) {
return PC; return PC;
} }
@ -150,6 +158,7 @@ public final class SequentialAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int leaveAT_LAST (int PC) { protected int leaveAT_LAST (int PC) {
return PC; return PC;
} }

View File

@ -102,6 +102,7 @@ public class SingleStartAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterMULTIPLE_TIMES_IN_LOOP (int PC) { protected int enterMULTIPLE_TIMES_IN_LOOP (int PC) {
logger.info("PC {} is the jump target of START_OF_LOOP", PC); logger.info("PC {} is the jump target of START_OF_LOOP", PC);
this.outerLoopPC = PC; this.outerLoopPC = PC;
@ -135,6 +136,7 @@ public class SingleStartAndroidModel extends AbstractAndroidModel {
* *
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
protected int enterEND_OF_LOOP (int PC) { protected int enterEND_OF_LOOP (int PC) {
assert(outerLoopPC > 0) : "Somehow you managed to get the loop-target negative. This is wierd!"; assert(outerLoopPC > 0) : "Somehow you managed to get the loop-target negative. This is wierd!";

View File

@ -151,6 +151,7 @@ public class Intent implements ContextItem, Comparable<Intent> {
this.immutable = true; this.immutable = true;
} }
@Override
public Intent clone() { public Intent clone() {
final Intent clone = new Intent(); final Intent clone = new Intent();
clone.action = this.action; // OK here? clone.action = this.action; // OK here?

View File

@ -1454,6 +1454,7 @@ public class DexSSABuilder extends AbstractIntRegisterMachine {
* @param index - index into IR instruction array * @param index - index into IR instruction array
* @param vn - value number * @param vn - value number
*/ */
@Override
public String[] getLocalNames(int index, int vn) { public String[] getLocalNames(int index, int vn) {
try { try {
if (!dexCFG.getMethod().hasLocalVariableTable()) { if (!dexCFG.getMethod().hasLocalVariableTable()) {

View File

@ -31,6 +31,7 @@ public class Activator extends Plugin {
* *
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/ */
@Override
public void start(BundleContext context) throws Exception { public void start(BundleContext context) throws Exception {
super.start(context); super.start(context);
plugin = this; plugin = this;
@ -41,6 +42,7 @@ public class Activator extends Plugin {
* *
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/ */
@Override
public void stop(BundleContext context) throws Exception { public void stop(BundleContext context) throws Exception {
plugin = null; plugin = null;
super.stop(context); super.stop(context);

View File

@ -87,6 +87,7 @@ public class DomainElement {
@Override
public String toString() { public String toString() {
return codeElement.toString() + ", " + taintSource; return codeElement.toString() + ", " + taintSource;
} }

View File

@ -70,6 +70,7 @@ public class InstanceKeyElement extends CodeElement {
return ik.hashCode(); return ik.hashCode();
} }
@Override
public String toString() public String toString()
{ {
return "InstanceKeyElement("+ik+")"; return "InstanceKeyElement("+ik+")";

View File

@ -128,6 +128,7 @@ public class PrefixVariable extends AbstractVariable<PrefixVariable>{
} }
} }
@Override
public String toString() { public String toString() {
return knownPrefixes.toString(); return knownPrefixes.toString();
} }

View File

@ -204,6 +204,7 @@ public class StringBuilderUseAnalysis {
return retVal; return retVal;
} }
@Override
public String toString() { public String toString() {
return ("StringBuilderToString(instanceID = " + instanceID + "; concatenatedInstanceKeys = " + concatenatedInstanceKeys + ")"); return ("StringBuilderToString(instanceID = " + instanceID + "; concatenatedInstanceKeys = " + concatenatedInstanceKeys + ")");
} }

View File

@ -70,6 +70,7 @@ public class ConstantString extends InstanceKeySite {
return retVal; return retVal;
} }
@Override
public String toString() { public String toString() {
return ("ConstantString(instanceID = " + instanceID + "; value = " + constantValue + ")"); return ("ConstantString(instanceID = " + instanceID + "; value = " + constantValue + ")");
} }

View File

@ -78,6 +78,7 @@ public class UriAppendString extends InstanceKeySite {
return retVal; return retVal;
} }
@Override
public String toString() { public String toString() {
return ("UriAppendString(instanceID = " + instanceID + "; uriInstanceID = " + uriInstanceID + "; stringInstanceID = " + stringInstanceID + ")"); return ("UriAppendString(instanceID = " + instanceID + "; uriInstanceID = " + uriInstanceID + "; stringInstanceID = " + stringInstanceID + ")");
} }

View File

@ -73,6 +73,7 @@ public class UriParseString extends InstanceKeySite {
return retVal; return retVal;
} }
@Override
public String toString() { public String toString() {
return ("UriParseString(instanceID = " + instanceID + "; stringInstanceID = " + stringInstanceID + ")"); return ("UriParseString(instanceID = " + instanceID + "; stringInstanceID = " + stringInstanceID + ")");
} }

View File

@ -71,6 +71,7 @@ public class EntryArgSinkSpec extends SinkSpec {
argNums = args; argNums = args;
} }
@Override
public <E extends ISSABasicBlock> Collection<FlowType<E>> getFlowType( public <E extends ISSABasicBlock> Collection<FlowType<E>> getFlowType(
BasicBlockInContext<E> block) { BasicBlockInContext<E> block) {

View File

@ -176,7 +176,7 @@ public class DexDotUtil extends DotUtil {
* @return StringBuffer holding dot output representing G * @return StringBuffer holding dot output representing G
* @throws WalaException * @throws WalaException
*/ */
private static <T> StringBuffer dotOutput(Graph<T> g, NodeDecorator<T> labels, String title) throws WalaException { public static <T> StringBuffer dotOutput(Graph<T> g, NodeDecorator<T> labels, String title) throws WalaException {
StringBuffer result = new StringBuffer("digraph \"DirectedGraph\" {\n"); StringBuffer result = new StringBuffer("digraph \"DirectedGraph\" {\n");
if (title != null) { if (title != null) {

View File

@ -182,7 +182,7 @@ public class DotUtil {
* @return StringBuffer holding dot output representing G * @return StringBuffer holding dot output representing G
* @throws WalaException * @throws WalaException
*/ */
private static <T> StringBuffer dotOutput(Graph<T> g, NodeDecorator<T> labels, String title) throws WalaException { public static <T> StringBuffer dotOutput(Graph<T> g, NodeDecorator<T> labels, String title) throws WalaException {
StringBuffer result = new StringBuffer("digraph \"DirectedGraph\" {\n"); StringBuffer result = new StringBuffer("digraph \"DirectedGraph\" {\n");
if (title != null) { if (title != null) {