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

public class Intent extends Object implements 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
Author:
Tobias Blaschke <code@tobiasblaschke.de>
See Also:
  • Field Details

    • INTENT_KEY

      public static final ContextKey INTENT_KEY
      Key into the Context that represents the Intent.
    • UNBOUND

      public static final Atom UNBOUND
    • uri

      public Atom uri
  • Constructor Details

    • Intent

      public Intent()
    • Intent

      public Intent(String action)
    • Intent

      public Intent(Atom action)
    • Intent

      public Intent(Atom action, Atom uri)
    • Intent

      public Intent(TypeName action, Atom uri)
    • Intent

      public Intent(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(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(Atom action)
      Set the target of the intent.

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

    • getAction

      public 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>