Commit 87c24c08 authored by 黄树航's avatar 黄树航

增加 Obfuscar 混淆

parent 8c98bccf
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\Obfuscar.2.2.38\build\obfuscar.props" Condition="Exists('packages\Obfuscar.2.2.38\build\obfuscar.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
......@@ -15,6 +16,8 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -163,5 +166,27 @@
<ItemGroup>
<Resource Include="Logo.ico" />
</ItemGroup>
<ItemGroup>
<None Include="obfuscar.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\Obfuscar.2.2.38\build\obfuscar.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Obfuscar.2.2.38\build\obfuscar.props'))" />
</Target>
<PropertyGroup>
<PostBuildEvent>set "str=$(ConfigurationName)"
if "%25str%25"=="Release" (
CD $(TargetDir)
"$(Obfuscar)" obfuscar.xml
xcopy Obfuscator_Output\*.dll /y /e /i /q
xcopy Obfuscator_Output\*.exe /y /e /i /q
rmdir /s /q .\Obfuscator_Output
del obfuscar.xml
)</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<Obfuscator>
<!-- 文档: https://docs.obfuscar.com/getting-started/configuration#settings -->
<!--输入路径-->
<Var name="InPath" value="." />
<!--输出路径:加密混淆过的路径-->
<Var name="OutPath" value=".\Obfuscator_Output" />
<!--混淆代码的参数-->
<Var name="RegenerateDebugInfo" value="false" />
<Var name="MarkedOnly" value="false" />
<Var name="RenameProperties" value="false" />
<Var name="RenameEvents" value="true" />
<Var name="RenameFields" value="true" />
<Var name="KeepPublicApi" value="true" />
<Var name="HidePrivateApi" value="true" />
<Var name="ReuseNames" value="true" />
<Var name="UseUnicodeNames" value="true" />
<Var name="UseKoreanNames" value="true" />
<Var name="HideStrings" value="true" />
<Var name="OptimizeMethods" value="true" />
<Var name="SuppressIldasm" value="true" />
<Var name="AnalyzeXaml" value="true" />
<!--要混淆的模块-->
<Module file="$(InPath)\电趣助手Setup.exe" >
<SkipType name="*AnonymousType*" skipProperties="true" skipMethods="true" skipFields="true" skipEvents="true" skipStringHiding="true"/>
</Module>
</Obfuscator>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HandyControl" version="3.3.0" targetFramework="net472" />
<package id="Obfuscar" version="2.2.38" targetFramework="net45" developmentDependency="true" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment