Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnlib.DotNet.TypeResolveException: Could not resolve type: Java.Interop.IJavaPeerable #31

Open
megamidge opened this issue Feb 25, 2019 · 3 comments

Comments

@megamidge
Copy link

This may not be a bug but a fail on my part, but i can't seem to figure it out.
ConfuserEx is throwing an exception dnlib.DotNet.TypeResolveException: Could not resolve type: Java.Interop.IJavaPeerable`.

For context, i'm trying to obfuscate the DLL generated by a Mono.Android project. I've added probe paths to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0 and C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v7.1.

My project references I've made sure my project references Java.Interop to see if thats the issue but it hasn't changed anything.

Debug ouput from ConfuserEx:

[INFO] ConfuserEx v1.0.0 Copyright (C) Ki 2014
3>   [INFO] Running on Microsoft Windows NT 6.2.9200.0, .NET Framework v4.0.30319.42000, 64 bits
3>  [DEBUG] Discovering plugins...
3>   [INFO] Discovered 10 protections, 1 packers.
3>  [DEBUG] Resolving component dependency...
3>   [INFO] Loading input modules...
3>   [INFO] Loading 'C:\Users\ssmith\Documents\GitRepos\pokerplus\Airdice\AirdiceGame\bin\Release\DroidBaseGL.dll '...
3>   [INFO] Initializing...
3>  [DEBUG] Building pipeline...
3>   [INFO] Resolving dependencies...
3>  [DEBUG] Checking Strong Name...
3>  [DEBUG] Creating global .cctors...
3>  [DEBUG] Watermarking...
3>  [DEBUG] Executing 'Name analysis' phase...
3>  [DEBUG] Building VTables & identifier list...
3>  [ERROR] Failed to resolve a type, check if all dependencies are present in the correct version.
3>  Exception: dnlib.DotNet.TypeResolveException: Could not resolve type: Java.Interop.IJavaPeerable (Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065)
3>     at dnlib.DotNet.TypeRef.ResolveThrow(ModuleDef sourceModule) in E:\Source\Public\Confuser2\dnlib\src\DotNet\TypeRef.cs:line 333
3>     at Confuser.Renamer.VTableStorage.GetVTable(ITypeDefOrRef type) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 342
3>     at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 155
3>     at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 332
3>     at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 146
3>     at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 332
3>     at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 146
3>     at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 332
3>     at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 146
3>     at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 332
3>     at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 146
3>     at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 332
3>     at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 146
3>     at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 332
3>     at Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 146
3>     at Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) in e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:line 332
3>     at Confuser.Renamer.AnalyzePhase.Execute(ConfuserContext context, ProtectionParameters parameters) in e:\Source\Public\Confuser2\Confuser.Renamer\AnalyzePhase.cs:line 46
3>     at Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action`1 func, Func`1 targets, ConfuserContext context) in e:\Source\Public\Confuser2\Confuser.Core\ProtectionPipeline.cs:line 139
3>     at Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context) in e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:line 221
3>     at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:line 175
3>  [ERROR] ---BEGIN DEBUG INFO---
3>  [ERROR] Installed Framework Versions:
3>  [ERROR]     v2.0.50727  2.0.50727.4927
3>  [ERROR]     v3.0  3.0.30729.4926
3>  [ERROR]     v3.5  3.5.30729.4926
3>  [ERROR]     v4
3>  [ERROR]     Client  4.7.03056
3>  [ERROR]     Full  4.7.03056
3>  [ERROR]     v4.0
3>  [ERROR]     Client  4.0.0.0
3>  [ERROR]     v4.5 461808
3>  [ERROR] 
3>  [ERROR] Cached assemblies:
3>  [ERROR]     DroidBaseGL, Version=3.1.0.1, Culture=neutral, PublicKeyToken=null (C:\Users\ssmith\Documents\GitRepos\pokerplus\Airdice\AirdiceGame\bin\Release\DroidBaseGL.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
3>  [ERROR]         WexelGL_Droid, Version=1.2.2.31, Culture=neutral, PublicKeyToken=null
3>  [ERROR]         OpenTK, Version=0.9.9.3, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
3>  [ERROR]         MultiGameSDK, Version=3.0.1.2, Culture=neutral, PublicKeyToken=null
3>  [ERROR]         WexelAirdiceLib, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null
3>  [ERROR]         System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]     mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\mscorlib.dll)
3>  [ERROR]     mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\mscorlib.dll)
3>  [ERROR]     Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065 (C:\Users\ssmith\Documents\GitRepos\pokerplus\Airdice\AirdiceGame\bin\Release\Mono.Android.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
3>  [ERROR]         System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
3>  [ERROR]         System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]     WexelGL_Droid, Version=1.2.2.31, Culture=neutral, PublicKeyToken=null (C:\Users\ssmith\Documents\GitRepos\pokerplus\Airdice\AirdiceGame\bin\Release\WexelGL_Droid.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         OpenTK, Version=0.9.9.3, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
3>  [ERROR]         Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
3>  [ERROR]         System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]     OpenTK, Version=0.9.9.3, Culture=neutral, PublicKeyToken=84e04ff9cfb79065 (C:\Users\ssmith\Documents\GitRepos\pokerplus\Airdice\AirdiceGame\bin\Release\OpenTK.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
3>  [ERROR]     MultiGameSDK, Version=3.0.1.2, Culture=neutral, PublicKeyToken=null (C:\Users\ssmith\Documents\GitRepos\pokerplus\Airdice\AirdiceGame\bin\Release\MultiGameSDK.dll)
3>  [ERROR]         mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
3>  [ERROR]         System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
3>  [ERROR]     WexelAirdiceLib, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null (C:\Users\ssmith\Documents\GitRepos\pokerplus\Airdice\AirdiceGame\bin\Release\WexelAirdiceLib.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
3>  [ERROR]         System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]         System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
3>  [ERROR]     System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\System.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
3>  [ERROR]     System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\System.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
3>  [ERROR]     System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\System.Core.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
3>  [ERROR]         System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
3>  [ERROR]     System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\System.Core.dll)
3>  [ERROR]         mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
3>  [ERROR]         System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes
3>  Failed at 11:42, 0:01 elapsed.
3>  
3>  Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
3>     at Confuser.Core.ConfuserEngine.PrintEnvironmentInfo(ConfuserContext context) in e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:line 525
3>     at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:line 183
3>     at System.Threading.Tasks.Task.Execute()
3>     --- End of inner exception stack trace ---
3>     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
3>     at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
3>     at Confuser.CLI.Program.RunProject(ConfuserParameters parameters) in e:\Source\Public\Confuser2\Confuser.CLI\Program.cs:line 128
3>     at Confuser.CLI.Program.Main(String[] args) in e:\Source\Public\Confuser2\Confuser.CLI\Program.cs:line 105
@XenocodeRCE
Copy link
Owner

Hello

• Make sure the process has Read/Write access to the file.
• Can you debug the source code ?
• Can you try without selecting the Rename feature ?

@megamidge
Copy link
Author

  • Confident read/write access is there, have been using ConfuserEx with non-Android projects in the same area of the drive. Its spawned up from a PowerShell script that successfully backs up the target before obfuscation starts.
  • Source code runs fine and debugs without obfuscation, release builds work etc.
  • Removing my options for the Rename feature made no difference
  • Outright removing the Rename feature also had no effect (output still same)

@XenocodeRCE
Copy link
Owner

Make sure the file Java.Interop.dll Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065 is in the correct folder where the file you want to protect is in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants