JavaStub is a simple utility for turning Android Dalvik Smali files into Java "stub" files.
Sometimes you need to interact with Android frameworks or applications that are closed source and undocumented. One part of this is discovering what methods and fields are available. Another part is generating what in other languages would be a "header file". You can generate Smali files from an .apk file using ApkTool. But the javac compiler can not work with Dex or Smali, it needs Java or JVM .jar files.
The new .jar file has no actual implementation. It is only there to compile against. If it were included in your own application it would not do anything. We want your application to use the code already on your device.
Parameter names are included when available. When not, they appear as the "p" register numbers. The numbers may not be contiguous as long and double use two registers.
Note that enums are handled specially. Enums with values are extracted as documentation, though as the code is never executed it affects nothing. The /s flag may be used to generate simplified code without the values.
When browsing through decompiled code JavaStub can be helpful for seeing an overview of a class without wallowing through pages of smali.
Download javastub.exe for Win32