Skip to content

Commit

Permalink
compatible with Soot 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shipperzhang committed Dec 11, 2019
1 parent 4e440c7 commit 7683dd6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tracer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target/*
backwardFlow
7 changes: 6 additions & 1 deletion tracer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>ca.mcgill.sable</groupId>
<artifactId>soot</artifactId>
<version>3.0.0-20171109.123005-225</version>
<version>3.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
9 changes: 7 additions & 2 deletions tracer/src/main/java/DataFlow/SensitiveMethodFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ public static List<Pair<String,String>> findSensitiveMethods(Map<SootMethod,List
for (Unit unit:body.getUnits()){
//Identify the Statement with invoke exp
if (((Stmt) unit).containsInvokeExpr()) {
SootMethod callee = ((Stmt) unit).getInvokeExpr().getMethod();
SootMethod callee = null;
try {
callee = ((Stmt) unit).getInvokeExpr().getMethod();
} catch (RuntimeException e) {
continue;
}
String calleeJavaPath = String.format("%s#%s", callee.getDeclaringClass().getName(), callee.getName());
//Ignore the invoke to the system method
if (Identifications.containsKey(calleeJavaPath)){
Expand Down Expand Up @@ -311,4 +316,4 @@ else if (dataFlowValue.getDataTypeAndOperation().getKey().equals("fs")) {
return pid;
}

}
}
9 changes: 7 additions & 2 deletions tracer/src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ public static void main(String args[]) throws IOException {
for (Unit unit:body.getUnits()){
//Identify the Statement with invoke exp
if (((Stmt) unit).containsInvokeExpr()) {
SootMethod callee = ((Stmt) unit).getInvokeExpr().getMethod();
SootMethod callee = null;
try{
callee = ((Stmt) unit).getInvokeExpr().getMethod();
} catch (RuntimeException e){
continue;
}
//Ignore the invoke to the system method
if (Config.identifyApplicationClass(callee.getDeclaringClass().getName())) {
if (calleeToCallerTable.containsKey(callee) == false)
Expand Down Expand Up @@ -281,4 +286,4 @@ public static void main(String args[]) throws IOException {

}

}
}

0 comments on commit 7683dd6

Please sign in to comment.