/

Configuration Reference

Shield for iOS uses a JSON configuration file to control all aspects of the protection process. This page documents every available option.


Configuration File

Shield reads its configuration from a shield-ios.json file (or YAML format as shield.yml). Generate a default configuration with:

Bash
shield-ios init

Complete Structure

JSON
{
  "projectToken": "your-project-token",

  "protections": {
    "symbol_renaming": true,
    "string_encryption": true,
    "swift_stripping": true,
    "control_flow": "medium",
    "dead_code_injection": "medium",
    "opaque_predicates": "medium",
    "arithmetic_obfuscation": "medium",
    "instruction_substitution": "medium",
    "register_shuffling": "medium",
    "api_hiding": "medium",
    "class_encryption": true,
    "resource_encryption": true,
    "anti_debug": true,
    "anti_jailbreak": true,
    "rasp": true,
    "polymorphic": true
  },

  "code_signing": {
    "enabled": false,
    "identity": "iPhone Distribution: Your Team",
    "provisioning_profile": "path/to/profile.mobileprovision"
  },

  "build_integration": {
    "skip_debug": true,
    "skip_simulator": true,
    "verbose": false
  },

  "output": {
    "suffix": "_protected"
  },

  "mapping": {
    "output_file": "mapping.txt",
    "format": "proguard"
  },

  "logging": {
    "level": "info",
    "file": "shield.log",
    "console": true
  }
}

Project Token

PropertyTypeDescription
projectTokenstringYour ByteHide project token. Required for license validation and cloud features. Can also be set via the SHIELD_PROJECT_TOKEN environment variable.

Protections

Each protection can be enabled with true (default settings) or configured with a specific level or options object. See Protections Overview for details on each protection.

Boolean Protections

These protections accept true or false:

ProtectionDescription
symbol_renamingRename classes, methods, and properties
string_encryptionEncrypt string literals in the binary
swift_strippingRemove Swift metadata and debug symbols
class_encryptionEncrypt Objective-C class metadata
resource_encryptionEncrypt bundled resources and assets
anti_debugDetect and block debugger attachment
anti_jailbreakDetect jailbroken devices
raspRuntime Application Self-Protection (hook, trace, and tamper detection)

Level-Based Protections

These protections accept an intensity level as a string:

ProtectionLevelsDescription
control_flow"light", "medium", "aggressive"Control flow obfuscation
dead_code_injection"light", "medium", "heavy"Insert unreachable code paths
opaque_predicates"simple", "medium", "complex"Add always-true/false conditions
arithmetic_obfuscation"simple", "medium", "complex"Transform arithmetic operations
instruction_substitution"simple", "medium", "complex"Replace instructions with equivalents
register_shuffling"simple", "medium", "complex"Randomize register allocation
api_hiding"simple", "medium", "complex"Hide system API calls

Set to false to disable any level-based protection.


Protection-Specific Options

Some protections accept an options object for fine-grained control instead of a simple true or level string.

Symbol Renaming Options

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

String Encryption Options

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

Anti-Debug Options

JSON
{
  "anti_debug": {
    "enabled": true,
    "ptrace": true,
    "sysctl": true
  }
}

Anti-Jailbreak Options

JSON
{
  "anti_jailbreak": {
    "enabled": true,
    "sensitivity": 1
  }
}

Sensitivity levels: 0 (Basic), 1 (Standard), 2 (Paranoid).

RASP Options

JSON
{
  "rasp": {
    "enabled": true,
    "hook_detection": true,
    "trace_detection": true,
    "tamper_detection": true,
    "action": "exit"
  }
}

Action options: "exit", "alert", "log", "crash".


Code Signing

PropertyTypeDescription
code_signing.enabledbooleanEnable automatic code signing after protection
code_signing.identitystringCode signing identity name
code_signing.provisioning_profilestringPath to provisioning profile

Build Integration

PropertyTypeDefaultDescription
build_integration.skip_debugbooleantrueSkip protection for Debug builds
build_integration.skip_simulatorbooleantrueSkip protection for Simulator targets
build_integration.verbosebooleanfalseShow detailed output during protection

Output

PropertyTypeDescription
output.pathstringFull path for the protected output file
output.suffixstringSuffix added to the input filename (default: _protected)

Mapping

PropertyTypeDescription
mapping.output_filestringMapping file output path (default: mapping.txt)
mapping.formatstringMapping file format: "proguard"

Logging

PropertyTypeDefaultDescription
logging.levelstring"info"Log level: "debug", "info", "warning", "error"
logging.filestring"shield.log"Log file path
logging.consolebooleantrueEnable console output

Previous
CI/CD Integration