[Soot-list] soot can not execute Scene Transformer for apk
Marc Miltenberger
Marc.Miltenberger at cased.de
Tue Dec 8 14:21:49 EST 2015
Hi there,
Why do you add your transformer after runPacks?
Try to add it before, and then call runPacks.
Best regards,
Marc
Am 08.12.2015 um 08:24 schrieb conlyxia:
> 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
>
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>
More information about the Soot-list
mailing list