What does Ethereum DEX do
DEX file is the executable file of Android system, which contains all the operation instructions and runtime data of the application
because Dalvik is a Java virtual machine specially designed for embedded devices, there is an essential difference between the structure design of DEX file and standard class file
when a java program is compiled into a class, you need to use the DEX tool to integrate all the class files into a DEX file. The purpose is that each class can share data, which reces rendancy to a certain extent. At the same time, the file structure is more compact, and the DEX file is about 50% of the traditional jar file size
DEX combines the common information of each file in the original class, which reces the rendancy of class
from a macro point of view, the file result of DEX is very simple. In fact, it is composed of multiple data bodies with different structures, which are connected end to end
extended materials:
Android's system architecture, like its operating system, adopts a hierarchical architecture
from the architecture diagram, Android is divided into four layers, from the high level to the low level, which are application layer, application framework layer, system runtime layer and Linux kernel layer
Function ofDEX file:
the function of DEX file is to record the information of all class files of the whole project (usually an Android project)
Structure ofDEX file:
8-bit binary stream file; Each data is closely arranged without gaps, which reces the file volume and speeds up the loading speed; The class information of the whole project is stored in a DEX file (without considering the case of DEX subcontracting); Similarly, you can view the DEX file information through the 010editor
resources: Network Android
In short, it is the optimized Android version. Exe. It's in every APK installation package. Relative to the Java virtual machine running on PC; Davlik virtual machine on Android runs. DEX
function
enables Dalvik to run
DEX benefits
can be loaded directly with the dexclassloader class and dynamically. So as long as the shell is added to the DEX and the shell is removed when the program is running, the risk of static decompilation can be avoided
extended materials
reasons for using DEX file
in Android system, all codes of an app are in one DEX file. DEX is a jar like package that stores a lot of archive files of Java bytecode
because Android system uses Dalvik virtual machine, it is necessary to convert the class file compiled with java compiler into the class file that Dalvik can execute
1. The first time to enter the system after brushing will be shortened. The speed of files should also be improved
2. APK files cannot be installed separately, and if you decompile APK files, you can only get resource files. It can be said to play a certain role in protection, to avoid being arbitrarily modified and used. By doing so, the manufacturer can guarantee certain anti piracy, because APK without DEX file cannot be installed normally
3. It will increase some space for installing applications, though not a lot
4. For some mobile phones with small body memory, you can delete the DEX file to make a large memory package, but this large memory package will slow down the startup speed of mobile software. It is suitable for users who don't pursue speed and need more memory software
effect
after ODEX, the system startup and program running speed are greatly improved, and the stability remains unchanged. Therefore, ODEX is recommended
generally speaking, official ROMs are ODEX ROMs (including ODEX files), while customized ROMs are mostly deodex ROMs (without ODEX files). Both should have their own advantages. It seems that there is no unified view now. Most of the official ROMs have one. ODEX file for each APK, while the deodex ROMs have only one APK. The. ODEX is converted into classes. DEX and put into the APK package. So. APK +. ODEX of ODEX ROM = one. APK of deodex ROM (in short, it's the last merging process)
generation of ODEX file
1. First configure Java environment, I believe everyone will
2. Download tool
ADB toolkit
dexopt wrapper tool
3. Connect mobile phone with computer with data cable, Settings in mobile phone --- application settings --- USB debugging under development and allowed simulation location should be selected; Put the file * *. APK that needs to generate the ODEX file into the data / local directory of the mobile phone (the same directory as the dexopt wrapper)
4: on the computer (XP system):
"run" -- CMD (enter)
Enter ADB shell (enter)
Su (enter)
CD data / local (enter)
dexopt wrapper ^. APK ^. ODEX (enter) (* * *. APK has the same name as ^. ODEX)
in this way, ODEX is generated (if you can't see it, exit local and then enter local)
5 Cut and paste it out, and use winrar to delete the classes.dex in * * *. APK
in this way, APK + ODEX is generated. Copy the two files with the same name and different suffixes to system; App or data & # 92; Modify the permissions in the app and restart the phone
there are many ODEX files in Android Rom. compared with the DEX files in APK, what is the function of this ODEX? If you look carefully, you will find that the file names are one-to-one corresponding, and there is no DEX file in those corresponding APK files. By doing so, the manufacturer can guarantee certain anti * *, because APK without DEX file is not normally installed, and the manufacturer can directly put ODEX and incomplete APK files into the mobile ROM and solidify them into / system / bin, so that ordinary users can export and use them without * *
