Introduction
Defender for iOS is a RASP (Runtime application self-protection) library for protecting iOS Apps and Frameworks by allowing them to check if they are being run on a jailbroken device.
Why Protect?
Jailbreak detection is a means of risk mitigation. In the modern world, there are many risks to software, including:
- Various kinds of theft (of trade secrets or other intellectual property)
- Loss of revenue (through piracy)
- Exposure or loss of data (including personally identifiable information)
- Defacement and brand-dilution (through piracy)
The applicability or severity of any particular risk to your product or domain may vary, but no product is free from all risks.
Modern software is seldom isolated – it typically acts as a single component in a larger interconnected system. Defense in depth requires protection at each layer of a system. Defender for iOS protection can be a significant component of a secure strategy.
System Requirements
- macOS
- Xcode 11 or later
- Swift 5.1 or later, or Objective-C
- iOS Deployment Target of iOS 11 or later
Getting Started
Integrating Defender for iOS into your Xcode project only requires a few steps:
Download the distribution (something like
iOSDefenderSDK_Beta-1.2.0+070d7ec.tgz
) and double-click it. This will extract it to something like~/Downloads/iOSDefenderSDK_Beta-1.2.0
.Add the XCFramework to your project (alternatively: set up a Company-Wide Cocoapod):
Make a
Frameworks/
directory in the root of your project.Copy
iOSDefenderSDK.xcframework
from the distribution intoFrameworks/
.In Xcode in the Project navigator, select the project. Select the target in the targets list, and select the General tab.
In the Frameworks, Libraries, and Embedded Content section, select the
+
to add the framework.At the bottom of the selection window, select
Add Other...
,Add Files...
and navigate to theFrameworks/
directory and addiOSDefenderSDK.xcframework
.Verify that the added XCFramework is listed as
Embed & Sign
.Select the Build Settings tab, select
All
andCombined
, and search forframework search paths
.If the
Frameworks
directory is not already listed in the Framework Search Paths, add the following:$(PROJECT_DIR)/Frameworks
.
In each Swift file that you want to check for jailbroken conditions:
Add
import iOSDefenderSDK
at the top.- If your project is an XCFramework, instead add
@_implementationOnly import iOSDefenderSDK
at the top to ensure that client apps can use your framework.
- If your project is an XCFramework, instead add
Use one of the methods described in the API and specify the desired behavior, for example:
if iOSDefender.isJailbroken() { // response to jailbroken condition ... }
In each Objective-C file that you want to check for jailbroken conditions:
Add
#import "iOSDefenderSDK/iOSDefenderSDK-Swift.h"
at the top.Use one of the methods described in the API and specify the desired behavior, for example:
if ([iOSDefenderObjC isJailbroken]) { // response to jailbroken condition ... }
Getting Support
If you encounter issues with Defender for iOS, please contact support for additional help.