Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android and java bytecode manipulation

I am new to java and I need to manipulate java bytecode for some purposes (see this). Java bytecode manipulation need following imports:

  1. org.objectweb.asm
  2. java.lang.instrument

I resolved org.objectweb.asm by downloading ASM package from asm website and related imports have been resolved.
I don't know how to resolve java.lang.instrument, My default ADT bundle hasn't it:

enter image description here

How do I resolve this import? Should I download any library? from where?
any help would be appreciated.
Thanks.

like image 562
mh taqia Avatar asked Nov 06 '13 06:11

mh taqia


1 Answers

The java.lang.instrument package isn't available for Android. Just like AWT and Swing. Have a look at this question:

Android & Dalvik - Get the size of an object

But it makes sense. Android apps are written at the source level in Java, but they don't run on the JVM -- they run on the dalvik VM. There's no contract there that says they have to support the standard Java library.

Sorry :(

like image 93
yamafontes Avatar answered Sep 30 '22 11:09

yamafontes