After two days of hard work, don't say anything, first come to a picture:
Looks so beautiful, O (∩_∩) o haha ~
The experimental environment is Ubuntu.
1.JDK version must be 1.7 or below, JDK1.8 No, always error,
2. Download Sootclasses-2.5.0.jar Package: http://download.csdn.net/download/sheshizhang/4573588
Can be on the GitHub on the official website of the small example to try Taker: Https://github.com/Sable/soot/wiki/Introduction:-Soot-as-a-command-line-tool
3. Following the formal use of soot, first define the Soot.jar reference path:
Export Soot_path= $HOME/mooc/soot-2.4.0.jar
4. The path of the referenced class:
Export CLASS_DIR=/HOME/CPP/CP
5. Name of the custom class:
Export Class_name=test1
6. Compile Java files using Javac:
Javac $CLASS _dir/$CLASS _name.java
7. Define Soot-class Path:
Export soot_class_path= $CLASS _dir: $JAVA _home/jre/lib/rt.jar
8. Generate dot files using commands:
JAVA-CP $SOOT _path soot.tools.CFGViewer--soot-class-path $SOOT _class_path--graph=briefblockgraph $CLASS _name
The command screenshot is as follows:
9. Download the Graphviz tool below to visualize the dot file, dot file specific is what small partners can go to the official website to see.
Install the Graphviz Networking Usage command under Linux:
sudo apt-get install Graphviz
10. Verification command:
Dot-version
As shown below:
More than 10 kinds of diagram file format, there is always a suitable for you, 0 (^ dish ^) っhiahia ...
11. Use dot command:
Dot-tgif 111.dot-o 111.gif,
Here we convert the dot to a GIF, and we can see him in the automatically generated folder Sootoutput, there's a lot of excitement in the wood.
PostScript language: Recently because of the need to draw the Java control Flow diagram is not very good to meet the needs of the small partners have better tools to share out yo, you need not so hard, can be in the comments area to communicate with each other