1. Home
  2. Docs
  3. Obfuscator
  4. How to start

How to start

This chapter explains how to use the Obfuscator and how it works.

The obfuscation applies always (when activated, is the default) after you started the “Player Build” process, either via hand in the Editor or via Editor Script. At this step Unity collects assemblies (*.dll files) and marks them to be included in the build. This assemblies are either generated for the specific build target (stored at “Library\ScriptAssemblies” or “Library\PlayerScriptAssemblies”) or included extern / third party ones. The obfuscation applies to these assemblies.

To define which assemblies you want to obfuscate, please have a look at the “Obfuscator Settings”.

That’s it. While and after the build you get unity editor console notifications, letting you know the obfuscation started and applied successfully.

For detailed information about the obfuscation components please check out the “Obfuscator Settings” window.

Source entry point:

The Obfuscator entry point can be found at “Assets\OPS\Obfuscator\Editor\BuildPostProcessor.cs”. This file contains four steps:

+ OnPreprocessBuild
+ OnPostProcessScene
+ OnPostBuildPlayerScriptDLLs / OnPostprocessBuild
+ OnFilterAssemblies

This step is the first in the obfuscation chain. Here the Obfuscator gets initialized and analyses Unity specific files and coherences to evaluate the obfuscation.

In this step the actual obfuscation happens. After Unity processes the first scene, to apply it to the build, all Obfuscator related resources or dependencies are set and the obfuscation starts.

3.OnPostBuildPlayerScriptDLLs or OnPostprocessBuild:
This step is a cleaning and resource releasing process. After the Unity Player Build finished, the Obfuscator releases used resources and reverts obfuscated extern / third party assemblies with the once got a backup, so they are useable in the Editor again.

This step filters Obfuscator related assemblies from a release build.