views:

40

answers:

1

Kinda like in the format of a class-dump result but in Java, I already have the Android.jar file and I would like to dump a clean listing of classes and methods for each .class file. How do I do this? p.s. HTML documents seem too messy and hard to parse.

+1  A: 

unzip -l Android.jar should do the trick.

Another alternative: jar -t Android.jar

$ jar
Usage: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
Options:
    ...
    -t  list table of contents for archive
    ...

To list classes and methods:

Unzip the .jar-file, loop through the files and use the javap command:

$ cat Test.java
public class Test {
    public static void main(String... args) {
        System.out.println("hello world");
    }

    public int f() {
        return 123;
    }

    private void g() {
    }
}

$ javac Test.java

$ javap Test
Compiled from "Test.java"
public class Test extends java.lang.Object{
    public Test();
    public static void main(java.lang.String[]);
    public int f();
}

$ 
aioobe
not that I need the list of files, but list of classes and methods for each compiled file :(
overboming