/

Exclusions

Exclusions let you prevent specific symbols from being obfuscated. This is essential for symbols that must retain their original names at runtime, such as classes accessed via reflection or Interface Builder outlets.


How Exclusions Work

When you exclude a symbol, Shield preserves its original name in the protected binary. Exclusions apply to symbol renaming and do not affect other protections like string encryption or runtime protections.

Exclusions are configured in the symbol_renaming section of your configuration file using wildcard patterns.


Configuration

Add exclusion patterns to the exclude array in your symbol_renaming configuration:

JSON
{
  "protections": {
    "symbol_renaming": {
      "enabled": true,
      "exclude": [
        "AppDelegate",
        "SceneDelegate",
        "*Delegate",
        "*ViewController",
        "*.xib",
        "*.storyboard"
      ]
    }
  }
}

Pattern Syntax

Exclusion patterns support wildcards:

PatternMatches
AppDelegateExact match for AppDelegate
*DelegateAny symbol ending in Delegate
My*Any symbol starting with My
*View*Any symbol containing View

Common Exclusions

Interface Builder

If your application uses Storyboards or XIB files, exclude view controllers and outlets that are referenced by name:

JSON
{
  "exclude": [
    "*ViewController",
    "*TableViewCell",
    "*CollectionViewCell"
  ]
}

Codable and Serialization

Classes that conform to Codable or use NSCoding need their property names preserved for serialization:

JSON
{
  "exclude": [
    "*Model",
    "*Response",
    "*Request"
  ]
}

Objective-C Bridging

Symbols accessed from Objective-C via @objc annotations or bridging headers should be excluded:

JSON
{
  "exclude": [
    "*Bridge*",
    "*Delegate"
  ]
}

Third-Party SDKs

If you use third-party SDKs that reference your classes by name (such as analytics, crash reporting, or deep linking), exclude those entry points:

JSON
{
  "exclude": [
    "AppDelegate",
    "SceneDelegate",
    "*Handler"
  ]
}

Granular Exclusions

You can control which symbol types are renamed independently:

JSON
{
  "symbol_renaming": {
    "enabled": true,
    "rename_classes": true,
    "rename_methods": true,
    "rename_properties": true,
    "rename_protocols": false,
    "exclude": ["AppDelegate", "SceneDelegate"]
  }
}

Setting rename_protocols to false preserves all protocol names, which is useful when protocols are referenced by name at runtime.


String Encryption Exclusions

You can also exclude specific strings from encryption:

JSON
{
  "string_encryption": {
    "enabled": true,
    "exclude": [
      "http://*",
      "https://*",
      "ftp://*"
    ]
  }
}

This is useful for URL strings that need to remain readable for network debugging or analytics tools.


Previous
Build Profiles