Question

I want to get the Dalvik bytecode for standard Java libraries, I mean, java libraries that are utilized by Android (e.g. java.util.* collections).

I need to get those class files because I want to analyze them, not all of them, but something like java.util.*, java.lang.*, etc.

However, when compiling any Android applications, no class files of those standard libraries would be generated, except for the application code and dependencies libraries.

So I'm wondering how to get the compiled class files (and its corespondent dex files when compiling in Dalvik VM)?

I tried to pull the standard Java libraries in an Android project, like get all the Java source code and add them as application code, OR put the classes.jar (rt.jar) in the libs folder, however, these two ways are not working because the source code or jar file in project will be in conflict with the default compilation environment and so give out dreaded error Conversion to Dalvik format failed with error 1

Any idea how to get what I want?

Was it helpful?

Solution

The sources and the binaries of the system libraries are available as part of the Android SDK. Just look into the install directory platforms/android-{version}/android.jar for the binaries and sources/android-{version} for the sources (if you installed it).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top