Renaming
Introduction
Defender for iOS offers renaming obfuscation and control flow flattening for your iOS source code. Defender for iOS alters identifiers such as Swift and Objective-C Types, and variables and breaks the basic control flow block within your source code to obscure logic while maintaining functionality.
Code Signing
Code signing uses keys and certificates installed in the local Keychain. Defender for iOS will need the appropriate Private and Public Keys from the Developer or Distribution Certificate installed on the local machine during the code signing phase. Refer to Apple documentation for information on code signing.
If an issue occurs in an attempt to code sign with the warning:
“Defender for iOS” cannot be opened because the identity of the developer cannot be confirmed.
To run it, go to System Preferences > Security & Privacy > General tab > Open Anyway
Renaming
Defender for iOS, by default, renames source code. To disable renaming functionality, set the command line argument:
Build with renaming command
defenderForiOS <path-to-xcode-project> -build-scheme <scheme>
--disable-renaming {true or false}: Default is false
Set Renaming in Config file
Renaming:
# Disable renaming set to true. Default is false
disabled: false
Filter Renaming
This will filter Swift and Objective-C object types for renaming.
-F, | -filter-symbols <filter-symbols>
This will skip object types starting with this value.
-F '!FileProcessor'
Control flow
Defender for iOS by default applies control flow flattening source code. To disable control flow flattening functionality, set command line argument:
Build with Control flow command
defenderForiOS <path-to-xcode-project> -build-scheme <scheme> --disable-control-flow {true or false}: Default is false
Filter Control flow
This will filter Swift and Objective-C object types for control flow.
--filter-control-flow <filter-control-flow>
This will skip object types starting with this value.
--filter-control-flow !<filter-symbols>*
Example:
--filter-control-flow 'ab*,!abl'