This repository contains (will contain) several simple examples of static program analysis in Java using Soot.
Anybody who knows Java programming and wants to do some static analysis in practice but does not know anything about Soot and static analysis in theory.
If you have some knowledge about static program analysis I suggest you learn Soot from here.
In this chapter, you will visit a very simple code example to be familiar with Soot essential data structures and Jimple, Soot's principle intermediate representation.
./gradlew run --args="HelloSoot"
: The Jimple representation of the printFizzBuzz method alongside the branch statement../gradlew run --args="HelloSoot draw"
: The visualization of the printFizzBuzz control-flow graph.
Title | Tutorial | Soot Code | Example Input |
---|---|---|---|
Hello Soot | Doc | HelloSoot.java | FizzBuzz.java |
In this chapter, you will be familiar with some basic but useful methods in Soot to help read, analyze, and even update java code.
./gradlew run --args="BasicAPI"
: Analyze the class Circle../gradlew run --args="BasicAPI draw"
: Analyze the class Circle and draws the call graph.
Title | Tutorial | Soot Code | Example Input |
---|---|---|---|
Basic API | Doc | BasicAPI.java | Circle |
./gradlew run --args="UsageFinder 'void println(java.lang.String)' 'java.io.PrintStream"
: Find usages of the method with the given subsignature in all methods of UsageExample.java../gradlew run --args="UsageFinder 'void println(java.lang.String)' 'java.io.PrintStream"
: Find usages of the method with the given subsignature of the given class signature in all methods of UsageExample.java.
Title | Tutorial | Soot Code | Example Input |
---|---|---|---|
Find usages of a method | UsageFinder.java | UsageExample.java | |
Null Pointer Analysis | NullPointerAnalysis | NullPointerExample.java |
Title | Tutorial | Soot Code | Example Input |
---|---|---|---|
Title | Tutorial | Soot Code | Example Input |
---|---|---|---|
Trace an APK | AndroidTracer.java |