2016-07-23 53 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這些方法應該解決您的問題。