.class 和 .dex 文件有什么区别? [英] What is the difference between .class and .dex files?

查看:44
本文介绍了.class 和 .dex 文件有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当然,.dex文件是针对Android的Dalvik VM的,.class文件是针对JVM的.但我想知道它们是否有相似的布局(常量池、字段、方法、属性……)?字节码不同,但是否存在与 JVM 中的字节码等效的 Dalvik 特定操作码?

Of course, .dex files are for the Dalvik VM of Android and .class files are for the JVM. But I wonder if they have similar layouts (Constant Pool, Fields, Methods, Attributes, ...)? The bytecode is different, but are there Dalvik specific opcode equivalents to the ones from the JVM?

推荐答案

Java jar 文件有很多类文件,而每个 APK 文件只有一个classes.dex 文件,如下所示.根据谷歌,APK 格式出于性能和安全原因,与类文件格式不同.

Whereas a Java jar file has many class files, each APK file has only a single classes.dex file, as shown below. According to Google, the APK format differs from the class-file format for performance and security reasons.

这篇关于.class 和 .dex 文件有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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