<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hello all,</div><div>I have used soot to instrument android app,but countered one problem,the instrumented app has no changes:</div><div><br></div><div>The following is my code:</div><div>&lt;/</div><div><div>try{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;sr.app.calculateSourcesSinksEntrypoints("/home/xcl/soot-jar/SourcesAndSinks.txt");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span> }catch(XmlPullParserException e){</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>System.out.println("void main XmlPullParserException: ");</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>e.printStackTrace();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span> <span class="Apple-tab-span" style="white-space:pre">        </span>}catch(IOException e){</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>System.out.println("void main IOException: ");</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>e.printStackTrace();</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp;soot.G.reset();<span class="Apple-tab-span" style="white-space:pre">                </span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//prefer Android APK files// -src-prec apk</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options.v().set_src_prec(Options.src_prec_apk);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options.v().set_process_dir(Collections.singletonList(sr.apkPath));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options.v().set_android_jars("/home/xcl/soot-jar/android-platform");</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//output as APK, too//-f dex&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options.v().set_allow_phantom_refs(true);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options.v().set_output_dir("/home/xcl/ic3/apk/sootOutput");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Options.v().set_output_format(Options.output_format_dex);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Scene.v().loadNecessaryClasses();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PackManager.v().runPacks();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SootClass clazz=Scene.v().getSootClass("com.example.helloworld.Handle");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SootMethod method=clazz.getMethod("void onCreate(android.os.Bundle)");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Body b=method.getActiveBody();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PatchingChain&lt;Unit&gt; units=b.getUnits();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Local tmpRef = Jimple.v().newLocal("tmpRef", RefType.v("java.io.PrintStream"));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;b.getLocals().add(tmpRef);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Stmt stmt=Jimple.v().newAssignStmt(</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <span class="Apple-tab-span" style="white-space:pre">                </span>tmpRef, Jimple.v().newStaticFieldRef(&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Scene.v().getField("&lt;java.lang.System: java.io.PrintStream out&gt;").makeRef()));</div><div>&nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;units.insertBefore(stmt, units.getFirst()); &nbsp; &nbsp;&nbsp;<span style="line-height: 23.7999992370605px;">//add one Stmt</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(b);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PackManager.v().writeOutput();</div></div><div>/&gt;</div><div>So,could you tell me what's wrong with my code? Looking forward to your reply.</div><div><br></div><div>Best Regards,</div><div>ConlyXia</div></div><br><br><span title="neteasefooter"><p>&nbsp;</p></span>