小弟初学Android,想看看Android某些类的源码,下载好源码并在eclipse当中配置好之后,想查看一下一个类的源码,如:SQLiteOpenHelper这个类.按了F3之后,出现的是这样一个文件SQLiteOpenHelper.class
------------------------------------------
文件SQLiteOpenHelper.class内容如下:
------------------------------------------
- Java code
/*jadclipse*/// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.// Jad home page: http://www.kpdus.com/jad.html// Decompiler options: packimports(3) radix(10) lradix(10) // Source File Name: SQLiteOpenHelper.javapackage android.database.sqlite;import android.content.Context;// Referenced classes of package android.database.sqlite:// SQLiteDatabasepublic abstract class SQLiteOpenHelper{ public SQLiteOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) { throw new RuntimeException("Stub!"); } public synchronized SQLiteDatabase getWritableDatabase() { throw new RuntimeException("Stub!"); } public synchronized SQLiteDatabase getReadableDatabase() { throw new RuntimeException("Stub!"); } public synchronized void close() { throw new RuntimeException("Stub!"); } public abstract void onCreate(SQLiteDatabase sqlitedatabase); public abstract void onUpgrade(SQLiteDatabase sqlitedatabase, int i, int j); public void onOpen(SQLiteDatabase db) { throw new RuntimeException("Stub!"); }}/* DECOMPILATION REPORT Decompiled from: C:\android-sdk-windows\platforms\android-4\android.jar Total time: 16 ms Jad reported messages/errors: Exit status: 0 Caught exceptions:*/
个人理解.class文件不是字节码文件吗?那为什么网上说这里面的就是Android的类的源码了呢?看这个文件里面也没有什么东西啊。
------解决方案--------------------
一般都是这样的啊:
比如:TimePicker这个类。
// Compiled from TimePicker.java (version 1.5 : 49.0, super bit)
public class android.widget.TimePicker extends android.widget.FrameLayout {
// Method descriptor #13 (Landroid/content/Context;)V
// Stack: 4, Locals: 2
public TimePicker(android.content.Context context);
0 aload_0 [this]
1 aconst_null
2 checkcast android.content.Context [1]
5 aconst_null
6 checkcast android.util.AttributeSet [2]
9 iconst_0
10 invokespecial android.widget.FrameLayout(android.content.Context, android.util.AttributeSet, int) [3]
13 new java.lang.RuntimeException [4]
16 dup
17 ldc <String "Stub!"> [5]
19 invokespecial java.lang.RuntimeException(java.lang.String) [6]
22 athrow
Line numbers:
[pc: 0, line: 9]
Local variable table:
[pc: 0, pc: 23] local: this index: 0 type: android.widget.TimePicker
[pc: 0, pc: 23] local: context index: 1 type: android.content.Context
// Method descriptor #21 (Landroid/content/Context;Landroid/util/AttributeSet;)V
// Stack: 4, Locals: 3
public TimePicker(android.content.Context context, android.util.AttributeSet attrs);
0 aload_0 [this]
1 aconst_null
2 checkcast android.content.Context [1]
5 aconst_null
6 checkcast android.util.AttributeSet [2]
9 iconst_0
10 invokespecial android.widget.FrameLayout(android.content.Context, android.util.AttributeSet, int) [3]
13 new java.lang.RuntimeException [4]
16 dup
17 ldc <String "Stub!"> [5]
19 invokespecial java.lang.RuntimeException(java.lang.String) [6]
22 athrow
Line numbers:
[pc: 0, line: 10]
Local variable table:
[pc: 0, pc: 23] local: this index: 0 type: android.widget.TimePicker