Skip to content

Commit 9a2ca62

Browse files
committed
Add exceptions to uncalled methods
1 parent 28afc3e commit 9a2ca62

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/edu/uniandes/tsdl/mutapk/helper/CallGraphHelper.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public static HashMap<String, HashMap<String, CallGraphNode>> getCallGraph(HashM
2525
for(Entry<String, SmaliAST> entry : smaliASTs.entrySet()) {
2626
callGraph.put(entry.getKey(), generateSmaliCGNodes(entry.getValue()));
2727
}
28+
int contador = 0;
2829

2930
for(Entry<String, HashMap<String, CallGraphNode>> entry : callGraph.entrySet()) {
3031
System.out.println(entry.getKey());
@@ -44,12 +45,20 @@ public static HashMap<String, HashMap<String, CallGraphNode>> getCallGraph(HashM
4445
CallGraphNode calledCGN = callGraph.get(methodCallSegments[0]).get(methodCallSegments[1]);
4546
calledCGN.addCaller(cGN);
4647
cGN.addCallee(calledCGN);
47-
} else if(!methodCall.startsWith("Ljava") || !methodCall.startsWith("Landroid")) {
48+
} else if(!methodCall.startsWith("Ljava")
49+
&& !methodCall.startsWith("Landroid")
50+
&& !methodCallSegments[1].startsWith("findViewById")
51+
&& !methodCallSegments[1].startsWith("getActivity")
52+
&& !methodCallSegments[1].startsWith("getContentResolver")
53+
// && !methodCallSegments[1].startsWith("getParent")
54+
) {
4855
System.out.println(" ###"+methodCall);
56+
contador++;
4957
}
5058
}
5159
}
5260
}
61+
System.out.println(contador);
5362

5463
return callGraph;
5564
}

0 commit comments

Comments
 (0)