You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
170 lines
5.8 KiB
170 lines
5.8 KiB
.class public Lcom/viatech/database/SQLOpenHelper; |
|
.super Landroid/database/sqlite/SQLiteOpenHelper; |
|
.source "SQLOpenHelper.java" |
|
|
|
|
|
# static fields |
|
.field private static final TAG:Ljava/lang/String; = "SQLOpenHelper" |
|
|
|
.field private static final VpaiDBName:Ljava/lang/String; = "720vpai.db" |
|
|
|
|
|
# direct methods |
|
.method public constructor <init>(Landroid/content/Context;)V |
|
.locals 3 |
|
|
|
.prologue |
|
.line 18 |
|
const-string v0, "720vpai.db" |
|
|
|
const/4 v1, 0x0 |
|
|
|
invoke-static {p1}, Lcom/viatech/database/SQLOpenHelper;->getDatabaseVersion(Landroid/content/Context;)I |
|
|
|
move-result v2 |
|
|
|
invoke-direct {p0, p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteOpenHelper;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;I)V |
|
|
|
.line 19 |
|
const-string v0, "SQLOpenHelper" |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v2, "SQLOpenHelper->version:" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-static {p1}, Lcom/viatech/database/SQLOpenHelper;->getDatabaseVersion(Landroid/content/Context;)I |
|
|
|
move-result v2 |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I |
|
|
|
.line 20 |
|
return-void |
|
.end method |
|
|
|
.method public static getDatabaseVersion(Landroid/content/Context;)I |
|
.locals 3 |
|
|
|
.prologue |
|
.line 102 |
|
:try_start_0 |
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager; |
|
|
|
move-result-object v0 |
|
|
|
.line 103 |
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
const/4 v2, 0x0 |
|
|
|
.line 102 |
|
invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo; |
|
|
|
move-result-object v0 |
|
|
|
iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I |
|
:try_end_0 |
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0 |
|
|
|
return v0 |
|
|
|
.line 104 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 105 |
|
new-instance v0, Ljava/lang/RuntimeException; |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v2, "couldn\'t get version code for " |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public onCreate(Landroid/database/sqlite/SQLiteDatabase;)V |
|
.locals 2 |
|
|
|
.prologue |
|
.line 24 |
|
const-string v0, "SQLOpenHelper" |
|
|
|
const-string v1, "SQLOpenHelper->onCreate()" |
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I |
|
|
|
.line 25 |
|
const-string v0, "CREATE TABLE IF NOT EXISTS deviceinfo (mac TEXT,deviceid TEXT,version INTEGER,newversion INTEGER,isupdate INTEGER,product TEXT,manufactory TEXT,module TEXT,newdeviceid TEXT,changelog TEXT);" |
|
|
|
invoke-virtual {p1, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V |
|
|
|
.line 38 |
|
const-string v0, "CREATE TABLE IF NOT EXISTS communityRecommendPartDatas (postid INTEGER,forumid INTEGER,authorid INTEGER,authoruid TEXT,author TEXT,authorimg TEXT,ipaddr TEXT,thumburl TEXT,content TEXT,addr TEXT,createtime TEXT,rank TEXT,views INTEGER,favs INTEGER,up INTEGER,down INTEGER,comments INTEGER,isbest INTEGER,status INTEGER,url TEXT);" |
|
|
|
invoke-virtual {p1, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V |
|
|
|
.line 61 |
|
const-string v0, "CREATE TABLE IF NOT EXISTS communityNewPartDatas (postid INTEGER,forumid INTEGER,authorid INTEGER,authoruid TEXT,author TEXT,authorimg TEXT,ipaddr TEXT,thumburl TEXT,content TEXT,addr TEXT,createtime TEXT,rank TEXT,views INTEGER,favs INTEGER,up INTEGER,down INTEGER,comments INTEGER,isbest INTEGER,status INTEGER,url TEXT);" |
|
|
|
invoke-virtual {p1, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V |
|
|
|
.line 84 |
|
const-string v0, "CREATE TABLE IF NOT EXISTS communityBannerAdDatas (bannerid INTEGER,imageurl TEXT,linkurl TEXT,rank INTEGER,views INTEGER,visible INTEGER);" |
|
|
|
invoke-virtual {p1, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V |
|
|
|
.line 92 |
|
return-void |
|
.end method |
|
|
|
.method public onUpgrade(Landroid/database/sqlite/SQLiteDatabase;II)V |
|
.locals 2 |
|
|
|
.prologue |
|
.line 96 |
|
const-string v0, "SQLOpenHelper" |
|
|
|
const-string v1, "SQLOpenHelper->onUpgrade()" |
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I |
|
|
|
.line 97 |
|
invoke-virtual {p0, p1}, Lcom/viatech/database/SQLOpenHelper;->onCreate(Landroid/database/sqlite/SQLiteDatabase;)V |
|
|
|
.line 98 |
|
return-void |
|
.end method
|
|
|