Analyse/reflect jars in C#

2019-09-07 16:03发布

问题:

I found this question .jar to .cs class/file transform technique or utility? which also would solve my problem.

But since I should provide a tool which not only generates the C#-Code but also compiles it to one dll, and this would be easiear to do only in C#, is there any .net library with which I can reflect Classes and Interfaces which are stored in a jar file? I just need the signatures for the Methods, not to invoke it.

thx

回答1:

You can use javap command line utility to print the methods signature. Use any way you familiar with to extract classes from jar: it is just a zip file. So you can either use C# API or command line utility (for example jar vfx myjar.jar