.class public Lcom/moji/mjweather/assshop/db/AvatarDBManager$AvatarDBHelper;
.super Landroid/database/sqlite/SQLiteOpenHelper;
.source "AvatarDBManager.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/moji/mjweather/assshop/db/AvatarDBManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "AvatarDBHelper"
.end annotation


# instance fields
.field final synthetic a:Lcom/moji/mjweather/assshop/db/AvatarDBManager;


# direct methods
.method public constructor <init>(Lcom/moji/mjweather/assshop/db/AvatarDBManager;)V
    .locals 3

    .line 167
    iput-object p1, p0, Lcom/moji/mjweather/assshop/db/AvatarDBManager$AvatarDBHelper;->a:Lcom/moji/mjweather/assshop/db/AvatarDBManager;

    .line 168
    sget-object p1, Lcom/moji/mjweather/MJApplication;->sContext:Landroid/content/Context;

    const-string v0, "avatarShop.db"

    const/4 v1, 0x0

    const/4 v2, 0x2

    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

    return-void
.end method


# virtual methods
.method public onCreate(Landroid/database/sqlite/SQLiteDatabase;)V
    .locals 1

    const-string v0, "CREATE TABLE IF NOT EXISTS AvatarShop(id INTEGER PRIMARY KEY NOT NULL, type INTEGER NOT NULL, name VARCHAR(50) NOT NULL, key VARCHAR(100), details VARCHAR(200), faceurl VARCHAR(200), bkurl VARCHAR(200), cardurl VARCHAR(200), durl VARCHAR(200), useNum INTEGER, isNew INTEGER, strartDate VARCHAR(100),  prefix VARCHAR(100) NOT NULL UNIQUE, endDate VARCHAR(100), cardValidTimeDetails VARCHAR(100), rankDetail INTEGER, updateTime INTEGER,sex INTEGER NOT NULL, voiceId INTEGER, trialUrl VARCHAR(200), voiceUrl VARCHAR(200), insertTime INTEGER);"

    .line 181
    invoke-virtual {p1, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    return-void
.end method

.method public onUpgrade(Landroid/database/sqlite/SQLiteDatabase;II)V
    .locals 0

    const/4 p2, 0x2

    if-ne p3, p2, :cond_0

    .line 190
    :try_start_0
    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V

    const-string p2, "ALTER TABLE AvatarShop RENAME TO temp_AvatarShop;"

    .line 192
    invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    const-string p2, "CREATE TABLE IF NOT EXISTS AvatarShop(id INTEGER PRIMARY KEY NOT NULL, type INTEGER NOT NULL, name VARCHAR(50) NOT NULL, key VARCHAR(100), details VARCHAR(200), faceurl VARCHAR(200), bkurl VARCHAR(200), cardurl VARCHAR(200), durl VARCHAR(200), useNum INTEGER, isNew INTEGER, strartDate VARCHAR(100),  prefix VARCHAR(100) NOT NULL UNIQUE, endDate VARCHAR(100), cardValidTimeDetails VARCHAR(100), rankDetail INTEGER, updateTime INTEGER,sex INTEGER NOT NULL, voiceId INTEGER, trialUrl VARCHAR(200), voiceUrl VARCHAR(200), insertTime INTEGER);"

    .line 201
    invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    const-string p2, "INSERT INTO AvatarShop (id,type,name,key,details,faceurl,bkurl,cardurl,durl,useNum,isNew,strartDate,prefix,endDate,cardValidTimeDetails,rankDetail,updateTime,sex,voiceId,trialUrl, voiceUrl,insertTime) SELECT id,type,name,key,details,faceurl,bkurl,cardurl,durl,useNum,isNew,strartDate,prefix,endDate,cardValidTimeDetails,rankDetail,updateTime,\'\',\'\',\'\', \'\',\'\'  FROM temp_AvatarShop;"

    .line 203
    invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    const-string p2, "DROP TABLE IF EXISTS temp_AvatarShop;"

    .line 211
    invoke-virtual {p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 213
    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_0
    .catch Landroid/database/SQLException; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p2

    goto :goto_1

    :catch_0
    move-exception p2

    .line 215
    :try_start_1
    invoke-static {}, Lcom/moji/mjweather/assshop/db/AvatarDBManager;->a()Ljava/lang/String;

    move-result-object p3

    invoke-static {p3, p2}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 217
    :goto_0
    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    goto :goto_2

    :goto_1
    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 218
    throw p2

    :cond_0
    :goto_2
    return-void
.end method
