There are many odex files in the android Rom. What is the role of this odex file relative to the DEX file in the APK? If you observe carefully, you will find that the file names correspond one by one, and the corresponding APK files do not contain Dex files. In this way, the vendor can ensure anti-piracy, because the APK without the DEX file cannot be installed normally, the vendor directly puts the odex and incomplete APK files in the ROM of the mobile phone to solidify them into/system/bin, which will make the general user unable to export and use them normally.
You may think of merging odex and APK into an APK that contains the DEX file. In this way, the final APK file is installed in/data/, and the Rom is stored in/system/app, as a result, the software that users can install on Android phones will become less and occupy system space.
I. How to generate an odex file using APK:
Compile build/tools/dexpreopt/dexopt-wrapper on open-source git. Use dexopt-wrapper.
Put dexopt-wrapper in the/data/local directory, run the Linux Command Line using the ADB shell, and run the CD command to enter the/data/local directory,
CD/data/local
./Dexopt-wrapper android123.apk android123.odex
2. Merge the APK files of odex and Shao Dex into a complete APK file.
1. Download The http://smali.googlecode.com/files/smali-1.2.2.jar and directories/system/framework
2. Generate a class file through odex
Java-jar baksmali-1.2.2.jar-x android123.odex
After executing the preceding command, a class file named android123.odex in the out folder is generated. If a problem occurs, you can generate it from the Java environment variable in the/system/framework of Rom to the PC as prompted.
3. Generate the classes. Dex file through the class.
Java-xmx512m-jar smali-1.2.2.jar out-O classes. Dex
4. Put classes. Dex in the APK file.
Because APK is the mime encoding type of zip, use WinZip or WinRAR to drag it directly to the APK and change it to zip