java 如何在 Android Studio 中编辑 .jar 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29478227/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to edit .jar file in Android Studio
提问by Taylor Courtney
How can I edit code in a .class file in a .jar file using Android Studio? I have already tried to edit it of course. The class I am trying to edit is a read only for some reason.
如何使用 Android Studio 在 .jar 文件中的 .class 文件中编辑代码?我当然已经尝试过编辑它。由于某种原因,我试图编辑的课程是只读的。
回答by noob
Jar
files are compressed archives (zipped files) of .class
files( and few other resources). .class
files are compiled .java
files. You can not edit a compiled file in normal situation unless you decompile to get source code, edit the code and recompile again.
Jar
文件是.class
文件(和一些其他资源)的压缩档案(压缩文件)。.class
文件是编译后的.java
文件。正常情况下你不能编辑一个编译好的文件,除非你反编译得到源代码,编辑代码并重新编译。
Decompiling is a tedious process, thus getting a source code is the best option here.
反编译是一个繁琐的过程,因此获取源代码是这里的最佳选择。
Note:You can rename the .jar
file to a .zip
file and can open it using any compression tool such as winrar
or winzip
to see the content.
注意:您可以将.jar
文件重命名为文件,.zip
并且可以使用任何压缩工具打开它,例如winrar
或winzip
查看内容。