# Annotation Type Hardening

@Retention(CLASS) @Target(TYPE) public @interface Hardening

App hardening build hints, checked by the compiler.

Place this on your application's main class -- the class named by `codename1.mainName`. An attribute you do not set is not written at all, so the build server's own default applies. The `default` clause below each attribute names a constant that says nothing -- see `HintUnset` -- and this package deliberately does not record what the server would do instead, because that is the server's to change.

- ## Optional Element Summary

  Optional Elements
  Modifier and Type
  Optional Element
  Description
  `Toggle`
  `allowUnhardenedLocalBuild`
  Permits a local or source build to run with hardening requested but not applied.
  `HardenControlFlow`
  `controlFlow`
  Overrides control-flow obfuscation independently of harden.level.
  `String`
  `keep`
  Keep rules in ProGuard syntax, one per line, for classes that are resolved by name at runtime and so can't be found by the automatic analysis.
  `HardenLevel`
  `level`
  Master switch for app hardening: off, standard, aggressive or paranoid.
  `Toggle`
  `rename`
  Overrides symbol renaming independently of harden.level.
  `HardenStrings`
  `strings`
  Overrides string obfuscation independently of harden.level: off, constants or all.

- ## Element Details

  - ### allowUnhardenedLocalBuild

    Toggle allowUnhardenedLocalBuild
    Permits a local or source build to run with hardening requested but not applied. Without it such a build is refused, so a hardened app is never shipped from a target that can't actually harden it.
    Default:
      `DEFAULT`

  - ### controlFlow

    HardenControlFlow controlFlow
    Overrides control-flow obfuscation independently of harden.level.
    Default:
      `DEFAULT`

  - ### keep

    String keep
    Keep rules in ProGuard syntax, one per line, for classes that are resolved by name at runtime and so can't be found by the automatic analysis. Same syntax as android.proguardKeep, so existing rules port directly. Rules are separated by newlines only, because a semicolon is legal inside a rule body such as { *; }.
    Default:
      `""`

  - ### level

    HardenLevel level
    Master switch for app hardening: off, standard, aggressive or paranoid. An unrecognized value fails the build rather than being treated as off.
    Default:
      `DEFAULT`

  - ### rename

    Toggle rename
    Overrides symbol renaming independently of harden.level.
    Default:
      `DEFAULT`

  - ### strings

    HardenStrings strings
    Overrides string obfuscation independently of harden.level: off, constants or all.
    Default:
      `DEFAULT`