我尝试使用ConfuserEx混淆Xamarin.Android dll,但我只得到错误:
[ERROR] Failed to resolve dependency of 'app.dll'.
Exception: dnlib.DotNet.AssemblyResolveException: Could not resolve assembly: Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
w dnlib.DotNet.Extensions.ResolveThrow(IAssemblyResolver self, IAssembly assembly, ModuleDef sourceModule) w E:\Source\Public\Confuser2\dnlib\src\DotNet\IAssemblyResolver.cs:wiersz 113
w Confuser.Core.ConfuserEngine.Inspection(ConfuserContext context) w e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:wiersz 264
Failed at 20:23, 0:01 elapsed.
我的confuserEx项目文件:
<project outputDir="C:\Users\Admin\Desktop\android\app\Confused" baseDir="C:\Users\Admin\Desktop\android\app" xmlns="http://confuser.codeplex.com">
<packer id="compressor" />
<module path="obj\Debug\app.dll">
<rule pattern="true" preset="normal">
<protection id="rename" />
<protection id="anti ildasm" />
<protection id="anti tamper" />
<protection id="constants" />
<protection id="ctrl flow" />
</rule>
</module>
<probePath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0</probePath>
<probePath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0</probePath>
</project>
如何为项目添加依赖项?我需要为项目添加什么?
提前致谢
答案 0 :(得分:1)
您需要指定包含Xamarin.Android.Support.v4.dll的正确路径,因为在您已通过probePath元素指定的Microsoft \ Framework \ MonoAndroid \ vX.Y路径中找不到它。< / p>
由于Xamarin.Android.Support.v4是作为NuGet包添加的,因此您需要在&#34;包&#34;中指定正确的路径。目录,可能类似于以下
<probePath>packages/Xamarin.Android.Support.v4.23.4.0.1/lib/MonoAndroid403/</probePath>
或者如果您的IDE表现得像我的那样,Xamarin.Android.Support.v4将在构建期间复制到obj / Debug路径中,在这种情况下,您可以简单地指定此相对路径,如下所示:
<probePath>obj/Debug</probePath>
我不确定&#34;首选模式&#34;使用,但这些方法中的任何一种都应该解决您的问题。