Migration Guide to Version 3.3.x
Malwarelytics for Apple version 3.3.x introduces System Screenshot Detection and an improved overlay system. There are two breaking changes that require updates to existing integrations.
Summary of API Changes
| Affected APIs | API change |
|---|---|
AppProtectionRaspDelegate |
Addition of required method systemScreenshotDetected() |
ScreenCaptureDetectionConfig.Overlay |
Renamed and moved to AppProtectionRaspConfig.ScreenOverlay |
AppProtectionRaspConfig |
Addition of systemScreenshot: SystemScreenshotDetectionConfig parameter |
AppProtectionRaspConfig.ScreenOverlay |
Addition of .blur and .view(_ view: UIView) overlay cases |
AppProtectionEnvironment |
Addition of .url(URL) case for custom backend endpoints |
Breaking Change: New Required Delegate Method
AppProtectionRaspDelegate has a new required method:
func systemScreenshotDetected()
Every type that conforms to AppProtectionRaspDelegate must implement this method. The SDK calls it when the configured SystemScreenshotTrigger fires (e.g., the app moves to the background or resigns active state).
Migration: Add the method to every class that conforms to AppProtectionRaspDelegate:
func systemScreenshotDetected() {
// handle App Switcher snapshot event
// react according to the application's own security policy
}
Breaking Change: ScreenCaptureDetectionConfig.Overlay Renamed
The Overlay enum that was previously nested inside ScreenCaptureDetectionConfig has been extracted and renamed to AppProtectionRaspConfig.ScreenOverlay. The new type is shared with the SystemScreenshotDetectionConfig.hide case.
| Version 3.2.x | Version 3.3.x |
|---|---|
ScreenCaptureDetectionConfig.Overlay |
AppProtectionRaspConfig.ScreenOverlay |
ScreenCaptureDetectionConfig.Overlay.default |
AppProtectionRaspConfig.ScreenOverlay.default |
ScreenCaptureDetectionConfig.Overlay.color |
AppProtectionRaspConfig.ScreenOverlay.color |
ScreenCaptureDetectionConfig.Overlay.image |
AppProtectionRaspConfig.ScreenOverlay.image |
Migration: Update any explicit references to ScreenCaptureDetectionConfig.Overlay to use AppProtectionRaspConfig.ScreenOverlay (or simply ScreenOverlay in Swift context). Call-site syntax using dot notation (e.g., .hide(.color(.red))) is unaffected and requires no changes.
Two new overlay cases are also available in ScreenOverlay:
| New case | Description |
|---|---|
.blur |
Covers the screen with a strong system blur over a snapshot of the current content |
.view(_ view: UIView) |
Covers the screen with a custom view supplied by the application |
New Feature: System Screenshot Detection
Version 3.3.x adds detection of the system snapshot created by iOS when the app enters the background (visible in the App Switcher). Configure it via AppProtectionRaspConfig:
let raspConfig = AppProtectionRaspConfig(
// ... other configuration ...
systemScreenshot: .hide(.blur, .resignActive)
)
See System Screenshot Detection for full configuration and usage details.
New Feature: Custom Backend Environment
AppProtectionEnvironment now supports a custom URL endpoint:
let onlineConfig = AppProtectionOnlineConfig(
// ...
environment: .url(URL(string: "https://my-backend.example.com")!)
)