.class public Lcom/mymod/MenuApplication;
.super Lcom/tencent/tpshell/TPShellApplication;
# direct methods
.method public constructor <init>()V
.registers 1
.prologue
.line 29
invoke-direct {p0}, Lcom/tencent/tpshell/TPShellApplication;-><init>()V
return-void
.end method
.method private Config(Landroid/content/Context;)V
.registers 5
.annotation build Landroid/annotation/SuppressLint;
value = {
"UnsafeDynamicallyLoadedCode"
}
.end annotation
.prologue
.line 41
invoke-virtual {p1}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;
move-result-object v0
.line 42
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p1}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
move-result-object v2
invoke-virtual {v2}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
const-string v2, "/.mygame"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
.line 43
new-instance v2, Ljava/io/File;
invoke-direct {v2, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v2}, Ljava/io/File;->exists()Z
move-result v2
if-nez v2, :cond_38
.line 45
:try_start_2a
const-string v2, "mygame"
invoke-virtual {v0, v2}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;
move-result-object v0
new-instance v2, Ljava/io/FileOutputStream;
invoke-direct {v2, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V
invoke-static {v0, v2}, Lcom/mymod/MenuApplication;->copyFile(Ljava/io/InputStream;Ljava/io/OutputStream;)V
:try_end_38
.catch Ljava/io/IOException; {:try_start_2a .. :try_end_38} :catch_39
.line 50
:cond_38
:goto_38
return-void
.line 46
:catch_39
move-exception v0
.line 47
invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
goto :goto_38
.end method
.method private static copyFile(Ljava/io/InputStream;Ljava/io/OutputStream;)V
.registers 5
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.prologue
.line 53
const/16 v0, 0x400
new-array v0, v0, [B
.line 55
:goto_4
invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I
move-result v1
.line 56
const/4 v2, -0x1
if-eq v1, v2, :cond_10
.line 57
const/4 v2, 0x0
invoke-virtual {p1, v0, v2, v1}, Ljava/io/OutputStream;->write([BII)V
goto :goto_4
.line 59
:cond_10
return-void
.end method
# virtual methods
.method public attachBaseContext(Landroid/content/Context;)V
.registers 2
.prologue
.line 35
invoke-direct {p0, p1}, Lcom/mymod/MenuApplication;->Config(Landroid/content/Context;)V
.line 36
invoke-super {p0, p1}, Landroid/app/Application;->attachBaseContext(Landroid/content/Context;)V
.line 37
return-void
.end method