Class ShieldSignal

java.lang.Object
com.codename1.security.shield.ShieldSignal

public final class ShieldSignal extends Object

One runtime self-protection observation, such as "a hooking framework is loaded".

Signals are reports, not verdicts. The device never decides it is compromised and never terminates itself over one of these; it reports what it saw and the attestation service decides whether to keep issuing tokens. That ordering matters for two reasons: a hard local exit is trivially patched out of the binary, and it destroys the telemetry that would have told the developer an attack was happening at all.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    An accessibility service that is not on the allow list is enabled.
    static final String
    A debugger is attached to the process.
    static final String
    The app is running on an emulator or simulator.
    static final String
    A dynamic instrumentation or hooking framework is present.
    static final String
    A jailbroken iOS device.
    static final String
    The app's signing certificate does not match the one it was built with.
    static final String
    A rooted Android device.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ShieldSignal(String id, int severity, String detail)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    What was actually observed, for example the offending package or library name.
    A stable identifier such as HOOK.
    int
    How strongly this points at an attack, 0 to 100.
    long
    When the observation was made.
    Returns a string representation of the object.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • ShieldSignal

      public ShieldSignal(String id, int severity, String detail)
  • Method Details

    • getId

      public String getId()
      A stable identifier such as HOOK. Engines may report ids this build predates.
    • getSeverity

      public int getSeverity()
      How strongly this points at an attack, 0 to 100. Advisory only -- the service applies the policy, so a low severity here does not mean the service will ignore it.
    • getDetail

      public String getDetail()
      What was actually observed, for example the offending package or library name. May be null.
    • getTimestamp

      public long getTimestamp()
      When the observation was made.
    • toString

      public String toString()
      Description copied from class: Object
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
      Overrides:
      toString in class Object