【问题标题】:Stopping the build Xamarin Android project while dotfuscator run在 dotfuscator 运行时停止构建 Xamarin Android 项目
【发布时间】:2020-01-03 17:28:31
【问题描述】:

我尝试根据本手册将 Dotfuscator 集成到我的 Xamarin 项目中:https://www.preemptive.com/dotfuscator/ce/docs/help/getting_started_xamarin.html

我执行了步骤:Import the Targets FileSet MSBuild Properties,我跳过了Add Dotfuscator Config File to Project,因为我还没有配置。然后我启动构建并收到此错误:

There are no assemblies to process. Stopping the build...

看起来 dotfuscator 需要 .dll 程序集,但我没有这些,因为构建尚未完成,因为 dotfuscator 正在停止。

UPD

我像这样编辑了 Android.csproj 文件:

1) 添加

true

2) 添加此代码

< PropertyGroup > 
< DotfuscatorXamarinConfigFileName >DotfuscatorConfig.xml< /DotfuscatorXamarinConfigFileName >
< DotfuscatorXamarinCliPath>C:\Program Files (x86)\PreEmptive Solutions\Dotfuscator Professional Edition Evaluation4.43.1\dotfuscator.exe< /DotfuscatorXamarinCliPath >
< DotfuscatorXamarinGenerateNewConfigFile >true< /DotfuscatorXamarinGenerateNewConfigFile>
< DotfuscatorIncludeAsInput >< /DotfuscatorIncludeAsInput>   
< /PropertyGroup>   
< Import Project="..\..\PreEmptive.Dotfuscator.Xamarin\PreEmptive.Dotfuscator.Xamarin.targets"/>

&lt; /Project&gt; 标签之前。

仍然有错误:There are no assemblies to process. Stopping the build...

UPD2

我试图更改 .csproj 文件,就像在此链接中一样 :: https://www.preemptive.com/dotfuscator/pro/userguide/en/getting_started_protect.html#integrate-xamarin

这一次混淆甚至没有开始。应用程序已构建,但它像往常一样是简单的 apk。

【问题讨论】:

  • 响应更新 #2,您就快到了。您仍然需要更改&lt;Import&gt; 标签中的Project;它仍在使用特定于 Xamarin 的 Dotfuscator Community 目标文件,而不是 Dotfuscator Professional 目标文件,后者涵盖了 Xamarin 和许多其他类型的项目。所以应该改为&lt;Import Project="$(DotfuscatorMSBuildDir)\PreEmptive.Dotfuscator.Common.targets" /&gt;
  • @JoeSewell 如果我尝试将 &lt;Import Project="..\..\PreEmptive.Dotfuscator.Xamarin\PreEmptive.Dotfuscator.Xamarin.targets"/&gt; 替换为此 &lt;Import Project="$(DotfuscatorMSBuildDir)\PreEmptive.Dotfuscator.Common.targets" /&gt; 混淆未开始 - 我只是构建没有混淆的应用程序。
  • @JoeSewell 好的,看来我在通往 targets 的路径上有错误。现在构建过程很好。

标签: obfuscation dotfuscator


【解决方案1】:

您的链接指向 Dotfuscator 社区 (CE) 用户指南,但您的屏幕截图显示您使用的是 Dotfuscator Professional。相反,请参阅 Dotfuscator Professional 用户指南中的 Xamarin page

(注意:我在 Dotfuscator 团队工作。)

【讨论】:

  • @Сергей 您提到的句子在旧版 Visual Studio 集成的页面上,该集成已弃用且不适用于 Xamarin 项目。请阅读我链接到的页面,它将引导您到 Protect Your App 页面,该页面解释了如何使用新的集成。在新的集成中,每当您在 Visual Studio 中构建 Xamarin 项目时,Dotfuscator 都会自动保护程序集。
  • 那么,我可以在将我的 Android 项目添加到 Output 之后开始构建吗?像这样imgur.com/a/y4DFQ1a
  • @Сергей 同样,该屏幕截图来自较旧的 Visual Studio 集成,它不适用于 Xamarin。相反,请按照Protect Your App 页面上的说明进行操作。这不需要单独的“Dotfuscator 项目”-Dotfuscator 只会在您构建原始 Xamarin.Android 项目时运行,并在构建将程序集打包到 .apk 文件之前自动保护程序集。
  • @Сергей 是的,这是我在答案中发布的链接。
  • 根据 Dotfuscator 社区用户指南,我似乎已经完成了所有这些步骤。我的意思是我刚刚编辑了 .csproj 文件
猜你喜欢
  • 2012-07-14
  • 2019-06-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多