Migration from 6.x to 7.x

This guide provides instructions for migrating from Malwarelytics Cordova Plugin version 6.x to version 7.x.

Version 7.x upgrades the native SDKs:

  • Malwarelytics for Apple: 2.1.13.3.1
  • Malwarelytics for Android: 1.2.11.5.2

These upgrades bring new features (screen recording detection, emulated input blocking, system screenshot detection, etc.) along with several breaking changes documented below.


Apple Platform

onCallChanged Observer Signature Change

The onCallChanged callback in MalwarelyticsAppleRASPObserver now receives a MalwarelyticsAppleCallDetection object instead of a plain boolean.

// Before (6.x)
onCallChanged(isOnCall) {
    console.log("On call: " + isOnCall);
}

// After (7.x)
onCallChanged(callDetection) {
    console.log("On call: " + callDetection.isOnCall);
    console.log("Outgoing: " + callDetection.isOutgoing);
    console.log("Incoming: " + callDetection.isIncoming);
}

New Required systemScreenshotDetected Observer Callback

MalwarelyticsAppleRASPObserver now requires a systemScreenshotDetected callback. This is triggered when iOS creates an App Switcher snapshot. Add it to your existing observer:

let observer = {
    // ... existing callbacks ...
    systemScreenshotDetected() {
        console.log("System screenshot detected");
    }
};

System screenshot detection must also be enabled in the configuration via appleConfig.raspConfig.systemScreenshot. See Configuration for details.


Android Platform

ScreenSharingDetection Data Model Changes

The ScreenSharingDetection interface has several breaking changes to match the native SDK 1.3.x update:

  • isScreenShared type changed from number to boolean.
  • transientData is now nullable (TransientScreenSharingData | null).
  • transientData.displayAdded and transientData.displayRemoved booleans were removed and replaced by:
    • transientData.displayChange — a DisplayChange enum (DISPLAY_ADDITION or DISPLAY_REMOVAL)
    • transientData.displayId — a number identifying the display
  • New required field androidAutoDetection (AndroidAutoDetection) was added.
// Before (6.x)
screenSharingDetected(detection) {
    if (detection.isScreenShared === 1) { /* ... */ }
    if (detection.transientData.displayAdded) { /* ... */ }
}

// After (7.x)
screenSharingDetected(detection) {
    if (detection.isScreenShared) { /* ... */ }
    if (detection.transientData?.displayChange === "DISPLAY_ADDITION") { /* ... */ }
    console.log("Android Auto:", detection.androidAutoDetection.connection);
}

screenSharing Config Shape Change

The screenSharing RASP config now uses a dedicated MalwarelyticsAndroidScreenSharingConfig with separate detectionAction and blockAction fields. The old action / exitUrl shorthand is still accepted but deprecated:

// Before (6.x)
screenSharing: { action: "NOTIFY" }

// After (7.x) — recommended
screenSharing: {
    detectionAction: "NOTIFY",
    blockAction: "BLOCK"
}

Migration Checklist

  • Update Apple observer: change onCallChanged(boolean)onCallChanged(MalwarelyticsAppleCallDetection)
  • Update Apple observer: add systemScreenshotDetected() callback
  • Update Android code reading ScreenSharingDetection: use boolean for isScreenShared, handle nullable transientData, use displayChange enum
  • Update Android screenSharing config to use detectionAction / blockAction (optional — old shape still works but is deprecated)
Last updated on Apr 30, 2026 (09:10) Edit on Github Send Feedback
Search

7.0.x

Malwarelytics for Cordova