eclispe中查看Android中某个类源码,出现的.class文件中的内容是什么?解决办法
eclispe中查看Android中某个类源码,出现的.class文件中的内容是什么?
小弟初学Android,想看看Android某些类的源码,下载好源码并在eclipse当中配置好之后,想查看一下一个类的源码,如:SQLiteOpenHelper这个类.按了F3之后,出现的是这样一个文件SQLiteOpenHelper.class
------------------------------------------
文件SQLiteOpenHelper.class内容如下:
------------------------------------------
个人理解.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
小弟初学Android,想看看Android某些类的源码,下载好源码并在eclipse当中配置好之后,想查看一下一个类的源码,如:SQLiteOpenHelper这个类.按了F3之后,出现的是这样一个文件SQLiteOpenHelper.class
------------------------------------------
文件SQLiteOpenHelper.class内容如下:
------------------------------------------
/*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.java
package android.database.sqlite;
import android.content.Context;
// Referenced classes of package android.database.sqlite:
// SQLiteDatabase
public 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