|
16 | 16 | import soot.SootField; |
17 | 17 | import soot.SootMethod; |
18 | 18 | import soot.Type; |
| 19 | +import soot.Unit; |
19 | 20 | import soot.UnitPatchingChain; |
| 21 | +import soot.jimple.IdentityStmt; |
20 | 22 | import soot.jimple.Jimple; |
| 23 | +import soot.jimple.JimpleBody; |
21 | 24 | import soot.jimple.NopStmt; |
| 25 | +import soot.jimple.ParameterRef; |
22 | 26 | import soot.jimple.infoflow.android.entryPointCreators.AndroidEntryPointConstants; |
23 | 27 | import soot.jimple.infoflow.android.entryPointCreators.ComponentExchangeInfo; |
24 | 28 | import soot.jimple.infoflow.android.manifest.IManifestHandler; |
25 | 29 | import soot.jimple.infoflow.util.SootUtils; |
| 30 | +import soot.tagkit.ExpectedTypeTag; |
26 | 31 |
|
27 | 32 | /** |
28 | 33 | * Entry point creator for content providers |
@@ -101,7 +106,16 @@ public Collection<SootMethod> getAdditionalMethods() { |
101 | 106 | protected void createEmptyMainMethod() { |
102 | 107 | super.createEmptyMainMethod(); |
103 | 108 | //the parameter with the content provider local |
104 | | - thisLocal = mainMethod.getActiveBody().getParameterLocal(1); |
| 109 | + JimpleBody jb = (JimpleBody) mainMethod.getActiveBody(); |
| 110 | + thisLocal = jb.getParameterLocal(1); |
| 111 | + for (Unit i : jb.getUnits()) { |
| 112 | + if (i instanceof IdentityStmt && ((IdentityStmt) i).getRightOp() instanceof ParameterRef) { |
| 113 | + ParameterRef paramRef = (ParameterRef) ((IdentityStmt) i).getRightOp(); |
| 114 | + if (paramRef.getIndex() == 1) { |
| 115 | + i.addTag(new ExpectedTypeTag(component.getType())); |
| 116 | + } |
| 117 | + } |
| 118 | + } |
105 | 119 | } |
106 | 120 |
|
107 | 121 | @Override |
|
0 commit comments