[Soot-list] soot can not execute Scene Transformer for apk

conlyxia conlyxia at 163.com
Tue Dec 8 02:24:15 EST 2015


Hi all,
I used soot to analyze apk,and instrumented apk by modifying jimple code.I put the code about modifying jimple stmt in the SceneTransformer(wjtp).But,the issue was that the apk has no changes(I decompiled the instrumented apk to see the jimple code).I thougt the Scene Transformer didn't work.And the relative code in main method is as following:


<code snip>
Options.v().set_src_prec(Options.src_prec_apk);
Options.v().set_process_dir(Collections.singletonList(sr.apkPath));
Options.v().set_android_jars("/home/xcl/soot-jar/android-platform");
Options.v().set_output_format(Options.output_format_dex);
Options.v().set_output_dir("/home/xcl/ic3/apk-mod/classes");
Options.v().set_allow_phantom_refs(true);
Options.v().set_whole_program(true);
Options.v().setPhaseOption("jb", "enabled:true");
Options.v().setPhaseOption("wjtp", "enabled:true");


Scene.v().loadNecessaryClasses();
SootMethod entryPoint = sr.app.getEntryPointCreator().createDummyMain();
Options.v().set_main_class(entryPoint.getSignature());
Scene.v().setEntryPoints(Collections.singletonList(entryPoint));
   
PackManager.v().runPacks();
PackManager.v().getPack("wjtp").add(
             new Transform("wjtp.myTransform", new SceneTransformer() {
               protected void internalTransform(String phaseName,
                   Map<String,String> options) {
                 System.err.println(Scene.v().getApplicationClasses());
                 System.out.println("okokok");     //This instruction could not print "okokok" in console
                           //modifying jimple code stmt
                          ...
               }
             }));
PackManager.v().writeOutput();
</code snip>


So,is there something wrong with my code?And looking forward to your reply.


Best regards,
Conly Xia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20151208/063696d7/attachment.html 


More information about the Soot-list mailing list