Skip to content

How to Generate a Jimple File #555

Answered by stschott
75ACOL asked this question in Q&A
Mar 7, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Here is an example of how to extract the Jimple code of a SootClass into a string:

StringWriter stringWriter = new StringWriter();
PrintWriter writerOut = new PrintWriter(stringWriter);
Printer printer = new Printer();
printer.printTo(sootClass, writerOut);
writerOut.flush();
String jimpleOfSootClass = stringWriter.toString();

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@stschott
Comment options

@75ACOL
Comment options

Answer selected by JonasKlauke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants