C# 我可以使用AOT编译来保护我的应用程序吗?
我希望使用AOT编译来保护我的代码,但根据这一点:生成的本机代码与未编译的程序集一起包含在APK中。这是否意味着编译版本和未编译版本都包含在内,而AOT对模糊处理并没有真正的帮助?完整的AOT可能会使您的APK更大,因此不确定您是否应该仅仅为了模糊处理而走这条路 你可以试试专门为此设计的 Visual Studio for Windows 即使禁用调试,攻击者仍有可能重新打包应用程序,添加或删除配置选项或权限。这允许他们对应用程序进行反向工程、调试或篡改。Dotfuscator Community Edition(CE)可用于混淆托管代码,并在构建时将运行时安全状态检测代码注入Xamarin.Android应用程序,以检测应用程序是否在根设备上运行并作出响应 Visual Studio 2017包含Dotfuscator CE。要使用Dotfuscator,请单击工具>抢占式保护-Dotfuscator 要配置Dotfuscator CE,请参阅将Dotfuscator社区版与Xamarin一起使用。一旦配置完毕,Dotfuscator CE将自动保护创建的每个构建 Visual Studio for Mac 即使禁用调试,攻击者仍有可能重新打包应用程序,添加或删除配置选项或权限。这允许他们对应用程序进行反向工程、调试或篡改。尽管它不支持Visual Studio for Mac,但您可以将Dotfuscator Community Edition(CE)与Visual Studio一起使用,以混淆托管代码,并在构建时将运行时安全状态检测代码注入到Xamarin.Android应用程序中,以检测应用程序是否在根设备上运行并作出响应 要配置Dotfuscator CE,请参阅将Dotfuscator社区版与Xamarin一起使用。一旦配置完毕,Dotfuscator CE将自动保护创建的每个构建C# 我可以使用AOT编译来保护我的应用程序吗?,c#,xamarin.forms,xamarin.android,protection,aot,C#,Xamarin.forms,Xamarin.android,Protection,Aot,我希望使用AOT编译来保护我的代码,但根据这一点:生成的本机代码与未编译的程序集一起包含在APK中。这是否意味着编译版本和未编译版本都包含在内,而AOT对模糊处理并没有真正的帮助?完整的AOT可能会使您的APK更大,因此不确定您是否应该仅仅为了模糊处理而走这条路 你可以试试专门为此设计的 Visual Studio for Windows 即使禁用调试,攻击者仍有可能重新打包应用程序,添加或删除配置选项或权限。这允许他们对应用程序进行反向工程、调试或篡改。Dotfuscator Communit
我使用混合AOT从.NET程序集中删除IL代码。 您需要手动编辑C:\Program Files(x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android中的Xamarim.Android.Common.Targets\
<CilStrip
Condition=" '$(AndroidAotMode)' == 'Hybrid' And '$(AotAssemblies)' == 'True' "
AndroidAotMode="$(AndroidAotMode)"
ToolPath="$(_MonoAndroidToolsDirectory)"
ApkOutputPath="$(_BuildApkEmbedOutputs)"
ResolvedAssemblies="@(_ShrunkAssemblies)">
</CilStrip>
并编辑您的Android.csproj
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<EnableLLVM>false</EnableLLVM>
<AotAssemblies>true</AotAssemblies>
<AndroidAotMode>Hybrid</AndroidAotMode>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<AndroidAotAdditionalArguments>no-write-symbols,nodebug</AndroidAotAdditionalArguments>
</PropertyGroup>
假的
没有一个
真的
bin\Release
促使
4.
真的
这对我来说不是一个很好的方法,因为有一个de4dot程序可以轻松删除保护。我将使用ConfuserEx代替Dotfuscator,但我希望我的代码是本地解决方案,以删除IL代码,我在这里找到: