Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Patching a single .odex in G1's core system
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
luke  
View profile  
 More options Jan 8, 8:43 pm
From: luke <luke.hu...@gmail.com>
Date: Thu, 8 Jan 2009 17:43:13 -0800 (PST)
Local: Thurs, Jan 8 2009 8:43 pm
Subject: Patching a single .odex in G1's core system
I have written a patch for a class in "framework" that I want to
install on my G1.  I have root, but I want to make sure I don't break
my phone.  I rebuilt the framework .dex file:

$ ls -l out/target/common/obj/JAVA_LIBRARIES/framework_intermediates
total 11800
-rw-r--r-- 1 luke luke 4889000 2009-01-08 07:11 classes.dex
-rw-r--r-- 1 luke luke 4823689 2009-01-08 07:09 classes.jar
-rw-r--r-- 1 luke luke  197692 2009-01-08 07:25 droiddoc-src-list
-rw-r--r-- 1 luke luke 2126019 2009-01-08 07:11 javalib.jar
drwxr-xr-x 7 luke luke    4096 2008-10-21 23:23 src

I understand I need to convert this to a .odex file after installing,
but what is the right tool and what is the right way of using it?  Do
I just call dexopt-wrapper on the file to build the .odex and the
correct small corresponding .jar, then replace the installed ones and
reboot?

Also what is the chance of this framework.odex being incompatible with
the rest of the classes in the G1 system image, if I grabbed a git
clone of the 1.0 repository shortly after the release of the 1.0
code?  (i.e. how likely am I to break my system?)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fadden  
View profile  
 More options Jan 9, 12:46 am
From: fadden <fad...@android.com>
Date: Thu, 8 Jan 2009 21:46:06 -0800 (PST)
Local: Fri, Jan 9 2009 12:46 am
Subject: Re: Patching a single .odex in G1's core system
On Jan 8, 5:43 pm, luke <luke.hu...@gmail.com> wrote:

> I understand I need to convert this to a .odex file after installing,
> but what is the right tool and what is the right way of using it?  Do
> I just call dexopt-wrapper on the file to build the .odex and the
> correct small corresponding .jar, then replace the installed ones and
> reboot?

You can read all about the exciting world of .odex in davlik/docs/
dexopt.html in the source tree or git repository.

If you remove framework.odex and replace framework.jar with what
you've built, the necessary optimized DEX file will be generated in /
data/dalvik-cache when you restart the framework.  Keep an eye on
"logcat" to see it do its thing.  You probably want out/target/product/
dream/system/framework/framework.jar, not the stuff from the
intermediates directory, if you go this route.

Otherwise, running dexopt-wrapper on the device will work to convert
classes.dex into classes.odex.  You can leave the corresponding jar
file alone unless your change affects it somehow.

You may want to experiment with this stuff on the emulator, where the
price of doing it wrong is small.

> Also what is the chance of this framework.odex being incompatible with
> the rest of the classes in the G1 system image, if I grabbed a git
> clone of the 1.0 repository shortly after the release of the 1.0
> code?  (i.e. how likely am I to break my system?)

Mixing and matching from different releases is not a good idea.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
luke  
View profile  
 More options Jan 9, 1:04 am
From: luke <luke.hu...@gmail.com>
Date: Thu, 8 Jan 2009 22:04:36 -0800 (PST)
Local: Fri, Jan 9 2009 1:04 am
Subject: Re: Patching a single .odex in G1's core system
Thanks for the info.  What is the closest git version to what made it
into the G1?

On Jan 9, 12:46 am, fadden <fad...@android.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dianne Hackborn  
View profile  
 More options Jan 9, 2:45 am
From: "Dianne Hackborn" <hack...@android.com>
Date: Thu, 8 Jan 2009 23:45:59 -0800
Local: Fri, Jan 9 2009 2:45 am
Subject: Re: Patching a single .odex in G1's core system

On Thu, Jan 8, 2009 at 10:04 PM, luke <luke.hu...@gmail.com> wrote:
> Thanks for the info.  What is the closest git version to what made it
> into the G1?

There isn't anything close enough to selectively replace the framework jar.
The open source tree represents a version of the code with a number of
changes from after the image shipped on the G1 that impact the framework.

--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
luke  
View profile  
 More options Jan 9, 1:41 pm
From: luke <luke.hu...@gmail.com>
Date: Fri, 9 Jan 2009 10:41:25 -0800 (PST)
Local: Fri, Jan 9 2009 1:41 pm
Subject: Re: Patching a single .odex in G1's core system
Hmm.  Is there some way to just replace one class in an odex file?

I rebuilt the entire system image using non-cupcake git head and
loaded it onto the phone, but several things are broken (Messaging,
phone radio) so I can't use this patched system image for my daily
phone use.  I want to apply the least invasive patch possible, just
enough to add the framework functionality I need to start building a
specialized app on top of my patched phone that makes use of the added
framework functionality, but I need to be able to continue actually
using the phone.

I notice that as well as a framework.odex on the phone, there's also a
framework.jar but it's tiny.  Is there some way I can get a copy of
the original framework.jar that was used to generate the
framework.odex, so that I can just replace the one .jar file for the
framework class I'm modifying, then have the phone re-create the .odex
file from the modified .jar?

Thanks!

On Jan 9, 2:45 am, "Dianne Hackborn" <hack...@android.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
luke  
View profile  
 More options Jan 9, 1:44 pm
From: luke <luke.hu...@gmail.com>
Date: Fri, 9 Jan 2009 10:44:10 -0800 (PST)
Local: Fri, Jan 9 2009 1:44 pm
Subject: Re: Patching a single .odex in G1's core system

> Is there some way I can get a copy of
> the original framework.jar that was used to generate the
> framework.odex, so that I can just replace the one .jar file for the
> framework class I'm modifying, then have the phone re-create the .odex
> file from the modified .jar?

(sorry, that should say "so that I can just replace the one .class
file for the framework class I'm modifying")

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fadden  
View profile  
 More options Jan 9, 8:22 pm
From: fadden <fad...@android.com>
Date: Fri, 9 Jan 2009 17:22:46 -0800 (PST)
Local: Fri, Jan 9 2009 8:22 pm
Subject: Re: Patching a single .odex in G1's core system
On Jan 9, 10:41 am, luke <luke.hu...@gmail.com> wrote:

> Hmm.  Is there some way to just replace one class in an odex file?

Is it theoretically possible?  Yes.

It would not be easy though.  You'd have to spend a bunch of time
developing tools to break apart and reassemble the DEX, and the
presence of "quickened" instructions in the .odex make it even harder.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google