如何在Android Studio中编辑.jar文件 [英] How to edit .jar file in Android Studio

查看:189
本文介绍了如何在Android Studio中编辑.jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Android Studio在.jar文件中编辑.class文件中的代码?我当然已经尝试过编辑它了。我试图编辑的类只是出于某种原因只读。

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.

推荐答案

Jar 文件是 .class 文件(以及其他一些资源)的压缩档案(压缩文件)。 .class 文件已编译 .java 文件。除非您反编译以获取源代码,编辑代码并重新编译,否则无法在正常情况下编辑已编译的文件。

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.

反编译是一个繁琐的过程,因此获取源代码代码是这里的最佳选择。

Decompiling is a tedious process, thus getting a source code is the best option here.

注意:您可以重命名 .jar 文件到 .zip 文件,可以使用任何压缩工具打开它,例如 winrar winzip 查看内容。

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.

这篇关于如何在Android Studio中编辑.jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆