Affichage des articles dont le libellé est Deodex. Afficher tous les articles

How to deodex stock rom lollipop thanks





I did some searching but didn't find a user (not dev) friendly deodex tool that can deodex a phone in one continuous process (not one apk at a time manual process).

I used one years ago to deodex a previous phone, and was wondering if there is one out there to deodex stock, rooted OC1 I have on my MDK S4.

Thanks.





Hi i try to deodex rom for sm-g900f lollipop BOD3 i try joel droid for deodex app,private-app and frame. Deodex ok, only maps and gsmcore dont deodex but when i flash the rom dont boot ,help i want to now if is framework inssue?????





As an Android newbie, what bothered me most was coming across terminology beyond my comprehension. Not coming from a Linux background it became hard to keep up with the oh-so-commonly-used words spread all across the development community. Likewise, since I didn’t understand the terms, consequently I was unable to determine is something was of any use to me or not. From what I have seen, this problem extends to many novice and even average users.

One commonly occurring word when playing with custom ROMs and firmware, and even themes is deodexed and odexed. Most users fail to understand what these terms actually imply, and while developers would boast again and again about their themes and ROMs being deodexed, the average user is left clueless as to what is going on.


WHAT IS AN ODEX FILE?

In Android file system, applications come in packages with the extension .apk. These application packages, or APKs contain certain .odex files whose supposed function is to save space. These ‘odex’ files are actually collections of parts of an application that are optimized before booting. Doing so speeds up the boot process, as it preloads part of an application. On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.

THEN COMES DEODEX

Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts.

In summary, Deodexed ROMs (or APKs) have all their application packages put back together in one place, allowing for easy modification such as theming. Since no pieces of code are coming from any external location, custom ROMs or APKs are always deodexed to ensure integrity.


HOW THIS WORKS

For the more geeky amongst us, 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.


ADVANTAGES & DISADVANTAGES

The advantage of deodexing is in modification possibilities. This is most widely used in custom ROMs and themes. A developer building a custom ROM would almost always choose to deodex the ROM package first, since that would not only allow him to modify various APKs, but also leave room for post-install theming.

On the other hand, since the .odex files were supposed to quickly build the dalvik cache, removing them would mean longer initial boot times. However, this is true only for the first ever boot after deodexing, since the cache would still get built over time as applications are used. Longer boot times may only be seen again if the dalvik cache is wiped for some reason.

For a casual user, the main implication is in theming possibilities. Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM.


Was this article helpful? If you are confused with some other terms and want us to help explain them, please let us know in the comments.





I know this is an old news, but I feels most of people out there or in here wondering if they could deodex their CM7.2
or other ROM correctly. After trying every kitchen/apps etc. to deodex, it's seems worthless. One day, I find a simple
way on how to deodex ROM manually & it is also works on CM7.2

NOTE: 1 THIS METHOD HAVE ALREADY DONE ONLY BY WINDOWS
2 THIS METHOD IS BASICALLY WORKS ON ANY ROM
3 BEFORE ASK ANYTHING, PLEASE READ THE WHOLE MAIN THREAD FIRST

Requirements:

1 The Manual-Deodexer.zip [in attachments below]
2 A working brain :silly:
3 All framework files [Can find it at system/framework/HERE]
4 APK/JAR to deodex
5 A working PC of course

STEP A: Setup a working folder

1 Extract the Manual-Deodexer.zip
2 Create a folder named "Deodexer" [any place] on your PC [EXAMPLE: D:/Deodexer]
3 Place all the files include in the Manuall-Deodexer.zip in the "Deodexer" folder
[baksmali.jar, smali.jar, java.awt.jar, busybox, dexopt-wrapper, zipalign.exe]

STEP B: Deodexing All JARs Files [IMPORTANT]

1 Place all of your framework files also in "Deodexer" folder
2 Deodexing framework files [I will use android.policy.jar for a start]
3 Run CMD in mentioned folder [Shift + Right Click] & type:

java -Xmx1024m -jar baksmali.jar -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:a ndroid.policy.jar:services.jar:core-junit.jar -x android.policy.odex

THIS WILL CREATE "out" FOLDER

4 Make sure the "out" folder is there, then in CMD, type:

java -Xmx1024m -jar smali.jar out -o classes.dex

THIS WILL CREATE "classes.dex"

5 Finally, deodex android.policy.jar:
> After the classes.dex created, directly delete both android.policy.odex & its "out" folder
> Open android.policy.jar with 7ZIP without extracting
> Drag the classes.dex created in the 7ZIP window in the root folder
> Close the 7ZIP & you've deodexed android.policy.jar
[REPEAT THE SAME STEP FOR OTHER JARs 1 BY 1] [ON MY CM7.2, I GOT 19 JAR Files]
> So, basically repeat the steps for 19 times :laugh:

STEP B: Deodexing APK in [system/app]

1 Place any APK you want to deodex also in "Deodexer" folder [I will use SystemUI.apk for example]
2 Run CMD in mentioned folder [Shift + Right] & type:

java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar :bmgr.jar:bouncycastle.jar:com.android.location.pr ovider.jar:com.google.android.maps.jar:core.jar:co re-junit.jar:ext.jar:framework.jar:ime.jar:input.jar: java.awt.jar:javax.obex.jar:monkey.jar:pm.jar:serv ices.jar:sqlite-jdbc.jar:svc.jar -x SystemUI.odex

THIS WILL ALSO CREATE "out" FOLDER

3 Make sure the "out" is there & in CMD type:

java -Xmx1024m -jar smali.jar out -o classes.dex

THIS WILL CREATE "classes.dex"

4 Finally deodex SystemUI.apk:
> After the classes.dex created, directly delete both SystemUI.odex & its "out" folder
> Open SystemUI.apk with 7ZIP without extracting
> Drag the classes.dex created in the 7ZIP window in the root folder
> Close the 7ZIP windows & you've deodexed SystemUI.apk

STEP C: Zipaplign Deodexed APK For Performances [OPTIONAL][ONLY APK]

1 In the same CMD prompt windows, type:

zipalign -v 4 "anyapk".apk zip_"anyapk".apk

2 A zip_"anyapk".apk file will be created. Delete your original deodexed "anyapk".apk & rename zip_"anyapk".apk to
the "anyapk".apk
3 Install it normally or push it to system/app [rw-r-r] method

NOTE: 1 TO DEODEXED Emails.apk & MobilePrint.apk YOU'LL NEEDS 1 MORE java.awt.jar
2 IT IS DEODEX, SO BASICALLY YOU DON'T HAVE TO SIGN THE APK

ALL CREDITS GOES TO @sicopat FOR HIS WONDERFUL THREAD
To me too, why not @Joe Hanson for making it snappy :cool:
HIT the Thanks button if I helped ;)














Attached Files





File Type: zip Manual-Deodexer.zip -
[Click for QR Code]
(5.38 MB)









I am on stock .207 ROM, I want to deodex it. Is there any tool or procedure??