Take the 2-minute tour ×

Are these two ways equal and correct?

Method 1:

  1. Odex the APK to a .apk and a .odex
  2. Sign the .apk file produced in step 1

Method 2:

  1. Sign the APK
  2. Odex the APK to a .apk and a .odex
share|improve this question
add comment

1 Answer

First you need to understand working of .apk and .odex file.

.Odex file:
Odex file is the extracted and optimized DEX file (classes.dex) from APK or JAR files.
An ODEX file has dependencies on every file in the BOOTCLASSPATH that is loaded when it is generated.
The odex file is only valid when used with these exact BOOTCLASSPATH files.

How it work:-
Android OS uses a Java-based virtual machine for running applications, called the Dalvik Virtual Machine. A deodexed, or .dex file contains the cache used by this virtual machine (referred to as Dalvik-cache) for a program, and it is stored inside the APK. An .odex file, on the other hand, is an optimized version of this same .dex file that is stored next to the APK as opposed to inside it.
Android applies this technique by default to all the system applications.

Now, when an Android-based system is booting, the davlik cache for the Davlik VM is built using these .odex files, allowing the OS to learn in advance what applications will be loaded, and thus speeds up the booting process.

By deodexing these APKs, a developer actually puts the .odex files back inside their respective APK packages. Since all code is now contained within the APK itself, it becomes possible to modify any application package without conflicting with the operating system’s execution environment.

You can find some information Here and
Here is one StackOverFlow question may helpful to you.

share|improve this answer
add comment

Your Answer


