2016-07-23 51 views
4

我试图混淆使用ConfuserEx Xamarin.Android的dll,但我得到的唯一错误:错误,而试图混淆Xamarin.android DLL与ConfuserEx

[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

对于固定工作,我删除了一些保护规则。 – marcu

+0

谢谢marcu。你的confuserex规则是什么? – Andreas

回答

0

你需要指定包含Xamarin.Android.Support.v4.dll正确的路径,因为它不是说你有Microsoft \框架\ MonoAndroid \ VX.Y路径中找到已经通过probePath元素指定。

由于Xamarin.Android.Support.v4添加为NuGet包,你要么需要将“包”目录中指定正确的路径,这可能看起来像下面

<probePath>packages/Xamarin.Android.Support.v4.23.4.0.1/lib/MonoAndroid403/</probePath> 

或者如果你的IDE的行为就像我的,Xamarin.Android.Support.v4将在编译时间到OBJ /调试路径复制,在这种情况下,如下所示,你可以简单地指定此相对路径:

<probePath>obj/Debug</probePath> 

我不确定哪个是使用的“首选模式”,但是o这些方法应该解决您的问题。