Root/Jailbreak Detection Lock

Potency Medium
Resilience Medium
Cost Medium
Tags: root, jailbreak, code lock

Description

The Root/Jailbreak Detection Lock locks code so that it can detect rooted devices (in the case of Android) or jailbroken devices (in the case of iOS), so that your applications can, for instance, refuse to run on these devices. When your code is executed in a device that is rooted or jailbroken, it will execute one or more Countermeasures.

Consider combining this transformation with obfuscation transformations to harden the resulting code making it more resilient to automated de-obfuscator tools and harder to understand by a human.

Compatibility

Currently, this lock only works/has been tested on React Native applications.

Code Annotation Example

// @jscrambler define rootJailbreakDetectionLock {countermeasures: {breakApplication: 1, customCallback: testFunction}} as rj1
// @jscrambler enable rj1

Option Types

Name Required Default Value Description
countermeasures Yes {"deleteCookies": false,"breakApplication": true,"realTimeNotifications": false,"selfDestruct": false} List of available countermeasures

Countermeasures

Name Description
customCallback Name of the function to be called as a countermeasure.
deleteCookies Deletes all the cookies accessible via JavaScript.
redirect Redirects the user to a specific URL.
breakApplication Breaks the application's functionality.
realTimeNotifications Sends a notification when a violation occurs.
selfDestruct Attempts to damage the state and behavior of the application and/or the environment that is running the application.

API Parameters

Example:

{
  "keys": {
    "accessKey": "XXXXXX",
    "secretKey": "YYYYYY"
  },
  "applicationId": "ZZZZZZ",
  "params": [
    {
      "name": "rootJailbreakDetectionLock",
      "options": {
        "countermeasures": {
          "customCallback": null,
          "deleteCookies": false,
          "redirect": null,
          "breakApplication": true,
          "realTimeNotifications": false,
          "selfDestruct": false
        }
      }
    }
  ]
}