我想用ConfuserEx混淆我的源代码,所以我创建了一个ConfuserEx-project文件,看起来像这样:
<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
<rule pattern="true" inherit="false">
<protection id="rename" />
<protection id="ctrl flow" />
<protection id="ref proxy" />
<protection id="anti debug" />
<protection id="anti dump" />
<protection id="constants" />
<protection id="resources" />
<protection id="anti tamper" />
</rule>
<module path="MainApplication\bin\Release\MainApplication.exe" />
<module path="MainApplication\bin\Release\Component.Hardware.dll" />
<module path="MainApplication\bin\Release\Component.Log.dll" />
<module path="MainApplication\bin\Release\Component.Service.dll" />
<module path="MainApplication\bin\Release\Component.Software.dll" />
<module path="MainApplication\bin\Release\AsynchronousSocket.dll" />
<module path="MainApplication\bin\Release\Instrumentation.dll" />
</project>由于我希望通过安装程序来部署应用程序,因此我创建了主应用程序项目的InstallShield安装程序。我选择主输出。
在Visual Studio中的Postbuild-Event中,我使用crproj-file作为参数调用Confuser.CLI.exe。但是,只有MainApplication.exe和AsynchronousSocket.dll + Instrumentation.dll使用ConfuserEx进行了修改。这4个Component.*.dll文件不是,我不得不说所有的程序集都是不同的项目。因此,我的项目解决方案结构如下所示:
MyProject
MyProject.MainApplication
MyProject.Component.Hardware
MyProject.Component.Software
MyProject.Component.Log
MyProject.Component.Service
MyProject.AsynchronousSocket
MyProject.Instrumentation
MyProject.Setup
MyProject.sln
MyProject.crpoj我的猜测是我采用了错误的InstallShield使用的程序集。我还尝试使用MyProject.Component.Service\bin\Release和MyProject.Component.Service\obj\Release中的程序集,但这两个选项都不起作用。我不认为使用MainApplication\obj\Release是可行的,因为只有被定位的MainApplication.exe。
谁能告诉我InstallShield从哪里获取主要输出,或者我是否遗漏了其他东西?
发布于 2019-04-29 15:00:52
一种可能的解决方案是多个crproj文件,每个二进制文件一个,并在每个项目的构建后步骤中指定特定于项目的crproj文件。MainApplication.crproj
<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
<rule pattern="true" inherit="false">
<protection id="rename" />
<protection id="ctrl flow" />
<protection id="ref proxy" />
<protection id="anti debug" />
<protection id="anti dump" />
<protection id="constants" />
<protection id="resources" />
<protection id="anti tamper" />
</rule>
<module path="MainApplication\bin\Release\MainApplication.exe" />
</project>Component.Hardware.dll.crproj
<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
<rule pattern="true" inherit="false">
<protection id="rename" />
<protection id="ctrl flow" />
<protection id="ref proxy" />
<protection id="anti debug" />
<protection id="anti dump" />
<protection id="constants" />
<protection id="resources" />
<protection id="anti tamper" />
</rule>
<module path="MainApplication\bin\Release\Component.Hardware.dll" />
</project>https://stackoverflow.com/questions/30094596
复制相似问题