Clearing up a couple of misconceptions about the ART runtime - Nexus 4 General

Lately I've seen a lot wrong information being posted about ART and deodex/odex, so let me clear some things up. This is focused on Google builds and not AOSP built ones,
First - ART is not for odex only, actually it's for deodex only. The problem has been that people are deodexing the system when it's not necessary as Google's builds are already deodexed and those dex files are the ones that are optimized for ART, so in reality all you have to do is delete the odex files if you want to be deodexed
Second - Odexing a ROM(or in stock form) and leaving the dex files in the apks/framework, completely negates the point of odex files, as from my testing, if a dex is present, the odex is ignored and the classes.dex is built into the dalvik-cache folder, so claims of space saving, etc are wrong. Easiest way to see is by clearing your dalvik-cache and seeing the number of apps in the Android is upgrading message while booting, ie, on my phone, deodexed I have 113 files to optimize(build dalvik-cache files), odexed while leaving the dex files, 113 and true odexed with no dex files, 37. Now if you don't care for ART and really want to the benefits of an odexed system, then remove the dex files but be sure to zipalign the apks.

ART odex
Calkulin said:
Lately I've seen a lot wrong information being posted about ART and deodex/odex, so let me clear some things up. This is focused on Google builds and not AOSP built ones,
First - ART is not for odex only, actually it's for deodex only. The problem has been that people are deodexing the system when it's not necessary as Google's builds are already deodexed and those dex files are the ones that are optimized for ART, so in reality all you have to do is delete the odex files if you want to be deodexed
Second - Odexing a ROM(or in stock form) and leaving the dex files in the apks/framework, completely negates the point of odex files, as from my testing, if a dex is present, the odex is ignored and the classes.dex is built into the dalvik-cache folder, so claims of space saving, etc are wrong. Easiest way to see is by clearing your dalvik-cache and seeing the number of apps in the Android is upgrading message while booting, ie, on my phone, deodexed I have 113 files to optimize(build dalvik-cache files), odexed while leaving the dex files, 113 and true odexed with no dex files, 37. Now if you don't care for ART and really want to the benefits of an odexed system, then remove the dex files but be sure to zipalign the apks.
Click to expand...
Click to collapse
If I correctly understand what you are saying, then there is no point in having odexed .jar or .apk files when using the ART runtime. Is that right?

I'll admit that was a bit hard to understand but i think im getting the same message as the guy about me if that is correct

Related

[Q] manually deodexed and compressed apk's make bootloop

Hello,
I tried manually deodexing my /system/framework and /system/app with xUltimate according to this:
http://forum.androidcentral.com/mot...cks/30539-how-manually-deodex-your-phone.html
Now this has worked fine and I can also boot my phone fine with the deodexed files. But there is also on option in xUltimate to compress/optimize the apk files. If I do that and flash my phone with the compressed files, I get into a bootloop.
The compression seems to save a total of 20MB of space (from 103MB to 84MB) and I hope this could give the device a small speed improvement, but I just can't seem to get it to work.
I also know that there are ROMs out there that have all the files deodexed, but in 90% of cases these files are also modified (custom themes and whatnot) and I don't like that, I would just want a vanilla deodexed ROM so that I can make changes myself if I want to.
I have also searched the forum for 'xultimate' but couldn't find any hit. What are other people using to deodex/optimize/zipalign their ROMs? Are there any better utilities out there?
I'd be very thankful for any tips/tricks.
Thank you!

[Q] Odexed o deodexed

I Have read a lot of info about odexed and deodexed ROMS. but still (and maybe cause I don't understand a lot of technicalities) I don't get, WHICH IS BETTER? and WHY?
odexed o deodexed????
If u can explain it in simple in words would be better, and sorry for asking a lot!
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.
Click Below link for Complete Guide.
http://www.addictivetips.com/mobile/what-is-odex-and-deodex-in-android-complete-guide/

[Complete Guide] What Is Odex And Deodex In Android !

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.
Screen Shots
Reserved 2.
Help for getting the deodexed files onto Galaxy Tab S 8.4
I have deodexed the 'app', 'priv-app', and 'framework' folders and the build.prop file using the JoelDroid batch deodexer tool (as outlined in this thread). I am looking for help for getting the deodexed files onto my Samsung Galaxy Tab S 8.4 (running Lollipop 5.0.2). My ROM is currently rooted with Knox 0x0 and I used FlashFire to get my device rooted and updated to lollipop (as outlined in this thread) - and as a result - I don't have a custom recovery such as TWRP installed. I read this guide that calls for deleting the old 'app', 'priv-app', and 'framework' folders and (via recovery) copying the new folders (with the deodexed files) to /system.
Since I don't have a custom recovery installed - what's the best way to get the deodexed files onto my device so that I can have a deodexed ROM (& still retain my Knox 0x0 status)?
Thanks for the help!
I think the only way is by installing Custom Recovery,
but, i will look for a way.
UPDATE: use your deodexer tool while following this steps without using the tool given there, the only downside is you need TWRP installed.
link : http://forum.xda-developers.com/galaxy-tab-s/themes-apps/how-to-deodex-stock-rom-t3254734
rob.allen78 said:
I have deodexed the 'app', 'priv-app', and 'framework' folders and the build.prop file using the JoelDroid batch deodexer tool (as outlined in this thread). I am looking for help for getting the deodexed files onto my Samsung Galaxy Tab S 8.4 (running Lollipop 5.0.2). My ROM is currently rooted with Knox 0x0 and I used FlashFire to get my device rooted and updated to lollipop (as outlined in this thread) - and as a result - I don't have a custom recovery such as TWRP installed. I read this guide that calls for deleting the old 'app', 'priv-app', and 'framework' folders and (via recovery) copying the new folders (with the deodexed files) to /system.
Since I don't have a custom recovery installed - what's the best way to get the deodexed files onto my device so that I can have a deodexed ROM (& still retain my Knox 0x0 status)?
Thanks for the help!
Click to expand...
Click to collapse
Thank you so much! I recently started to explore things like custom ROMs on my SM-T800. I can definitely use a crash course in things like this. Especially since I have not (yet) been able to get Xposed on CM 12.1, pacman-ROM and Phoenix-ROM.
Thanks!
rob.allen78 said:
Since I don't have a custom recovery installed - what's the best way to get the deodexed files onto my device so that I can have a deodexed ROM (& still retain my Knox 0x0 status)?
Thanks for the help!
Click to expand...
Click to collapse
Either create a flashable zip with those files or unpack the whole system image and replace those files/folders and create a flashable zip from that. Flash with flashfire.
You will need to set the correct permissions so best to use something like archi kitchen to automate it.
However considering there are a plethora of deodex roms currently available why bother?
DUHAlgerianSkills said:
I think the only way is by installing Custom Recovery,
but, i will look for a way.
UPDATE: use your deodexer tool while following this steps without using the tool given there, the only downside is you need TWRP installed.
link : http://forum.xda-developers.com/galaxy-tab-s/themes-apps/how-to-deodex-stock-rom-t3254734
Click to expand...
Click to collapse
Thank you for the reply. I was hoping that there was a way to do it without having a custom recovery. If I am not mistaken, flashing a custom recovery will trip Knox correct?
---------- Post added at 10:45 AM ---------- Previous post was at 10:34 AM ----------
ashyx said:
Either create a flashable zip with those files or unpack the whole system image and replace those files/folders and create a flashable zip from that. Flash with flashfire.
You will need to set the correct permissions so best to use something like archi kitchen to automate it.
However considering there are a plethora of deodex roms currently available why bother?
Click to expand...
Click to collapse
I may explore creating a flashable zip (any links for newbie to creating flashable zips?) The reason being is that there aren't any deodexed ROMS (stock tw) running the latest official build for my tablet (I am running bulld LRX22G. T700XXU1BOI1)
Thanks for these explanations
Create a flashable zip for your tab using this
https://play.google.com/store/apps/details?id=zip.me
i donno how it works but seems legit, check it out.
rob.allen78 said:
Thank you for the reply. I was hoping that there was a way to do it without having a custom recovery. If I am not mistaken, flashing a custom recovery will trip Knox correct?
---------- Post added at 10:45 AM ---------- Previous post was at 10:34 AM ----------
I may explore creating a flashable zip (any links for newbie to creating flashable zips?) The reason being is that there aren't any deodexed ROMS (stock tw) running the latest official build for my tablet (I am running bulld LRX22G. T700XXU1BOI1)
Click to expand...
Click to collapse

how to i force android 4.4 MIUI v7 to run in ART instead of dalvik?

as the title says i need to switch to ART instead of dalvik, i have tried all conventional ways like editing .prop files and stuff. the settings pane has no such option to do so. and i dont think my lib folder has the files , i put them there manually.

[Developing Module] framework .jar files are modified but are not loaded by Android

Hi all.
I am developing a magisk module that modifies system/framework/services.jar and some APKs using Magic Mount for Pokemon GO and other games.
I am using the Magisk Module template where I have added relevant files/folders to system.
The APKs I added work successfully.
But the framework .JAR files such as services.jar that I added are not loaded by Android after reboot.
As in, the .JAR files are replaced successfully, but Android exhibits no change, as if it was not using them and using instead the stock .JAR files.
I tried checking via md5sum in the terminal whether the services.jar file had in fact been swapped for the one embedded in my Magisk Module.
It had been successfully changed.
Maybe the OS wasn't loading these .JAR files at all, so as an experiment, I tried swapping services.jar for an empty file.
The phone still booted, and running md5sum and cat confirmed that system/framework/services.jar was an empty file.
My best guess is that framework files are loaded way before system/app APKs, but I found no information regarding my issue via Google.
I hope that someone here could please offer some quick tip or wisdom. Thank you in advance.
P.S.: I checked the open source Magisk modules I could find, and those that used framework .JAR replacements did not implement anything other than the basic template. An example: SonyFramework (My account can't post links yet).
Did you deodex your ROM, or is it a deodexed ROM?
I think you can only patch framework classes on deodexed ROMs.
Fif_ said:
Did you deodex your ROM, or is it a deodexed ROM?
I think you can only patch framework classes on deodexed ROMs.
Click to expand...
Click to collapse
Thank you for the suggestion.
The ROM I'm working on is Stock and Odexed by default.
The .JAR files I am including in the Module are Deodexed mods of the stock ones.
I tried the following as per your reply:
A) deodexing the whole ROM
B) deodexing the whole /system/framework/*
C) deodexing /system/framework/services.jar and removing odex residue (services.odex)
Unfortunately the device won't boot with A or B :S
With C it boots correctly, but the main issue remains.
---
An interesting behavior I found, is that when substituting (stock odex services.jar) with (modded deodexed services.jar),
the /system/framework/oat/arm/services.odex and other odex residue disappears for services.jar.
This along with the md5sum matching the modded version makes me think that maybe /system/framework gets loaded before Magic Mount gets to modify it.
Digging through open source Magisk modules I am yet to find the missing piece.
Thank you for your help Fif_, and to whoever takes the time to read my thread
Have a look at this thread. https://tapatalk.com/shareLink?url=...3793&share_type=t
[MODULE] Smali Patcher 0.8 and compare methods.
The module to replace patched, de-odexed services.jar definitely works.
shoey63 said:
Have a look at this thread (...)
Click to expand...
Click to collapse
Thanks, "Smali Patcher" was indeed a good clue.
What I found in the "Smali Patcher" project:
-> services.odex was being deleted
But I also needed to modify framework.jar
unfortunately there is no "framework.odex" file.
Googling around seems that framework.jar's odex companion is stored in "/system/framework/arm/boot.oat", but boot.oat contains many more unrelated .jars :S
After fully Deodexing the WHOLE ROM, the Magisk Module works.
I wonder if there is a way to remove framework.odex from boot.oat... that would be very useful.
Thank you guys for your help,

Categories

Resources