将Dotfuscator集成到Unity3D构建管道中

时间:2016-12-07 12:47:45

标签: unity3d mono dotfuscator

我正在尝试将Dotfuscator与Unity3D一起使用。在Unity中构建我的Android项目时,它使用它的内部单声道编译器。我添加了'AfterBuild'定位到' .csproj'文件,如果我在Visual Studio 2013中构建项目,AfterBuild工作。

所以我的问题是,如何修改Unity的构建管道?

我正在使用Unity 5.4.2和VS 2013.

1 个答案:

答案 0 :(得分:0)

对于桌面应用,

  1. 使用BuildPipeline.BuildPlayer 将您的应用或游戏构建到指定路径。然后使用Dotfuscator来混淆dll(它应该位于ouput目录中的某个位置),通过在构建时启动Dotfuscator进程

    // Build player.
    BuildPipeline.BuildPlayer(levels, path + "/BuiltGame.exe", BuildTarget.StandaloneWindows, BuildOptions.None);
    
    // Obfuscate the dll in the player.
    Process proc = new Process();
    proc.StartInfo.FileName = "path_to_dotfuscator";
    proc.StartInfo.Arguments = "arguments_of_dotfuscator path_to_app_dll";
    proc.Start();
    
  2. 使用command line of the Unity3D Editor构建您的应用或游戏。然后使用Dotfuscator来混淆dll。只需使用脚本语言编写并运行这些步骤即可。

  3. 对于iOS / Mac应用,使用 il2cpp 应该足以混淆应用。不过,我对此并不十分肯定。

    对于Android,我不知道在Unity3D为你制作apk之前是否有办法拦截建筑物管道。但我们总是可以从apk中提取dll,对其进行模糊处理并将其放回原处。确实存在一些解决方案,请参阅this question