@@ -181,6 +181,7 @@ protected SootMethod generateRedirectMethodForStartActivityForResult(SootClass o
181181 dummyMainClass .addMethod (newSM );
182182 final JimpleBody b = Jimple .v ().newBody (newSM );
183183 newSM .setActiveBody (b );
184+ newSM .addTag (SimulatedCodeElementTag .TAG );
184185
185186 LocalGenerator lg = new LocalGenerator (b );
186187
@@ -228,13 +229,14 @@ protected SootMethod generateRedirectMethodForStartActivityForResult(SootClass o
228229 protected SootMethod generateRedirectMethod (SootClass wrapper ) {
229230 SootMethod targetDummyMain = componentToEntryPoint .getEntryPoint (wrapper );
230231 if (targetDummyMain == null ) {
231- logger .warn (String . format ( "Destination component %s has no dummy main method" , wrapper .getName () ));
232+ logger .warn ("Destination component {} has no dummy main method" , wrapper .getName ());
232233 return null ;
233234 }
234235
235236 String newSM_name = "redirector" + num ++;
236237 SootMethod newSM = Scene .v ().makeSootMethod (newSM_name , Collections .<Type >singletonList (INTENT_TYPE ),
237238 VoidType .v (), Modifier .STATIC | Modifier .PUBLIC );
239+ newSM .addTag (SimulatedCodeElementTag .TAG );
238240 dummyMainClass .addMethod (newSM );
239241 JimpleBody b = Jimple .v ().newBody (newSM );
240242 newSM .setActiveBody (b );
@@ -260,12 +262,13 @@ protected SootMethod generateRedirectMethod(SootClass wrapper) {
260262 protected SootMethod generateRedirectMethodForStartActivity (SootClass wrapper ) {
261263 SootMethod targetDummyMain = componentToEntryPoint .getEntryPoint (wrapper );
262264 if (targetDummyMain == null ) {
263- logger .warn (String . format ( "Destination component %s has no dummy main method" , wrapper .getName () ));
265+ logger .warn ("Destination component {} has no dummy main method" , wrapper .getName ());
264266 return null ;
265267 }
266268 String newSM_name = "redirector" + num ++;
267269 SootMethod newSM = Scene .v ().makeSootMethod (newSM_name , Collections .<Type >singletonList (INTENT_TYPE ),
268270 VoidType .v (), Modifier .STATIC | Modifier .PUBLIC );
271+ newSM .addTag (SimulatedCodeElementTag .TAG );
269272 dummyMainClass .addMethod (newSM );
270273 JimpleBody b = Jimple .v ().newBody (newSM );
271274 newSM .setActiveBody (b );
@@ -291,12 +294,12 @@ protected SootMethod generateRedirectMethodForStartActivity(SootClass wrapper) {
291294 protected SootMethod generateRedirectMethodForBindService (SootClass serviceConnection , SootClass destComp ) {
292295 ServiceEntryPointInfo entryPointInfo = (ServiceEntryPointInfo ) componentToEntryPoint .get (destComp );
293296 if (entryPointInfo == null ) {
294- logger .warn (String . format ( "Destination component %s has no dummy main method" , destComp .getName () ));
297+ logger .warn ("Destination component {} has no dummy main method" , destComp .getName ());
295298 return null ;
296299 }
297300 SootMethod targetDummyMain = entryPointInfo .getEntryPoint ();
298301 if (targetDummyMain == null ) {
299- logger .warn (String . format ( "Destination component %s has no dummy main method" , destComp .getName () ));
302+ logger .warn ("Destination component {} has no dummy main method" , destComp .getName ());
300303 return null ;
301304 }
302305 String newSM_name = "redirector" + num ++;
@@ -307,6 +310,7 @@ protected SootMethod generateRedirectMethodForBindService(SootClass serviceConne
307310
308311 SootMethod newSM = Scene .v ().makeSootMethod (newSM_name , newSM_parameters , VoidType .v (),
309312 Modifier .STATIC | Modifier .PUBLIC );
313+ newSM .addTag (SimulatedCodeElementTag .TAG );
310314 dummyMainClass .addMethod (newSM );
311315 JimpleBody b = Jimple .v ().newBody (newSM );
312316 newSM .setActiveBody (b );
@@ -342,7 +346,7 @@ protected SootMethod generateRedirectMethodForBindService(SootClass serviceConne
342346 Local iLocal1 = lg .generateLocal (RefType .v ("android.content.ComponentName" ));
343347 b .getUnits ().add (Jimple .v ().newAssignStmt (iLocal1 , NullConstant .v ()));
344348
345- List <Value > args = new ArrayList <Value >();
349+ List <Value > args = new ArrayList <>();
346350 args .add (iLocal1 );
347351 args .add (ibinderLocal );
348352 SootClass sc = Scene .v ().getSootClass (originActivityParameterLocal .getType ().toString ());
@@ -363,6 +367,7 @@ protected SootMethod generateRedirectMethodForContentProvider(Stmt iccStmt, Soot
363367 String newSM_name = "redirector" + num ++;
364368 SootMethod newSM = Scene .v ().makeSootMethod (newSM_name , iccMethod .getParameterTypes (),
365369 iccMethod .getReturnType (), Modifier .STATIC | Modifier .PUBLIC );
370+ newSM .addTag (SimulatedCodeElementTag .TAG );
366371 dummyMainClass .addMethod (newSM );
367372 JimpleBody b = Jimple .v ().newBody (newSM );
368373 newSM .setActiveBody (b );
@@ -419,7 +424,7 @@ protected void insertRedirectMethodCallAfterIccMethod(IccLink link, SootMethod r
419424
420425 // specially deal with startActivityForResult since they have two
421426 // parameters
422- List <Value > args = new ArrayList <Value >();
427+ List <Value > args = new ArrayList <>();
423428 if (callee .getNumberedSubSignature ().equals (subsigStartActivityForResult )) {
424429 InstanceInvokeExpr iiexpr = (InstanceInvokeExpr ) fromStmt .getInvokeExpr ();
425430 args .add (iiexpr .getBase ());
@@ -451,8 +456,9 @@ protected void insertRedirectMethodCallAfterIccMethod(IccLink link, SootMethod r
451456 redirectCallU .addTag (SimulatedCodeElementTag .TAG );
452457 units .insertAfter (redirectCallU , link .getFromU ());
453458 instrumentedUnits .put (body , redirectCallU );
454- if (instrumentationCallback != null )
459+ if (instrumentationCallback != null ) {
455460 instrumentationCallback .onRedirectorCallInserted (link , redirectCallU , redirectMethod );
461+ }
456462
457463 // remove the real ICC methods call stmt
458464 // link.getFromSM().retrieveActiveBody().getUnits().remove(link.getFromU());
0 commit comments