Phantom Reference in Soot



Phantom classes are classes that are neither in the process directory nor on the Soot classpath, but that are referenced by some class / method body that Soot loads.

  • Process Directory: contains Application classes.
  • Soot Classpath: contains Library Classes.

There are several scenarios that reference classes don’t exist. A developer might leave the code to improve it later, or he got rid of some jar files that was in use but not executable. Sometimes people left such code because it will not be reachable on runtime anyway.

However there is another case that is significant. The actual reference classes can be inside of the actual device, and can be not showing until it runs. So in this case, it will be bad idea to touch or to handle this phantom classes.



  • Soot option that can handle phantom classes. (not recommended by Soot)
  • Only use this option if you know what you are doing.
  • Soot will not just abort and fail on such an unresolvable reference, but create an empty stub called a phantom class which in turn contains phanom methods to make up for the missing bits and pieces.


Leave A Comment

Your email address will not be published. Required fields are marked *