简体   繁体   English

Android 2.1(Eclair)的.dex文件格式,即API级别7

[英]Format of .dex files for Android 2.1 (Eclair), i.e. API level 7

I'm writing an assembler for Android/Dalvik .dex files. 我正在为Android / Dalvik .dex文件编写一个汇编程序 The official Android docs seem to only describe the newest version of the .dex format (apparently 038 as of May 2019), with a few short notes describing differences back to version 035 . 官方的Android文档似乎仅描述了最新版本的.dex格式 (截至2019年5月,显然是038 ),并有一些简短的说明描述了与035版本的区别。 A quick glimpse into Android sources seems to suggest, that version 035 of the format corresponds to Android API level 13 , meaning Android 3.2.x (Honeycomb). 快速浏览一下Android来源似乎表明,该格式的035版本对应于Android API级别13 ,即Android 3.2.x (Honeycomb)。 I own a device with Android 2.1 (Eclair), which apparently means API level 7 . 我自己的装置与Android 2.1(埃克莱尔),这显然意味着API级7。 I would like to be able to learn how to emit correct .dex and .apk files for that device, to hopefully add support for those to my assembler. 我希望能够学习如何为该设备发出正确的.dex和.apk文件,希望将这些文件的支持添加到我的汇编器中。

Where can I find information that could help me emit correct .dex files for Android 2.1 (Eclair), ie API level 7? 在哪里可以找到可以帮助我为Android 2.1(Eclair)发出正确的.dex文件(即API级别7)的信息? I don't even know what's the .dex format version string for that API level! 我什至不知道该API级别的.dex格式版本字符串是什么!

For "bonus points", I would really love to find some good reference explaining the differences in .dex format between all API levels (at least back to API level 7). 对于“加分点”,我真的很想找到一些很好的参考资料,以解释所有API级别(至少回到API级别7)之间.dex格式的差异。 I would be also interested if there are any substantial differences in the format of the binary .xml and resource files (as emitted by the aapt tool) between Android API levels. 如果Android API级别之间的二进制.xml和资源文件(由aapt工具发出)的格式存在实质性差异,我也将感兴趣。 I assume that there's a high chance the .apk format itself, as well as the signing algorithm, hopefully didn't change at all , given that it's the same format used to sign Java .jar files (ie a regular .zip with a few simple special files in the META-INF/ subdirectory). 我认为有一个高的机会.apk文件格式本身,以及签名算法,希望一点都没有因为它是用来签名的Java .jar文件(即一个普通的.zip有一些相同的格式改变, META-INF/子目录中的简单特殊文件)。 But the .dex format spec (including bytecodes) is probably the most important part, or at least a good starting point. 但是.dex格式规范(包括字节码)可能是最重要的部分,或者至少是一个很好的起点。

https://source.android.com/devices/tech/dalvik/dex-format has some quick blurbs on the differences between the versions. https://source.android.com/devices/tech/dalvik/dex-format对版本之间的差异进行了一些简短的介绍。

Note: Support for version 037 of the format was added in the Android 7.0 
release. Prior to version 037 most versions of Android have used version 035 of 
the format. The only difference between versions 035 and 037 is the addition of 
default methods and the adjustment of the invoke.

Note: Support for version 038 of the format was added in the Android 8.0 
release. Version 038 added new bytecodes (invoke-polymorphic and invoke- 
custom) and data for method handles.

Although, note that the newest version is 039, which doesn't seem to be mentioned in the doc. 不过,请注意,最新版本是039,似乎在文档中并未提及。 iirc, 039 added the invoke-custom/range , const-method-handle and const-method-type instructions. iirc,039添加了invoke-custom/rangeconst-method-handleconst-method-type指令。

Other sources of information include looking at the changelog of those documents: https://android.googlesource.com/platform/docs/source.android.com/+log/refs/heads/master/en/devices/tech/dalvik/dex-format.html https://android.googlesource.com/platform/docs/source.android.com/+log/refs/heads/master/en/devices/tech/dalvik/dalvik-bytecode.html 其他信息来源包括查看这些文档的变更日志: https : //android.googlesource.com/platform/docs/source.android.com/+log/refs/heads/master/en/devices/tech/dalvik/ dex-format.html https://android.googlesource.com/platform/docs/source.android.com/+log/refs/heads/master/en/devices/tech/dalvik/dalvik-bytecode.html

And prior to that, before the files were moved: 在此之前,在移动文件之前:

https://android.googlesource.com/platform/docs/source.android.com/+log/a3b748b40bab557fb47fe5a48a5bfb642837fb05/src/devices/tech/dalvik/dex-format.jd https://android.googlesource.com/platform/docs/source.android.com/+log/a3b748b40bab557fb47fe5a48a5bfb642837fb05/src/devices/tech/dalvik/dalvik-bytecode.jd https://android.googlesource.com/platform/docs/source.android.com/+log/a3b748b40bab557fb47fe5a48a5bfb642837fb05/src/devices/tech/dalvik/dex-format.jd https://android.googlesource.com/platform/文档/ source.android.com / +登录/ a3b748b40bab557fb47fe5a48a5bfb642837fb05 / src目录/设备/技术/达尔维克/达尔维克bytecode.jd

Also, you should be able to glean some info from the smali source. 另外,您应该能够从smali来源中收集一些信息。 It has the min/max api levels , where applicable, for every instruction. 它具有适用于每条指令的最小/最大api级别

For the instructions with the min/max set as an art version, you can use this mapping to map back to an api level. 对于将最小/最大设置为艺术版本的说明,您可以使用此映射映射回api级别。

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

相关问题 我可以在Android Studio中运行API级别7(即eclair)的代码吗? - Can i run my code of API level 7 i.e eclair in android studio? 我如何在 eclipse 中使用 Material Design 功能来实现较低版本的 android api ie 2.1 eclair - How can i use material design feature in eclipse for lower versions of android api i.e 2.1 eclair Android API 7(2.1 Eclair)下的相机的字符串参数 - Camera's string parameters under Android API 7 (2.1 Eclair) 无法在Android 2.1 Eclair上包装TextView - TextView not wrapping on Android 2.1 Eclair 从源代码构建android 2.1(eclair) - building android 2.1 (eclair) from source AES128对Android 2.1 Eclair的支持 - AES128 Support for Android 2.1 Eclair 我想通过其高级api即PJSUA2使用PJSIP堆栈开发一个android voip应用程序 - I want to develop an android VOIP app using PJSIP stack by its high level api i.e. PJSUA2 在Android API级别8-10(即从2.2到2.3.3)中,是否可以将单个视图从一种布局拖放到另一种布局中? - In Android API level 8-10, i.e. from 2.2 to 2.3.3, is it possible to drag and drop a single view from one layout into another? 带有Eclair 2.1的IntentService的权限 - Permission on IntentService with Eclair 2.1 Android 2.1(API级别7)和AdMob Sdk 6.3.1 - Android 2.1 (API level 7) and AdMob Sdk 6.3.1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM