Many netizens may think of merging odex and apk into apk containing dex files, so that the merged apk files will be installed in /data/ and the rom will be stored in /system/bin, which will eventually lead to less software that users can install in Android phones and occupy system space.
1.APK method for generating odex file;
Compile build/tools/dexepropt/dex opt-wrapper on open source GIT, just use dexopt-wrapper and follow the steps.
Put dexopt-wrapper into the /data/local directory, execute linux command line with adb shell, and enter the /data/local directory with cd command.
CD/ data/local
. /dex opt-wrapper Android 123 . apk Android 123 . odex
Second, merge the apk of odex and less dex into a complete apk file.
The required tool is smali, an open source java processing software:
/p/smali/downloads/list
1. Download jar files of baksmali and smali to the working directory.
2. Put the five core files. Odex, extension odex, frame. Odex, Android. Policy. Odex and services. Odex is placed in the same directory (it can also be placed in other directories, which is specified by setting the BOOTCLASSPATH, and the default is the current directory).
Example:
Take teeter as an example (some Android devices of HTC are often built-in). There may be two files in the ROM, teeter.apk+teeter.odex
1, decompose odex file:
Java-jar baks Mali- 1 . 2 . 1 . jar-x teeter . odex
If there are no other problems, an out directory will be generated in the working directory, which contains some decomposed files, so I won't go into the role of these files here.
2. change the decomposed file into classes.dex: Java-xmx512m-jarsmali-1.2.1.jarout-o classes.dex, thus a useful class.dex file can be obtained.
3. Open the teeter.apk file with WinZip or WinRAR, and put this classes.dex in it.
4. Finally, re-sign the latest apk containing classes.dex with signapk (downloaded from the last article of the automatic signature tool), and you can install a separate apk program.
5. After signing, it can be installed and used.