Laurent Meyer
Laurent Meyer

Reputation: 2881

Change the internal behaviour of a JVM (more precisely Dalvik)

The question is maybe not that precise, but I didn't find the answer on the Internet and I would be interested to learn about it: as many JVM are open source, would it be possible to change their internal behaviour? For example, would it be possible to mock their random function (and set always 42 as Random number? :) ).

I would like to try to change this function in a Dalvik VM (I'm Android fan), recompile it and try to push it to my phone to see the effects on it.

Also, in this precise case, won't it create a security hole because classes like SecureRandom won't be able to work correctly?

Actually, I'm developer but I'm trying to go a bit deeper (because learning is always cool) but I got no precise idea of it. Is it at least possible what I'm figuring out or I totally misunderstood the whole workflow ?

Upvotes: 0

Views: 74

Answers (1)

odexcide
odexcide

Reputation: 682

Check out Dynamic Dalvik Instrumentation. There is a link to the SummerCon presentation with slides and examples.

Upvotes: 2

Related Questions