Once you have installed the soot-eclipse plugin and restarted Eclipse you must make the menus available by the following:
- Select Window -- Customize Perspective
- Expand Other option in the tree
- Click on soot then OK
Now under the Project menu there should be a Soot section (the menu items may be grayed out at this point)
You must also switch to the Java Perspective in Eclipse:
Select Window -- Open Perspective -- Java
This isn't actually necessary to use Soot, but it is if you want to demonstrate that your Java class runs.
As Soot runs on java classes, you must create or import some.
Step 1: click File -> New -> Project
This brings up the New Project Dialog
Step 2: click Java then Java Project then Next
Step 3: enter a name for your project and click Next
This brings you to New Java Project Dialog and the Source Tab
Step 4: click Add Folder
This brings you to the Source Folder Selection Dialog
Step 5: click Create New Folder
Step 6: enter src for Folder Name and click OK
Step 7: click OK
Step 8: click Yes in response to the question about changing folders
Step 9: click Finish
You now have a project with a src folder ready for use. For more information about Eclipse Help see www.eclipse.org (look for Online Help section).
Caveat: source folders
One note, currently there are problems with the soot plugin in you don't make a src folder in your Java project and instead use the project as the source folder. What happens is the first time you run Soot everything works fine, except that the sootOutput folder automatically becaomes a package (as the project output folder is the project folder). The second time you run Soot (at the project level) it tries to process files inside the sootOutput folder which are not on the class path and all sorts of errors occur. So don't do this.
Running Soot on all the classes in the output folder of your project:
- First build the classes.
- Then select any java file in the project.
- Then select Project -- Soot and any menu item:
There are currently four:
- Create Jimple for Project - creates Jimple files
- Dava Decompile Project - decompiles
- Run Soot ... - opens a dialog box containing all Soot options
- Manage Configurations ... - opens a dialog where you can create and save, edit, remove and run different configurations of the Soot options
Running Soot on imported folder of classes:
Select any class file. Right click and select Soot -- and any menu item (they are similar to the project menu items)
- Select the foler. Right click and select Soot -- Dava Decompile (to decompile all the classes in your imported folder of classes)
Running Soot on files:
Select the file. Right click and select Soot -- and any menu item (they ar
e similar to the project menu items)
Selecting Output Options -- Output Format -- Jimple File
and under Jimple Annotations Pack:
Null Pointer Check Options
-- unselect Disabled
-- select Only Array Ref
Array Bounds Check Options
-- unselect Disabled
-- select With All
Running this configuration causes a bunch of attribute tags to be generated.
After running open a generated Jimple File and there should be markers in the file indicating attributes.
Mouse over the line in the editor with a marker and you should see a tooltip with the attribute.
Also these attributes tooltips should appear in the original Java source file.
One other note: For long-running memory intensive Soot configurations Eclipse may run out of memory. To handle this start Eclipse with:
eclipse -vmargs -Xmx300M
For more detailed documentation: Plugin Help