296 lines
7.5 KiB
Smali
296 lines
7.5 KiB
Smali
.class public abstract Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;
|
|
.super Ljava/lang/Object;
|
|
.source "SupportSQLiteOpenHelper.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Landroidx/sqlite/db/SupportSQLiteOpenHelper;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x409
|
|
name = "Callback"
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final TAG:Ljava/lang/String; = "SupportSQLite"
|
|
|
|
|
|
# instance fields
|
|
.field public final version:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(I)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput p1, p0, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;->version:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private deleteDatabaseFile(Ljava/lang/String;)V
|
|
.locals 2
|
|
|
|
const-string v0, ":memory:"
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "deleting the database file: "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "SupportSQLite"
|
|
|
|
invoke-static {v1, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:try_start_0
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
new-instance v0, Ljava/io/File;
|
|
|
|
invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Landroid/database/sqlite/SQLiteDatabase;->deleteDatabase(Ljava/io/File;)Z
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
const-string v0, "delete failed: "
|
|
|
|
invoke-static {v1, v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onConfigure(Landroidx/sqlite/db/SupportSQLiteDatabase;)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onCorruption(Landroidx/sqlite/db/SupportSQLiteDatabase;)V
|
|
.locals 2
|
|
|
|
const-string v0, "Corruption reported by sqlite on database: "
|
|
|
|
invoke-static {v0}, Le/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "SupportSQLite"
|
|
|
|
invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->isOpen()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;->deleteDatabaseFile(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->getAttachedDbs()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
:try_end_0
|
|
.catch Landroid/database/sqlite/SQLiteException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
goto :goto_1
|
|
|
|
:catch_0
|
|
:goto_0
|
|
:try_start_1
|
|
invoke-interface {p1}, Ljava/io/Closeable;->close()V
|
|
:try_end_1
|
|
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
goto :goto_3
|
|
|
|
:goto_1
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_2
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/util/Pair;
|
|
|
|
iget-object v0, v0, Landroid/util/Pair;->second:Ljava/lang/Object;
|
|
|
|
check-cast v0, Ljava/lang/String;
|
|
|
|
invoke-direct {p0, v0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;->deleteDatabaseFile(Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;->deleteDatabaseFile(Ljava/lang/String;)V
|
|
|
|
:cond_2
|
|
throw v1
|
|
|
|
:catch_1
|
|
nop
|
|
|
|
:goto_3
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_4
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/util/Pair;
|
|
|
|
iget-object v0, v0, Landroid/util/Pair;->second:Ljava/lang/Object;
|
|
|
|
check-cast v0, Ljava/lang/String;
|
|
|
|
invoke-direct {p0, v0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;->deleteDatabaseFile(Ljava/lang/String;)V
|
|
|
|
goto :goto_4
|
|
|
|
:cond_3
|
|
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;->deleteDatabaseFile(Ljava/lang/String;)V
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method public abstract onCreate(Landroidx/sqlite/db/SupportSQLiteDatabase;)V
|
|
.end method
|
|
|
|
.method public onDowngrade(Landroidx/sqlite/db/SupportSQLiteDatabase;II)V
|
|
.locals 2
|
|
|
|
new-instance p1, Landroid/database/sqlite/SQLiteException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Can\'t downgrade database from version "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string p2, " to "
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Landroid/database/sqlite/SQLiteException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public onOpen(Landroidx/sqlite/db/SupportSQLiteDatabase;)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public abstract onUpgrade(Landroidx/sqlite/db/SupportSQLiteDatabase;II)V
|
|
.end method
|