2016-12-07 105 views
0

我想在Unity3D中使用Dotfuscator。在Unity中構建我的Android項目時,它使用它的內部單聲道編譯器。我將'AfterBuild'目標添加到'.csproj'文件,並且如果我在Visual Studio 2013中生成項目,AfterBuild將正常工作。將Dotfuscator集成到Unity3D構建管道中

所以我的問題是,如何修改Unity的構建管道?

我使用Unity 5.4.2和VS 2013

回答

0

對於桌面應用程序,

  1. 使用BuildPipeline.BuildPlayer 建立自己的應用程序或遊戲到指定路徑。然後使用Dotfuscator的混淆的DLL(應該位於某處的輸出中的目錄),通過啓動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。只需使用腳本語言,就可以編寫並運行這些步驟。

適用於iOS/Mac應用程序,使用il2cpp應該足以模糊處理應用。不過,我對此並不十分確定。

對於Android,我不知道在Unity3D爲您製作apk之前是否有辦法截獲建築物管道。但是我們總是可以從apk中提取DLL,將其混淆並放回原位。確實存在一些解決方案,請參閱this question