Skip to content

Instantly share code, notes, and snippets.

@jbranchaud
Last active December 17, 2015 06:59
Show Gist options
  • Save jbranchaud/5569689 to your computer and use it in GitHub Desktop.
Save jbranchaud/5569689 to your computer and use it in GitHub Desktop.
Fun with Soot on the command-line!
# Some commands from using Soot on the command-line
# First, put the Soot jars on your Java CLASSPATH (preferrably through .bashrc or .zshrc)
export SOOTJAR=path/to/sootclasses-2.5.0.jar
export JASMINJAR=path/to/jasminclasses-2.5.0.jar
export POLYGLOTJAR=path/to/polyglotclasses-1.3.5.jar
export CLASSPATH=$SOOTJAR:$JASMINJAR:$POLYGLOTJAR:$CLASSPATH
# Using Soot to compile a single Java file:
# +-project/
# +-Example.java
cd project
java soot.Main -cp . -pp Example
# Example.java is compiled to sootOutput
# Using Soot to compile a single Java file in a package:
# +-project/
# +-mypkg/
# +-Example.java
cd project
java soot.Main -cp . -pp mypkg.Example
# mypkg/Example.java is compiled to sootOutput/mypkg
# Using Soot to compile a simple project:
# +-project/
# +-Example.java // contains the main
# +-Extras.java
# +-stuff/
# +-Hello.java
cd project
java soot.Main -cp . -pp -process-dir .
# everything is compiled to ./sootOutput
# Using Soot to compile a simple project that depends on jars:
# +-project/
# +-Example.java // contains the main
# +-Extras.java
# +-stuff/
# | +-Hello.java
# +-lib/
# +-mylib.jar
cd project
java soot.Main -cp .:lib/mylib.jar -pp -process-dir .
# everything is compiled to ./sootOutput
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment