/

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.


Automatic Exclusions

Shield automatically preserves symbols that must not be renamed. You do not need to add these manually.

Apple frameworks: UIKit, SwiftUI, Foundation lifecycle methods are always preserved.

Objective-C runtime symbols: Classes, protocols, and selectors found in ObjC metadata sections are excluded.

Third-party libraries: Classes with known SDK prefixes are excluded automatically using startswith matching:

PrefixLibrary
FIR, GUL, GTM, GDT, GSD, GADFirebase / Google
FB, FBSDKFacebook SDK
CLS, CrashlyticsCrashlytics
GAIGoogle Analytics (legacy)
nanopb_nanopb (Firebase dependency)
AFAlamofire ObjC bridge
SDSDWebImage
RealmRealm
RCT, RNReact Native
FlipperFlipper debugger
AmplitudeAmplitude analytics
SentrySentry crash reporting
DDDatadog
BrazeBraze push notifications
AdjustAdjust attribution
Appsflyer, AppsFlyerLibAppsFlyer
Stripe, STPStripe payments
IQKeyboardIQKeyboardManager

Custom Exclusions

Shield provides two mechanisms for custom exclusions: wildcard patterns (exclude) and substring patterns (exclude_patterns).

Wildcard Patterns (exclude)

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 (Wildcard)

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"
  ]
}

SDK Substring Patterns (exclude_patterns)

For third-party libraries not in the automatic exclusions list, use exclude_patterns for substring-based matching. This is useful when you want to exclude all symbols from an entire SDK by its naming convention:

JSON
{
  "protections": {
    "symbol_renaming": {
      "enabled": true,
      "exclude_patterns": ["PepeAnalytics", "AcmeSDK", "MyInternalLib"]
    }
  }
}

Custom patterns use substring matching - "Pepe" excludes PepeAnalytics, PepeTracker, and MyPepeHelper.

exclude vs exclude_patterns

Use exclude for wildcard matching on specific symbol names (e.g., "*ViewController", "AppDelegate"). Use exclude_patterns for substring matching on SDK prefixes and library names (e.g., "MySDK", "CustomAnalytics"). Both can be used together.


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