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:
shield-ios initshield-ios initComplete Structure
{
"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
}
}{
"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
| Property | Type | Description |
|---|---|---|
projectToken | string | Your 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:
| Protection | Description |
|---|---|
symbol_renaming | Rename classes, methods, and properties |
string_encryption | Encrypt string literals in the binary |
swift_stripping | Remove Swift metadata and debug symbols |
class_encryption | Encrypt Objective-C class metadata |
resource_encryption | Encrypt bundled resources and assets |
anti_debug | Detect and block debugger attachment |
anti_jailbreak | Detect jailbroken devices |
rasp | Runtime Application Self-Protection (hook, trace, and tamper detection) |
Level-Based Protections
These protections accept an intensity level as a string:
| Protection | Levels | Description |
|---|---|---|
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
{
"symbol_renaming": {
"enabled": true,
"prefix": "a",
"rename_classes": true,
"rename_methods": true,
"rename_properties": true,
"rename_protocols": false,
"exclude": ["AppDelegate", "SceneDelegate", "*Delegate"]
}
}{
"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
{
"string_encryption": {
"enabled": true,
"algorithm": "xor",
"exclude": ["http://*", "https://*"]
}
}{
"string_encryption": {
"enabled": true,
"algorithm": "xor",
"exclude": ["http://*", "https://*"]
}
}Anti-Debug Options
{
"anti_debug": {
"enabled": true,
"ptrace": true,
"sysctl": true
}
}{
"anti_debug": {
"enabled": true,
"ptrace": true,
"sysctl": true
}
}Anti-Jailbreak Options
{
"anti_jailbreak": {
"enabled": true,
"sensitivity": 1
}
}{
"anti_jailbreak": {
"enabled": true,
"sensitivity": 1
}
}Sensitivity levels: 0 (Basic), 1 (Standard), 2 (Paranoid).
RASP Options
{
"rasp": {
"enabled": true,
"hook_detection": true,
"trace_detection": true,
"tamper_detection": true,
"action": "exit"
}
}{
"rasp": {
"enabled": true,
"hook_detection": true,
"trace_detection": true,
"tamper_detection": true,
"action": "exit"
}
}Action options: "exit", "alert", "log", "crash".
Code Signing
| Property | Type | Description |
|---|---|---|
code_signing.enabled | boolean | Enable automatic code signing after protection |
code_signing.identity | string | Code signing identity name |
code_signing.provisioning_profile | string | Path to provisioning profile |
Build Integration
| Property | Type | Default | Description |
|---|---|---|---|
build_integration.skip_debug | boolean | true | Skip protection for Debug builds |
build_integration.skip_simulator | boolean | true | Skip protection for Simulator targets |
build_integration.verbose | boolean | false | Show detailed output during protection |
Output
| Property | Type | Description |
|---|---|---|
output.path | string | Full path for the protected output file |
output.suffix | string | Suffix added to the input filename (default: _protected) |
Mapping
| Property | Type | Description |
|---|---|---|
mapping.output_file | string | Mapping file output path (default: mapping.txt) |
mapping.format | string | Mapping file format: "proguard" |
Logging
| Property | Type | Default | Description |
|---|---|---|---|
logging.level | string | "info" | Log level: "debug", "info", "warning", "error" |
logging.file | string | "shield.log" | Log file path |
logging.console | boolean | true | Enable console output |
Related
- Protections Overview - Details on each protection
- Build Profiles - Configure different profiles per environment
- Exclusions - Exclude specific symbols from protection