简体   繁体   English

如何在Android Studio中编辑.jar文件

[英]How to edit .jar file in Android Studio

How can I edit code in a .class file in a .jar file using Android Studio? 如何使用Android Studio在.jar文件中编辑.class文件中的代码? I have already tried to edit it of course. 我当然已经尝试过编辑它了。 The class I am trying to edit is a read only for some reason. 我试图编辑的类是由于某种原因只读。

Jar files are compressed archives (zipped files) of .class files( and few other resources). Jar文件是.class文件的压缩档案(压缩文件)(以及其他一些资源)。 .class files are compiled .java files. .class文件是编译.java文件。 You can not edit a compiled file in normal situation unless you decompile to get source code, edit the code and recompile again. 除非您反编译以获取源代码,编辑代码并重新编译,否则无法在正常情况下编辑已编译的文件。

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文件,并可以使用任何压缩工具(如winrarwinzip将其打开以查看内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM