views:

450

answers:

2

I would like to execute opcodes directly against the running Dalvik VM instance from within my application on Android. I'm looking for something similar to the C asm function. I have a list of opcodes for dalvik, but I am unfamiliar with how to either execute them directly, or write them out to .class files and execute them against some sort of VM CLI command like dalvikvm from within a running application.

A: 

I expect that you will have to generate a dex file. See

hacken
So, the answer is that you can not really do this in the way I was suggesting, without root access?
Heat Miser
+2  A: 

its not possible. See the Google IO 2008 presentation on youtube about Dalvik internals for details. Mobile VMs including both Java and MS .NET are not full VMs and due to memory and performance constraints thus leave out parts that allow to accomplish what you have described.

Fred Grott
As I dug further into it, I see that this is unfortunately true...Thanks!
Heat Miser
yes, unfortunately..
Fred Grott