NOTE: Check out the online docs for the latest version plus images: https://docs.guardingpearsoftware.com/manual/Obfuscator/Description.html
[!NOTE] New: GuardingPearSoftware Dashboard
We’re excited to announce the GuardingPearSoftware Dashboard, a new platform where you can manage all your GuardingPearSoftware assets and tools in one place.
Coming later this year, the dashboard will introduce deeper integrations with our tools and unlock exclusive features that would normally require running your own server instance.
👉 Register here:
https://dashboard.guardingpearsoftware.com/registerCurrently supported tools
- AntiCheat Pro
- Obfuscator Pro
Support for all other GuardingPearSoftware tools will be added soon.
Benefits of using the dashboard:
- Get earlier access to new versions
- Try beta releases
- Download older versions when needed
Note for developers in China 🇨🇳
Starting April, the global store will close for your region and be replaced by a China regional store. Unfortunately, this means you may lose access to assets previously purchased through the global store.
By using the GuardingPearSoftware Dashboard, you will retain access to your assets independently of the store changes.
We are also working on integration with the China Asset Store, though this will take a bit more time.
This guide will walk you through the process of installing, configuring, and utilizing the Obfuscator to strengthen your game's code. You will be able to make your code significantly more resistant to reverse engineering, replication, and unauthorized modification.
The very first step is to get either Obfuscator Free, Obfuscator Pro or Obfuscator Source from the Unity Asset Store. Then download it into your current project.
The main difference between these 3 versions are that the Free version does not support MonoBehavior class and, in general, namespace obfuscation. The security functions are also not available. The Pro version contains all functions. While the source version additionally contains the source code of the obfuscator itself.
The Obfuscator project structure 'Assets/GUPS/Obfuscator' will look like the following.
You find the following directories and files in the root directory of Obfuscator:
GuardingPearSoftware's Obfuscator is designed for seamless integration, requiring no complex setup – simply plug it in and it works! Activated, it automatically obfuscates your code during every build, safeguarding your game without adding any extra burden to your workflow.
Build in Editor. You can simply build our game in the editor and the obfuscator will automatically run within the build pipeline to protect your game.
Build with CI/CD. Custom build scripts or CI/CD are also supported.
using UnityEditor;
using System.Diagnostics;
public class ScriptBatch
{
[MenuItem("MyTools/Windows Build With Postprocess")]
public static void BuildGame ()
{
// Get filename.
string path = EditorUtility.SaveFolderPanel("Choose Location of Built Game", "", "");
string[] levels = new string[] {"Assets/Scene1.unity", "Assets/Scene2.unity"};
// Build player.
BuildPipeline.BuildPlayer(levels, path + "/BuiltGame.exe", BuildTarget.StandaloneWindows, BuildOptions.None);
// Copy a file from the project folder to the build folder, alongside the built game.
FileUtil.CopyFileOrDirectory("Assets/Templates/Readme.txt", path + "Readme.txt");
// Run the game (Process class from System.Diagnostics).
Process proc = new Process();
proc.StartInfo.FileName = path + "/BuiltGame.exe";
proc.Start();
}
}
To run automatically inside the Unity build pipeline, the Obfuscator uses multiple hooks. These are the following:
The hooks can be found in the BuildPostProcessor.cs file at Assets/GUPS/Obfuscator/Editor. If you use custom hooks or use assets that use pipeline hooks, have a look at the callbackOrder and make sure the Obfuscator runs last.
public int callbackOrder
{
get { return int.MaxValue; }
}
Obfuscator has a centralized configuration which applies to the obfuscation pipeline. You can find it at Project Settings -> GuardingPearSoftware -> Obfuscator -> Settings.
The obfuscation settings separate into 4 topics:
[!NOTE] In most instances, the default settings provide the best optimization for the majority of games and applications.