When an activity is launched, the classes.dex file is loaded by the system and start executing the instructions. I need to get readonly access to the classes.dex of the same application under which the current activity is executing.
After searching for hours on the net, I could only infer that the Android Security system does not allow access to the application sandbox.
However, i need readonly access to the classes.dex file in order to accomplish my task.
Does anyone have a insight on this?
Thanks in advance!
Depends on what you are trying to do, but you can access the DexFile :
String sourceDir = context.getApplicationInfo().sourceDir;
DexFile dexFile = new DexFile(sourceDir);
it gives you a http://developer.android.com/reference/dalvik/system/DexFile.html which you can enumerate, and load classes from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With