Odex and deodex

Source: Internet
Author: User

Odex merge method:

Smali-1.2.2.jar and baksmali-1.2.2.jar

Http://code.google.com/p/smali/downloads/list

2. some jar files in the ROM where the APK is located are all in the/system/framework: core. jar, ext. jar, framework. jar, android. policy. jar, services. jar

Of course, these five are the most basic and may not be enough. This situation will be discussed below. (We recommend that you extract all the content under/system/framework)

3. There are four steps in total:

(1) Put the downloaded smali-1.2.2.jar and baksmali-1.2.2.jar, and the five jar from the Rom, put it into the working directory, then APK and odex also put together

(2) break down the odex file into a class file. Command: Java-jar baksmali-1.2.2.jar-x XXX. odex, after the command is complete, will generate an out folder, which is all the class files

If a problem occurs, such as an exception or a package is missing, take out the required package in the error information in the ROM and put it in the current directory.

(4) generate the class into the classes. Dex file. Command: Java-xmx512m-jar smali-1.2.2.jar out-O classes. Dex this step should have no problem, then the classes. Dex file will be generated.

(5) Put classes. Dex in the APK and cover the lid. The last step is the easiest. Use the decompression software to open the APK, and then insert the classes. Dex generated by great efforts into it.

This APK can be used. If you want to sign him again, find an auto sign signing tool.

Differences between odex and deodex:

Open an APK, which contains many folders and files. In general, layout is responsible for the interface, and value is responsible for the font color and text display.

Odex is the core part of the entire APK and is responsible for implementing functions. deodex is to integrate the odex file into a file in the form of classes. DEX and APK.

Generally, the official Rom is odex Rom, and most of the custom Rom is deodex.

The two should have their own advantages. It seems that there is no unified saying now. Most of the official Rom APK corresponds to one. odex file, while the deodex Rom only has one APK, which converts. odex to classes. DEX and puts it in the APK package.

So odex rom's .apk;.odexincludeodex1. APK (in simple terms, it is actually the process of the previous merger)

= Advantages of odex =

1. The first time the machine enters the system after being flushed will be shortened. The file running speed should also be improved.

2. the APK file cannot be installed separately. If you decompile the APK file, you can only obtain the resource file.

It can be said that it plays a certain protective role to avoid being arbitrarily modified and used. In this way, the vendor can ensure a certain degree of anti-piracy, because the APK without the DEX file cannot be installed normally.

3. Some space for installing applications will be added, though not many. (I have not found this)

= Disadvantages of odex =

1. It is inconvenient to modify the ROM and the file itself.

2. Increase the volume of the RoM package, although not many

3. When you upgrade an odex application, the application will fail. The most common is FC.

The current custom Rom is basically deodex-based because:

1. The file size can be appropriately reduced to reduce the ROM space;

2. it is mainly convenient for Rom customizers to customize and port Rom; APK is relatively easy to decompile and modify, and odex must first decompackage into smali before generating classes. dex. If you want to generate another odex, you need to use dexopt-wrapper, Which is troublesome.

I personally feel that if it is simple to use, it is not beautifying, and people who do not often modify the files in the system/APP will perform odex on the system files, it should be able to play a certain role in optimization, but now most of the installed applications are a single APK file, the upgrade will not have the FC problem.

= Zipalign =

Running zipalign on your application makes interaction between Android and the application more efficient at runtime. Therefore, this method can make the application and the entire system run faster.

In Android, when the resource file is aligned to the 4-byte boundary through memory ing, the code used to access the resource file is efficient. Zipalign can be used to easily optimize the app.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.