k$a.smali
.class public final Lcom/loc/k$a;
.super Landroid/content/ContextWrapper;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/loc/k;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "a"
.end annotation
# instance fields
.field private a:Ljava/lang/String;
.field private b:Landroid/content/Context;
# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
.registers 3
invoke-direct {p0, p1}, Landroid/content/ContextWrapper;-><init>(Landroid/content/Context;)V
iput-object p2, p0, Lcom/loc/k$a;->a:Ljava/lang/String;
iput-object p1, p0, Lcom/loc/k$a;->b:Landroid/content/Context;
return-void
.end method
# virtual methods
.method public final getDatabasePath(Ljava/lang/String;)Ljava/io/File;
.registers 8
:try_start_0
invoke-static {}, Lcom/loc/k;->a()Z
move-result v0
if-eqz v0, :cond_11
iget-object v0, p0, Lcom/loc/k$a;->b:Landroid/content/Context;
const-string/jumbo v1, "android.permission.WRITE_EXTERNAL_STORAGE"
invoke-static {v0, v1}, Lcom/loc/cz;->a(Landroid/content/Context;Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_16
:cond_11
invoke-super {p0, p1}, Landroid/content/ContextWrapper;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
:cond_15
:goto_15
return-object v0
:cond_16
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object v1, p0, Lcom/loc/k$a;->a:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string/jumbo v1, "/"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
new-instance v0, Ljava/io/File;
iget-object v1, p0, Lcom/loc/k$a;->a:Ljava/lang/String;
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
if-nez v1, :cond_40
invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z
:cond_40
invoke-static {}, Lcom/loc/k;->b()Z
move-result v0
if-eqz v0, :cond_4c
invoke-static {}, Lcom/loc/k;->a()Z
move-result v0
if-nez v0, :cond_81
:cond_4c
invoke-static {}, Lcom/loc/k;->c()Z
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object v1, p0, Lcom/loc/k$a;->a:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
sget-object v1, Ljava/io/File;->separator:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v4
invoke-virtual {v0, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v0
const-string/jumbo v1, ".db"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
new-instance v1, Ljava/io/File;
invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z
move-result v0
if-eqz v0, :cond_99
invoke-virtual {v1}, Ljava/io/File;->delete()Z
:cond_81
const/4 v1, 0x0
new-instance v0, Ljava/io/File;
invoke-direct {v0, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/io/File;->exists()Z
:try_end_8a
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_8a} :catch_a7
move-result v2
if-nez v2, :cond_b1
:try_start_8d
invoke-virtual {v0}, Ljava/io/File;->createNewFile()Z
:try_end_90
.catch Ljava/io/IOException; {:try_start_8d .. :try_end_90} :catch_a2
.catch Ljava/lang/Throwable; {:try_start_8d .. :try_end_90} :catch_a7
move-result v1
:goto_91
if-nez v1, :cond_15
:try_start_93
invoke-super {p0, p1}, Landroid/content/ContextWrapper;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
goto/16 :goto_15
:cond_99
invoke-static {}, Lcom/loc/k;->d()Z
invoke-super {p0, p1}, Landroid/content/ContextWrapper;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
goto/16 :goto_15
:catch_a2
move-exception v2
invoke-static {}, Lcom/loc/k;->d()Z
:try_end_a6
.catch Ljava/lang/Throwable; {:try_start_93 .. :try_end_a6} :catch_a7
goto :goto_91
:catch_a7
move-exception v0
invoke-static {}, Lcom/loc/k;->d()Z
invoke-super {p0, p1}, Landroid/content/ContextWrapper;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
goto/16 :goto_15
:cond_b1
const/4 v1, 0x1
goto :goto_91
.end method
.method public final openOrCreateDatabase(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;
.registers 7
const/4 v1, 0x0
invoke-virtual {p0, p1}, Lcom/loc/k$a;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
if-eqz v0, :cond_16
:try_start_7
invoke-virtual {p0, p1}, Lcom/loc/k$a;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
const/4 v2, 0x0
invoke-static {v0, v2}, Landroid/database/sqlite/SQLiteDatabase;->openOrCreateDatabase(Ljava/io/File;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;
:try_end_f
.catch Ljava/lang/Throwable; {:try_start_7 .. :try_end_f} :catch_13
move-result-object v0
:goto_10
if-eqz v0, :cond_16
:goto_12
return-object v0
:catch_13
move-exception v0
move-object v0, v1
goto :goto_10
:cond_16
iget-object v0, p0, Lcom/loc/k$a;->b:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0, p1}, Landroid/content/Context;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
invoke-static {v0, v1}, Landroid/database/sqlite/SQLiteDatabase;->openOrCreateDatabase(Ljava/io/File;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;
move-result-object v0
goto :goto_12
.end method
.method public final openOrCreateDatabase(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CursorFactory;Landroid/database/DatabaseErrorHandler;)Landroid/database/sqlite/SQLiteDatabase;
.registers 8
const/4 v1, 0x0
invoke-virtual {p0, p1}, Lcom/loc/k$a;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
if-eqz v0, :cond_16
:try_start_7
invoke-virtual {p0, p1}, Lcom/loc/k$a;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
const/4 v2, 0x0
invoke-static {v0, v2}, Landroid/database/sqlite/SQLiteDatabase;->openOrCreateDatabase(Ljava/io/File;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;
:try_end_f
.catch Ljava/lang/Throwable; {:try_start_7 .. :try_end_f} :catch_13
move-result-object v0
:goto_10
if-eqz v0, :cond_16
:goto_12
return-object v0
:catch_13
move-exception v0
move-object v0, v1
goto :goto_10
:cond_16
iget-object v0, p0, Lcom/loc/k$a;->b:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object v0
invoke-virtual {v0, p1}, Landroid/content/Context;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v0
invoke-static {v0, v1}, Landroid/database/sqlite/SQLiteDatabase;->openOrCreateDatabase(Ljava/io/File;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;
move-result-object v0
goto :goto_12
.end method