java.lang.Object
com.ibm.wala.dalvik.ipa.callgraph.propagation.cfa.Intent
All Implemented Interfaces:
com.ibm.wala.ipa.callgraph.ContextItem, Comparable<Intent>
Direct Known Subclasses:
AndroidSettingFactory.ExternalIntent, AndroidSettingFactory.IgnoreIntent, AndroidSettingFactory.InternalIntent, AndroidSettingFactory.StandardIntent, AndroidSettingFactory.UnknownIntent

public class Intent extends Object implements com.ibm.wala.ipa.callgraph.ContextItem, Comparable<Intent>
Determines the target of an Android-Intent.

An Intent is generated at each Constructor-Call of an Android-Intent. Information to that Constructor is added as target.

If you want to change the target don't change this Object! Instead place an override using the AndroidEntryPointManager so no information is lost.

Upon the creation of an Intent it's target-type almost always points to UNKNOWN. Again change this using an override.

This class contains functions that determine the target-type on the Intent itself. They are intended as fallback only.

CAUTION: If you inherit from this class - keep hashCodes and equals clashing!

Since:
2013-10-12
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     

    Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem

    com.ibm.wala.ipa.callgraph.ContextItem.Value<T extends Object>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.ibm.wala.ipa.callgraph.ContextKey
    Key into the Context that represents the Intent.
    static final com.ibm.wala.core.util.strings.Atom
     
    com.ibm.wala.core.util.strings.Atom
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Intent(com.ibm.wala.core.util.strings.Atom action)
     
    Intent(com.ibm.wala.core.util.strings.Atom action, com.ibm.wala.core.util.strings.Atom uri)
     
    Intent(com.ibm.wala.types.TypeName action)
     
    Intent(com.ibm.wala.types.TypeName action, com.ibm.wala.core.util.strings.Atom uri)
     
    Intent(String action)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
     
    boolean
    Does not consider the associated URI.
    boolean
    Intents are equal to Intents with other type.
    com.ibm.wala.core.util.strings.Atom
     
    Return the type of Component associated with this Intent.
     
    int
    CLASHES: Does not consider intent-type.
    boolean
     
    boolean
    isExternal(boolean strict)
    Has the target to be resolved by an external App.
    boolean
    isInternal(boolean strict)
    Is the Intents target internally resolvable.
    boolean
    isStandard(boolean strict)
    Is the Intent one of the System-Defined ones.
     
    void
    setAction(com.ibm.wala.core.util.strings.Atom action)
    Set the target of the intent.
    void
    setActionExplicit(com.ibm.wala.core.util.strings.Atom action)
    Set the explicit target of the intent.
    void
     
    void
     
     
    void
     

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • INTENT_KEY

      public static final com.ibm.wala.ipa.callgraph.ContextKey INTENT_KEY
      Key into the Context that represents the Intent.
    • UNBOUND

      public static final com.ibm.wala.core.util.strings.Atom UNBOUND
    • uri

      public com.ibm.wala.core.util.strings.Atom uri
  • Constructor Details

    • Intent

      public Intent()
    • Intent

      public Intent(String action)
    • Intent

      public Intent(com.ibm.wala.core.util.strings.Atom action)
    • Intent

      public Intent(com.ibm.wala.core.util.strings.Atom action, com.ibm.wala.core.util.strings.Atom uri)
    • Intent

      public Intent(com.ibm.wala.types.TypeName action, com.ibm.wala.core.util.strings.Atom uri)
    • Intent

      public Intent(com.ibm.wala.types.TypeName action)
  • Method Details

    • setExplicit

      public void setExplicit()
    • isExplicit

      public boolean isExplicit()
    • setImmutable

      public void setImmutable()
    • clone

      public Intent clone()
      Overrides:
      clone in class Object
    • setActionExplicit

      public void setActionExplicit(com.ibm.wala.core.util.strings.Atom action)
      Set the explicit target of the intent.

      If setAction is called multible times on an Intent it becomes UNBOUND.

    • unbind

      public void unbind()
    • setAction

      public void setAction(com.ibm.wala.core.util.strings.Atom action)
      Set the target of the intent.

      If setAction is called multible times on an Intent it becomes UNBOUND.

    • getAction

      public com.ibm.wala.core.util.strings.Atom getAction()
    • getType

      public Intent.IntentType getType()
    • getComponent

      public AndroidComponent getComponent()
      Return the type of Component associated with this Intent.

      May return null (especially on an UNKNOWN target). The IntentContextInterpreter uses the IntentStarters.StartInfo to determine the Target. However it is nicer to set the Component here.

      TODO: Set the Component somewhere

    • isInternal

      public boolean isInternal(boolean strict)
      Is the Intents target internally resolvable.
      Parameters:
      strict - if false return unknown target as internal
      Returns:
      if the Intent is associated to a class in the analyzed application.
    • isExternal

      public boolean isExternal(boolean strict)
      Has the target to be resolved by an external App.

      The Intent is not associated to a class in this application or it's a Standard action defined in the Android Reference Manual.

      Parameters:
      strict - if false return unknown target as external
    • isStandard

      public boolean isStandard(boolean strict)
      Is the Intent one of the System-Defined ones.

      It's a Standard action defined in the Android Reference Manual. Implies isExternal.

      Parameters:
      strict - if false return unknown target as standard
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      CLASHES: Does not consider intent-type.

      This clash is however intended: This aids in resolving the override of an Intent. The AndroidEntryPointManager generates new Intent Objects. Instead of searching all overrides we get it for free.

      Overrides:
      hashCode in class Object
    • equalAction

      public boolean equalAction(Intent other)
      Does not consider the associated URI.
    • equals

      public boolean equals(Object o)
      Intents are equal to Intents with other type.

      This clash is however intended: This aids in resolving the override of an Intent. The AndroidEntryPointManager generates new Intent Objects. Instead of searching all overrides we get it for free.

      Overrides:
      equals in class Object
    • resolve

      public Intent resolve()
    • compareTo

      public int compareTo(Intent other)
      Specified by:
      compareTo in interface Comparable<Intent>