I pulled down boot.oat from an API22 Android phone. It's Android 5.1 Lollipop which brought the change from Dalvik to ART and is a bit mistified.

As far as I understand, modifying boot.oat is not easy, and permanent, as this file is regenerated whenever a package installation is happening.

Now, I have a class which I need to modify (just a very tiny bit of it), which resides in framework.dex which was the part of boot.oat.

I have two questions:

  1. How can I repack boot.oat? Taking into account that I haven't touch boot.art?
  2. How can I make my change in boot.oat permanent? It's very well possible that I will install some new packages onto this system later, which will (might?) ruin my modification.


  • Are you sure that boot.oat is regenerated when a package is installed? I would have assumed that it is only regenerated after a system update has been installed.
    – Robert
    Aug 1 at 14:57
  • I might misunderstood something, and yes, boot.oat might only be replaced during system update, which is unlikely for these old devices. Can you help me on Q1 please?
    – Daniel
    Aug 1 at 15:32
  • As far as I remember the original dex file is completely included in the oat file (or was it in the art file? don't really remember that). If it is use a hex editor, search for the DEX_FILE_MAGIC and extract the dex file. Then decompilation should not be a problem.
    – Robert
    Aug 1 at 15:41
  • Original DEX is in boot.oat (framework.dex). I need to modify a class in framework.dex, and put it back to boot.oat. But I've various information on rewriting header hash, or CRC or whatever.
    – Daniel
    Aug 1 at 16:06
  • Start to deodex with any kitchen, after that you can modify th framework.jar
    – Soma Mhoud
    Aug 2 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.