dk.brics.string.external
Class MainExternalVisibility
java.lang.Object
dk.brics.string.external.MainExternalVisibility
- All Implemented Interfaces:
- ExternalVisibility
public class MainExternalVisibility
- extends Object
- implements ExternalVisibility
Treats only main methods as externally visible, and no fields as externally visible.
Here, a main method is any public and static method named "main" whose only parameter
has type String[].
This is sound and quite precise for analyzing standalone applications that don't use
callbacks to external code.
- Author:
- Asger
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MainExternalVisibility
public MainExternalVisibility()
isExternallyVisibleField
public boolean isExternallyVisibleField(SootField field)
- Description copied from interface:
ExternalVisibility
- Defines which fields are seen by the string analysis as being
acecssible from unknown code. Note that this is also called for private
fields, so a reasonable implementation should return false for such fields.
An externally visible field is considered to be corrupt, meaning it can spontaneously
change value.
- Specified by:
isExternallyVisibleField
in interface ExternalVisibility
- Parameters:
field
- a field in the application being analyzed
- Returns:
- true if the field is externally visible.
isExternallyVisibleMethod
public boolean isExternallyVisibleMethod(SootMethod sm)
- Description copied from interface:
ExternalVisibility
- Defines which methods are seen by the string analysis as being
accessible from unknown code.
The arguments to these methods can contain any values,
and the return values might escape to unknown code.
- Specified by:
isExternallyVisibleMethod
in interface ExternalVisibility
- Parameters:
sm
- a method in the analyzed code.
- Returns:
- whether the method could possibly be called from unknown code.
Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.