/

Configuration files for protections

Most of the protections have specific configurations, here you can see how they are applied.

If you have not seen what protections are available or you need to configure exclusions, we recommend:

Available protections

Find out what protections you can apply to your applications

Exclude a protection

Find out how to exclude certain protections from certain parts of your code

In the documentation of each protection you have:

  • Parameters that show you what configurations can be applied to that protection.
  • Modes that allows you to set the operating mode of the protection.
  • Rules configuration which are examples json of the configuration file that we teach you in this section for that specific protection.

Configuration file structure

Do not confuse Shield configuration files (for configuring protections) with any other configuration file, for example, for visual studio or msbuild integration.

Naming

Configuration files for Shield obfuscation are called as follows:

  • shield.config.json

or it could be:

  • shield.*.config.json

where you can set the name of the application that corresponds to the file configuration, for example:

For a solution containing 3 projects: API, Core, and Client we could have three different configurations:

  • shield.api.config.json
  • shield.core.config.json
  • shield.client.config.json

Shield clients such as the visual studio extension or msbuild integration will automatically get the configuration file of your application or by default shield.config.json if no specific one is found.

Format

Configuration files are always .json (JavaScript Object Notation)

Structure

Configuration files have the following structure:

{
    "Name": "Your application name here",
    "ConfigurationType": 2,
    "InheritFromProject": false,
    "Preset": "custom",
    "Protections": {
        "rename": {
            "rename public": true
        }
    }
}

where:

  • Name string : is the name of your application's configuration, so you can quickly identify which configuration you applied when protecting.
    • for example: core_for_production, core_only_strings, api
  • ConfigurationType int : specifies the type of configuration it is, 0 for Project, 1 for Solution, 2 for Application
    • It is always a type of application when using an official ByteHide Shield client, and a type of project when using the cloud panel.
  • InheritFromProject bool : Checks whether to use the project's higher configuration (if exists) and ignore the current file, or if false, the file will always be used, regardless of whether the project has another configuration.
  • Preset string : Selects the type of preset maximum, balance, optimized or custom that should be applied. See available presets
  • Protections object list: Is a list of objects with each of the protections that should be applied and their configurations. See the following section

Adding custom protections

Remember that to use custom protections the preset must be custom, otherwise, the protections will not be applied based on your configuration.

The format of the protections is as follows:

{
    "Protections": {
        "protection_id": {
            "parameter name": "parameter value"
            // ...
        }
    }
}

for example:

{
    "Protections": {
        "rename": {
            "rename public": true
        }
    }
}

Protections without configuration

Protections without configuration should simply leave their value empty {} or null

{
    "Protections": {
        "protection_id": null
    }
}

for example:

{
    "Protections": {
        "rename": null
    }
}

you must separate the protections by comma within the object:

{
    "Protections": {
        "rename": null,
        "constants_advance": null,
        "control_flow_advance": null,
        "reference_proxy": null
    }
}

Protections with configuration

Just different from the previous ones, the value of the protection must be an object containing the parameters of the protection:

{
    // ...
        "protection_id": {
            "parameter name": "parameter value"
            // ...
        }
}

For example, imagine I want to use the renamer protection with:

{
  // ...
  "Protections": {
    "rename": {
      "rename public": true,
      "rename arguments": false,
      "mode": "decodeable"
    }
  }
}

based on this you can combine all the options, such as:

{
    "Name": "production_shield_configuration",
    "ConfigurationType": 2,
    "InheritFromProject": false,
    "Preset": "custom",
    "Protections": {
        "rename": {
            "rename public": true,
            "rename arguments": false,
             "mode": "decodeable"
        },
        "constants_advance": null,
        "control_flow_advance": {
            "invalid code": false, 
            "operations": "arithmetic|logic|conversion",
        },
        "reference_proxy": null,
        "resources": {
            "compress": true,
            "encrypt": true,
        },
        "anti_debug": null
    }
}

Protection Presets

We have several types of presets, which are protection configurations by a team of cybersecurity engineers.

  • Maximum Protection maximum: It offers the most complete security overcoming the performance and the recommendations by AI.

  • Balance balance: It offers a perfect balance between security and performance of your application that takes full advantage of the options in your edition of ByteHide Shield.

  • Optimization optimized: Add the maximum possible security by putting application performance and method execution milliseconds first.

  • Custom custom: Allows you to customize the protections you want to use manually.

Configuration file Playground

If you want to configure your own configuration file from here, you can use our Playground to create a file easily.

Shield Configuration file PlayGround
Drag the protections from left → to right, and click on the ones with settings to change them 👇🏻

Protections (13)

In-use (0)

Here is your Shield configuration file 👇🏻
null
Previous
Get Magic File