Sunday, October 18, 2009

Help needed

I decided to release a new version of dedexer but I am not satisfied. The Holy Grail I am chasing is the high-quality disassembly of ODEX files and I intended to use the hint received from Nenik. I extended the dedexer tool with data flow analysis so it now has knowledge about the types in Dalvik registers at any point of the execution of Android bytecode. If you ask nicely the new version of the tool (-r switch), it will even share this information with you. Now a decompiled method looks like this if this switch is used:

Great then, but where is the invoke-quick disassembly? Well, erm, I ran into problems. First of all, I could not figure out the data structures that store the names of other ODEX files that this ODEX file depends on. They seem to be in some sort of data structure at the end of the ODEX file that stores the name of these files but its exact layout remains a mistery for me.

Second, in order to decode invoke-quick statements, iget-object-quick statements also need to be decoded because the type values they put into Dalvik registers are needed for the data flow analyser. The source of this instruction is known as an offset and the mapping of these offsets back to Java types.

I will try to progress with these problems, any help is appreciated.

And now some PR after the boring technical details.

I will make a short presentation about dedexer during the coming Android meetup in London. If you are interested about the tool and central London is accessible for you, let's see each other there.

The point I was trying to make on the last slide of my presentation (last blog post) is that Dalvik's biggest weakness is the mark&sweep GC that the public version has (maybe there is already a better GC in Android but it is not visible from the outside world).

I thought that might be what you meant. In any case, yes, the existing heap code is not exactly the epitome of technical sophistication, and we are now working on a major revision of it. As always, I hope will get to see the light of day sooner rather than later. However (also as always) I can make no promises about a delivery date.

Yep, I've actually been aware of the JikesRVM project since back when it was called Jalapeño. Indeed, they've done some interesting stuff. I didn't think the project was actively being developed anymore, but I see that I was mistaken. Thanks for the (re)pointer!

About the blog

This blog is a personal diary about my adventures with the Google Android platform. I write it in the hope that others may find my experiences useful but please, beware. The blog is created as I gain experience about the platform myself so errors, omissions, etc. may be found in the entries.