如何从提取的jar文件中读取类文件? [英] How to read a class file from an extracted jar file?
问题描述
我想阅读位于 .jar >内的
包。如何从 .class
文件code> .jar
包中读取可读的 .class
文件?
I want to read a .class
file that is located inside of a .jar
package. How can I read a readable .class
file from a .jar
package?
我的环境是:
- 语言版本:
Java
- 平台版本:
Java 1.8.0_73
- 运行时:
Java (TM)SE运行时环境(版本1.8.0_73-b02)
- VM服务器:
Java HotSpot(TM)64位服务器VM(版本25.73-b02,混合模式)
- 操作系统:
Windows 10 Home(64位)[build 10586]
- Language version:
Java
- Platform version:
Java 1.8.0_73
- Runtime:
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
- VM Server:
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
- Operating system:
Windows 10 Home (64-bit) [build 10586]
编辑:
我提取的 .class
文件包含二进制和&编译后的字节码:
My extracted .class
file that contains binary & compiled bytecode:
我想要的输出:
< img src =https://i.stack.imgur.com/hQewH.pngalt =。java文件 - 可读代码>
推荐答案
使用反编译器。我更喜欢使用 Fernflower ,或者如果你使用IntelliJ IDEA,只需从那里打开.class文件,因为它有Fernflower预装。
Use a decompiler. I prefer using Fernflower, or if you use IntelliJ IDEA, simply open .class files from there, because it has Fernflower pre-installed.
或者,转到 javadecompilers.com ,上传你的.jar文件,使用CFR并下载反编译的.zip文件。
Or, go to javadecompilers.com, upload your .jar file, use CFR and download the decompiled .zip file.
但是,在某些情况下,反编译代码是非常违法的,因此,更愿意学习反编译。
However, in some cases, decompiling code is quite illegal, so, prefer to learn instead of decompiling.
这篇关于如何从提取的jar文件中读取类文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!